Pārlūkot izejas kodu

大屏显示接口,地图标注

ZeroLiYi 2 gadi atpakaļ
vecāks
revīzija
8a23368557

+ 48 - 1
src/main/java/com/unis/vis/controller/VisController.java

@@ -1,6 +1,12 @@
1 1
 package com.unis.vis.controller;
2 2
 
3
+import com.unis.vis.model.InboundMaterialInfo;
4
+import com.unis.vis.model.OutboundMaterialInfo;
5
+import com.unis.vis.model.SysDept;
3 6
 import com.unis.vis.model.SysTreeDict;
7
+import com.unis.vis.service.InboundMaterialInfoService;
8
+import com.unis.vis.service.OutboundMaterialInfoService;
9
+import com.unis.vis.service.SysDeptService;
4 10
 import com.unis.vis.service.SysTreeDictService;
5 11
 import org.springframework.web.bind.annotation.GetMapping;
6 12
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,10 +26,51 @@ public class VisController {
20 26
     @Resource
21 27
     private SysTreeDictService sysTreeDictService;
22 28
 
29
+    @Resource
30
+    private InboundMaterialInfoService inboundMaterialInfoService;
31
+
32
+    @Resource
33
+    private OutboundMaterialInfoService outboundMaterialInfoService;
34
+
35
+    @Resource
36
+    private SysDeptService sysDeptService;
37
+
38
+
23 39
     @GetMapping("/test")
24
-    public List<SysTreeDict> test() {
40
+     public List<SysTreeDict> test() {
25 41
         List<SysTreeDict> list = sysTreeDictService.list();
26 42
         return list;
27 43
     }
28 44
 
45
+    /*应用物资大类*/
46
+    @GetMapping("/getEmergencySuppliesCategory")
47
+    public List<InboundMaterialInfo> getEmergencySuppliesCategory() {
48
+        List<InboundMaterialInfo> list = inboundMaterialInfoService.getEmergencySuppliesCategory();
49
+        return list;
50
+    }
51
+
52
+    /*物资情况*/
53
+    @GetMapping("/getMaterialSituation")
54
+    public List<InboundMaterialInfo> getMaterialSituation() {
55
+        List<InboundMaterialInfo> list = inboundMaterialInfoService.getMaterialSituation();
56
+        return list;
57
+    }
58
+
59
+    /*物资调用情况*/
60
+    @GetMapping("/getMaterialCallSituation")
61
+    public List<OutboundMaterialInfo> getMaterialCallSituation() {
62
+        List<OutboundMaterialInfo> list = outboundMaterialInfoService.getMaterialCallSituation();
63
+        return list;
64
+    }
65
+    /*地图点位*/
66
+    @GetMapping("/getMapPoint")
67
+    public List<SysDept> getMapPoint() {
68
+        List<SysDept> list = sysDeptService.getMapPoint();
69
+        return list;
70
+    }
71
+
72
+
73
+
74
+
75
+
29 76
 }

+ 16 - 0
src/main/java/com/unis/vis/mapper/InboundMaterialInfoMapper.java

@@ -0,0 +1,16 @@
1
+package com.unis.vis.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.unis.vis.model.InboundMaterialInfo;
5
+import org.springframework.stereotype.Repository;
6
+
7
+import java.util.List;
8
+
9
+
10
+@Repository
11
+public interface InboundMaterialInfoMapper extends BaseMapper<InboundMaterialInfo> {
12
+
13
+     List<InboundMaterialInfo> getEmergencySuppliesCategory();
14
+
15
+     List<InboundMaterialInfo> getMaterialSituation();
16
+}

+ 16 - 0
src/main/java/com/unis/vis/mapper/OutboundMaterialInfoMapper.java

@@ -0,0 +1,16 @@
1
+package com.unis.vis.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.unis.vis.model.OutboundMaterialInfo;
5
+import org.springframework.stereotype.Repository;
6
+
7
+import java.util.List;
8
+
9
+
10
+@Repository
11
+public interface OutboundMaterialInfoMapper extends BaseMapper<OutboundMaterialInfo> {
12
+
13
+    List<OutboundMaterialInfo> getMaterialCallSituation();
14
+
15
+
16
+}

+ 17 - 0
src/main/java/com/unis/vis/mapper/SysDeptMapper.java

@@ -0,0 +1,17 @@
1
+package com.unis.vis.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.unis.vis.model.OutboundMaterialInfo;
5
+import com.unis.vis.model.SysDept;
6
+import org.springframework.stereotype.Repository;
7
+
8
+import java.util.List;
9
+
10
+
11
+@Repository
12
+public interface SysDeptMapper extends BaseMapper<SysDept> {
13
+
14
+    List<SysDept> getMapPoint();
15
+
16
+
17
+}

+ 105 - 0
src/main/java/com/unis/vis/model/InboundMaterialInfo.java

@@ -0,0 +1,105 @@
1
+package com.unis.vis.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableField;
4
+import com.baomidou.mybatisplus.annotation.TableName;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+@Data
9
+@EqualsAndHashCode(callSuper = false)
10
+@TableName("inbound_material_info")
11
+public class InboundMaterialInfo {
12
+    /**
13
+     * 入库物资id
14
+     */
15
+    @TableField("material_id")
16
+    private Integer materialId;
17
+    /**
18
+     * 入库信息表id
19
+     */
20
+    @TableField("inbound_id")
21
+    private Integer inboundId;
22
+    /**
23
+     * 入库类型
24
+     */
25
+    @TableField("inbound_type")
26
+    private String inboundType;
27
+    /**
28
+     * 物资大类
29
+     */
30
+
31
+    @TableField("material_group")
32
+    private String materialGroup;
33
+    /**
34
+     * 物资类别
35
+     */
36
+    @TableField("material_type")
37
+    private String materialType;
38
+    /**
39
+     * 物资名称
40
+     */
41
+    @TableField("material_name")
42
+    private String materialName;
43
+    /**
44
+     * 单位
45
+     */
46
+    @TableField("unit")
47
+    private String unit;
48
+    /**
49
+     * 数量
50
+     */
51
+    @TableField("quantity")
52
+    private String quantity;
53
+    /**
54
+     * 规格
55
+     */
56
+    @TableField("specs")
57
+    private String specs;
58
+    /**
59
+     * 入库日期
60
+     */
61
+
62
+    @TableField("inbound_time")
63
+    private String inboundTime;
64
+    /**
65
+     * 单价
66
+     */
67
+
68
+    @TableField("unit_price")
69
+    private String unitPrice;
70
+    /**
71
+     * 总价
72
+     */
73
+
74
+    @TableField("total_price")
75
+    private String totalPrice;
76
+    /**
77
+     * 是否可用
78
+     */
79
+
80
+    @TableField("is_available")
81
+    private String isAvailable;
82
+    /**
83
+     * 文件上传
84
+     */
85
+
86
+    @TableField("file_part")
87
+    private String filePart;
88
+    /**
89
+     * 备注
90
+     */
91
+
92
+    @TableField("remarks")
93
+    private String remarks;
94
+    /**
95
+     * 物资树
96
+     */
97
+    @TableField("material_tree")
98
+    private String materialTree;
99
+
100
+    private String yesQuantity;
101
+
102
+
103
+    private String noQuantity;
104
+
105
+}

+ 118 - 0
src/main/java/com/unis/vis/model/OutboundMaterialInfo.java

@@ -0,0 +1,118 @@
1
+package com.unis.vis.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableField;
4
+import com.baomidou.mybatisplus.annotation.TableName;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+import java.util.Date;
10
+
11
+
12
+@Data
13
+@EqualsAndHashCode(callSuper = false)
14
+@TableName("outbound_material_info")
15
+public class OutboundMaterialInfo implements Serializable {
16
+    /**
17
+     * 出库物资id
18
+     */
19
+    @TableField("material_id")
20
+    private Integer materialId;
21
+    /**
22
+     * 出库信息表id
23
+     */
24
+    @TableField("outbound_id")
25
+    private Integer outboundId;
26
+    /**
27
+     * 出库类型
28
+     */
29
+    @TableField("outbound_type")
30
+    private String outboundType;
31
+
32
+    /**
33
+     * 物资大类
34
+     */
35
+    @TableField("material_group")
36
+    private String materialGroup;
37
+    /**
38
+     * 物资类别
39
+     */
40
+    @TableField("material_type")
41
+    private String materialType;
42
+
43
+    /**
44
+     * 物资名称
45
+     */
46
+    @TableField("material_name")
47
+    private String materialName;
48
+
49
+    /**
50
+     * 单位
51
+     */
52
+    @TableField("unit")
53
+    private String unit;
54
+
55
+    /**
56
+     * 数量
57
+     */
58
+    @TableField("quantity")
59
+    private String quantity;
60
+
61
+    /**
62
+     * 调用省份
63
+     */
64
+    @TableField("province")
65
+    private Long province;
66
+
67
+    /**
68
+     * 规格
69
+     */
70
+    @TableField("specs")
71
+    private Long specs;
72
+
73
+    /**
74
+     * 出库日期
75
+     */
76
+    @TableField("outbound_time")
77
+    private Date outboundTime;
78
+
79
+    /**
80
+     * 单价
81
+     */
82
+    @TableField("unit_price")
83
+    private Date unitPrice;
84
+
85
+    /**
86
+     * 总价
87
+     */
88
+    @TableField("total_price")
89
+    private String totalPrice;
90
+
91
+    /**
92
+     * 是否可用
93
+     */
94
+    @TableField("is_available")
95
+    private String isAvailable;
96
+    /**
97
+     * 文件上传
98
+     */
99
+    @TableField("file_part")
100
+    private String filePart;
101
+    /**
102
+     * 备注
103
+     */
104
+    @TableField("remarks")
105
+    private String remarks;
106
+    /**
107
+     * 物资树
108
+     */
109
+    @TableField("material_tree")
110
+    private String materialTree;
111
+    /**
112
+     * 文件名称
113
+     */
114
+    @TableField("file_name")
115
+    private String fileName;
116
+
117
+
118
+}

+ 89 - 0
src/main/java/com/unis/vis/model/SysDept.java

@@ -0,0 +1,89 @@
1
+package com.unis.vis.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableField;
4
+import com.baomidou.mybatisplus.annotation.TableName;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+import java.util.Date;
10
+
11
+
12
+@Data
13
+@EqualsAndHashCode(callSuper = false)
14
+@TableName("sys_dept")
15
+public class SysDept implements Serializable {
16
+    private static final long serialVersionUID = -2326388609099501649L;
17
+    /**
18
+     * 数据创建人
19
+     */
20
+    @TableField("DEPT_ID")
21
+    private Long deptId;
22
+
23
+    @TableField("NAME")
24
+    private String name;
25
+
26
+    /**
27
+     * 排序
28
+     */
29
+    @TableField("SORT_ORDER")
30
+    private Integer sortOrder;
31
+    /**
32
+     * 创建人
33
+     */
34
+    @TableField("CREATE_BY")
35
+    private String createBy;
36
+
37
+    /**
38
+     * 修改人
39
+     */
40
+    @TableField("UPDATE_BY")
41
+    private String updateBy;
42
+
43
+    /**
44
+     * 创建时间
45
+     */
46
+    @TableField("CREATE_TIME")
47
+    private Date createTime;
48
+
49
+    /**
50
+     * 修改时间
51
+     */
52
+    @TableField("UPDATE_TIME")
53
+    private Date updateTime;
54
+
55
+
56
+    @TableField("DEL_FLAG")
57
+    private String delFLAG;
58
+
59
+
60
+    @TableField("TENANT_ID")
61
+    private Long tenantId;
62
+
63
+    @TableField("PARENT_ID")
64
+    private Long parentID;
65
+    /**
66
+     * 字段 dept_type 类型  1级国家局  2级 垂管局  3级仓库
67
+     */
68
+    @TableField("DEPT_TYPE")
69
+    private String deptTYPE;
70
+
71
+    /**
72
+     * 经度
73
+     */
74
+    @TableField("LONGITUDE")
75
+    private String longitude;
76
+    /**
77
+     * 维度
78
+     */
79
+    @TableField("DIMENSION")
80
+    private String dimension;
81
+    /**
82
+     * 仓库类型  参考字典项  warehouse_type
83
+     */
84
+    @TableField("WAREHOUSE_TYPE")
85
+    private String warehouseType;
86
+
87
+    private String[] jwd;
88
+
89
+}

+ 16 - 0
src/main/java/com/unis/vis/service/InboundMaterialInfoService.java

@@ -0,0 +1,16 @@
1
+package com.unis.vis.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.unis.vis.model.InboundMaterialInfo;
5
+
6
+import java.util.List;
7
+
8
+
9
+public interface InboundMaterialInfoService extends IService<InboundMaterialInfo> {
10
+
11
+    List<InboundMaterialInfo> getEmergencySuppliesCategory();
12
+
13
+    List<InboundMaterialInfo> getMaterialSituation();
14
+
15
+
16
+}

+ 14 - 0
src/main/java/com/unis/vis/service/OutboundMaterialInfoService.java

@@ -0,0 +1,14 @@
1
+package com.unis.vis.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.unis.vis.model.OutboundMaterialInfo;
5
+
6
+import java.util.List;
7
+
8
+
9
+public interface OutboundMaterialInfoService extends IService<OutboundMaterialInfo> {
10
+
11
+
12
+    List<OutboundMaterialInfo>  getMaterialCallSituation();
13
+
14
+}

+ 15 - 0
src/main/java/com/unis/vis/service/SysDeptService.java

@@ -0,0 +1,15 @@
1
+package com.unis.vis.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.unis.vis.model.SysDept;
5
+
6
+import java.util.List;
7
+
8
+
9
+public interface SysDeptService extends IService<SysDept> {
10
+
11
+
12
+    List<SysDept>  getMapPoint();
13
+
14
+
15
+}

+ 1 - 5
src/main/java/com/unis/vis/service/SysTreeDictService.java

@@ -3,10 +3,6 @@ package com.unis.vis.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.unis.vis.model.SysTreeDict;
5 5
 
6
-/**
7
- * @author qingsong.han
8
- * @description:
9
- * @create 2024-03-02 12:31
10
- */
6
+
11 7
 public interface SysTreeDictService extends IService<SysTreeDict> {
12 8
 }

+ 32 - 0
src/main/java/com/unis/vis/service/impl/InboundMaterialInfoServiceImpl.java

@@ -0,0 +1,32 @@
1
+package com.unis.vis.service.impl;
2
+
3
+
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.unis.vis.mapper.InboundMaterialInfoMapper;
6
+import com.unis.vis.model.InboundMaterialInfo;
7
+import com.unis.vis.service.InboundMaterialInfoService;
8
+import org.springframework.stereotype.Service;
9
+
10
+import javax.annotation.Resource;
11
+import java.util.List;
12
+
13
+@Service
14
+public class InboundMaterialInfoServiceImpl extends ServiceImpl<InboundMaterialInfoMapper, InboundMaterialInfo> implements InboundMaterialInfoService {
15
+    @Resource
16
+    private InboundMaterialInfoMapper inboundMaterialInfoMapper;
17
+
18
+    @Override
19
+    public List<InboundMaterialInfo> getEmergencySuppliesCategory() {
20
+
21
+        return inboundMaterialInfoMapper.getEmergencySuppliesCategory();
22
+    }
23
+
24
+    @Override
25
+    public List<InboundMaterialInfo> getMaterialSituation() {
26
+
27
+        return inboundMaterialInfoMapper.getMaterialSituation();
28
+    }
29
+
30
+
31
+
32
+}

+ 26 - 0
src/main/java/com/unis/vis/service/impl/OutboundMaterialInfoServiceImpl.java

@@ -0,0 +1,26 @@
1
+package com.unis.vis.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.unis.vis.mapper.OutboundMaterialInfoMapper;
5
+import com.unis.vis.model.OutboundMaterialInfo;
6
+import com.unis.vis.service.OutboundMaterialInfoService;
7
+import org.springframework.stereotype.Service;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.List;
11
+
12
+
13
+
14
+@Service
15
+public class OutboundMaterialInfoServiceImpl extends ServiceImpl<OutboundMaterialInfoMapper, OutboundMaterialInfo> implements OutboundMaterialInfoService {
16
+    @Resource
17
+    private OutboundMaterialInfoMapper outboundMaterialInfoMapper;
18
+
19
+    @Override
20
+    public List<OutboundMaterialInfo> getMaterialCallSituation() {
21
+
22
+        return outboundMaterialInfoMapper.getMaterialCallSituation();
23
+    }
24
+
25
+
26
+}

+ 32 - 0
src/main/java/com/unis/vis/service/impl/SysDeptServiceImpl.java

@@ -0,0 +1,32 @@
1
+package com.unis.vis.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.unis.vis.mapper.SysDeptMapper;
5
+import com.unis.vis.model.SysDept;
6
+import com.unis.vis.service.SysDeptService;
7
+import org.springframework.stereotype.Service;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.List;
11
+
12
+
13
+@Service
14
+public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService {
15
+    @Resource
16
+    private  SysDeptMapper  sysDeptMapper;
17
+
18
+    @Override
19
+    public List<SysDept> getMapPoint() {
20
+        List<SysDept> list =sysDeptMapper.getMapPoint();
21
+       // String [] a;
22
+        for (SysDept s:list) {
23
+            String attribute1 = s.getLongitude();
24
+            String attribute2 =  s.getDimension();
25
+            String[] array ={attribute1,attribute2};
26
+            s.setJwd(array);
27
+        }
28
+        return list;
29
+    }
30
+
31
+
32
+}

+ 27 - 0
src/main/resources/mapper/vis/InboundMaterialInfoMapper.xml

@@ -0,0 +1,27 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.unis.vis.mapper.InboundMaterialInfoMapper">
4
+
5
+
6
+    <!--应急物资大类  -->
7
+    <select id="getEmergencySuppliesCategory" resultType="com.unis.vis.model.InboundMaterialInfo">
8
+        select dic.NAME_ as material_type,SUM(iif.quantity)as quantity,SUM(iif.total_price)as total_price
9
+        from inbound_material_info iif
10
+                 left JOIN SYS_TREE_DICT dic on iif.material_type=DIC.ID
11
+                 left join inbound_info b ON iif."inbound_id"=B."inbound_id"
12
+        where b."status"=5
13
+        GROUP BY dic.NAME_
14
+    </select>
15
+    <!-- 物资情况 -->
16
+    <select id="getMaterialSituation" resultType="com.unis.vis.model.InboundMaterialInfo">
17
+        SELECT dic.NAME_ as material_type,
18
+               SUM(CASE WHEN iif.is_available = 0 THEN iif.quantity ELSE 0 END) AS yes_quantity,
19
+               SUM(CASE WHEN iif.is_available = 1 THEN iif.quantity ELSE 0 END) AS no_quantity
20
+        from inbound_material_info iif
21
+                 left JOIN SYS_TREE_DICT dic on iif.material_type=DIC.ID
22
+                 left join inbound_info b ON iif."inbound_id"=B."inbound_id"
23
+        where b."status"=5
24
+        GROUP BY dic.NAME_
25
+    </select>
26
+
27
+</mapper>

+ 27 - 0
src/main/resources/mapper/vis/OutboundMaterialInfoMapper.xml

@@ -0,0 +1,27 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.unis.vis.mapper.OutboundMaterialInfoMapper">
4
+
5
+
6
+    <!-- -->
7
+ <!--   <select id="getMaterialCallSituation" resultType="com.unis.vis.model.OutboundMaterialInfo">
8
+        select dic.NAME_ as material_type,SUM(iif.quantity)as quantity,SUM(iif.total_price)as total_price
9
+        from inbound_material_info iif
10
+                 left JOIN SYS_TREE_DICT dic on iif.material_type=DIC.ID
11
+                 left join inbound_info b ON iif."inbound_id"=B."inbound_id"
12
+        where b."status"=5
13
+        GROUP BY dic.NAME_
14
+    </select>-->
15
+    <!-- 物资调用情况 -->
16
+    <select id="getMaterialCallSituation" resultType="com.unis.vis.model.OutboundMaterialInfo">
17
+        SELECT dic.NAME_ as material_type,
18
+               SUM(CASE WHEN iif.is_available = 0 THEN iif.quantity ELSE 0 END) AS yes_quantity,
19
+               SUM(CASE WHEN iif.is_available = 1 THEN iif.quantity ELSE 0 END) AS no_quantity
20
+        from inbound_material_info iif
21
+                 left JOIN SYS_TREE_DICT dic on iif.material_type=DIC.ID
22
+                 left join inbound_info b ON iif."inbound_id"=B."inbound_id"
23
+        where b."status"=5
24
+        GROUP BY dic.NAME_
25
+    </select>
26
+
27
+</mapper>

+ 13 - 0
src/main/resources/mapper/vis/SysDeptMapper.xml

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.unis.vis.mapper.SysDeptMapper">
4
+
5
+    <!-- 地图点位 -->
6
+    <select id="getMapPoint" resultType="com.unis.vis.model.SysDept">
7
+        select DEPT_ID,      -- 仓库ID
8
+               NAME,        -- 仓库名称
9
+               LONGITUDE,   -- 经度
10
+               DIMENSION    --维度
11
+        from SYS_DEPT where DEPT_TYPE = 3
12
+    </select>
13
+</mapper>