zjs преди 2 седмици
родител
ревизия
90612be5a9

+ 44 - 1
src/main/java/com/cn/esermis/controller/DataAcquisitionInstrumentController.java

@@ -51,10 +51,22 @@ public class DataAcquisitionInstrumentController {
51 51
             volits.setSize(pageList.getSize());
52 52
             List<DataAcquisitionInstrument> records = pageList.getRecords();
53 53
             List<DataAcquisitionInstrumentVo> revoList = new ArrayList<>();
54
+            // 查询企业
55
+            Map<String,Object> componyMap =  dataAcquisitionInstrumentService.getComponyMap();
56
+            // 查询工厂
57
+            Map<String, Object> departmentMap = dataAcquisitionInstrumentService.getDepartmentMap();
54 58
             records.forEach(x->{
55 59
                 DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
56 60
                 List<AnalyticalInstruments> analyticalInstruments = analyticalInstrumentsService.getByDataAcquisitionInstrumentid(x.getId());
57 61
                 BeanUtils.copyProperties(x, instrumentVo);
62
+                if (instrumentVo.getCompanyCode()!=null  && componyMap.get(instrumentVo.getCompanyCode())!=null){
63
+                    Map componyMapobj = (Map)componyMap.get(instrumentVo.getCompanyCode());
64
+                    instrumentVo.setCompanyName(componyMapobj.get("companylongname").toString());
65
+                }
66
+                if (instrumentVo.getDepartmentCode()!=null && departmentMap.get(instrumentVo.getDepartmentCode())!=null){
67
+                    Map componyMapobj = (Map)departmentMap.get(instrumentVo.getDepartmentCode());
68
+                    instrumentVo.setDepartmentName(componyMapobj.get("departmentname").toString());
69
+                };
58 70
                 if (!analyticalInstruments.isEmpty()){
59 71
                     List<AnalyticalInstrumentsVo> analyticalInstrumentList = new ArrayList<>();
60 72
                     analyticalInstruments.forEach(y->{
@@ -81,7 +93,7 @@ public class DataAcquisitionInstrumentController {
81 93
      * 根据菜单编号获取详细信息
82 94
      */
83 95
     @GetMapping(value = "delete/{id}")
84
-    public AjaxResult getInfo(@PathVariable String id)
96
+    public AjaxResult delete(@PathVariable String id)
85 97
     {
86 98
         DataAcquisitionInstrument dataAcquisitionInstrument = dataAcquisitionInstrumentService.getById(id);
87 99
         DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
@@ -100,6 +112,37 @@ public class DataAcquisitionInstrumentController {
100 112
             }
101 113
         }
102 114
         dataAcquisitionInstrumentService.remove(new QueryWrapper<DataAcquisitionInstrument>().eq("id", id));
115
+        return success();
116
+    }
117
+
118
+    /**
119
+     * 根据菜单编号获取详细信息
120
+     */
121
+    @GetMapping(value = "/{id}")
122
+    public AjaxResult getInfo(@PathVariable String id)
123
+    {
124
+        DataAcquisitionInstrument dataAcquisitionInstrument = dataAcquisitionInstrumentService.getById(id);
125
+        DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
126
+        if (dataAcquisitionInstrument != null){
127
+            BeanUtils.copyProperties(dataAcquisitionInstrument, instrumentVo);
128
+            List<AnalyticalInstruments> analyticalInstruments = analyticalInstrumentsService.getByDataAcquisitionInstrumentid(dataAcquisitionInstrument.getId());
129
+            if (!analyticalInstruments.isEmpty()){
130
+                List<AnalyticalInstrumentsVo> analyticalInstrumentList = new ArrayList<>();
131
+                analyticalInstruments.forEach(x->{
132
+                        AnalyticalInstrumentsVo analyticalInstrumentsVo = new AnalyticalInstrumentsVo();
133
+                        BeanUtils.copyProperties(x, analyticalInstrumentsVo);
134
+
135
+                        List<DetectMonitoringFactor> analyticalInstrumentId = detectMonitoringFactorService.listByParentId(x.getId());
136
+                        if (!analyticalInstrumentId.isEmpty()){
137
+                            analyticalInstrumentId.forEach(z->{
138
+                                analyticalInstrumentsVo.getDetectMonitoringFactors().add(z);
139
+                            });
140
+                        }
141
+                        analyticalInstrumentList.add(analyticalInstrumentsVo);
142
+                    });
143
+                instrumentVo.setAnalyticalInstruments(analyticalInstrumentList);
144
+            }
145
+        }
103 146
         return success(instrumentVo);
104 147
     }
105 148
 

+ 1 - 1
src/main/java/com/cn/esermis/dpld/entity/AnalyticalInstruments.java

@@ -89,6 +89,6 @@ public class AnalyticalInstruments {
89 89
      * 分析仪类型(1气体分析仪,2污水分析仪)
90 90
      */
91 91
     @TableField(value = "type")
92
-    private String type;
92
+    private Integer type;
93 93
 
94 94
 }

+ 4 - 4
src/main/java/com/cn/esermis/dpld/entity/DataAcquisitionInstrument.java

@@ -37,7 +37,7 @@ public class DataAcquisitionInstrument {
37 37
      * 排污口类型(1 废气,2废水)
38 38
      */
39 39
     @TableField(value = "type")
40
-    private String type;
40
+    private Integer type;
41 41
     /**
42 42
      *建设投用日期
43 43
      */
@@ -47,7 +47,7 @@ public class DataAcquisitionInstrument {
47 47
      * 是否完成验收备案(0否 1是)
48 48
      */
49 49
     @TableField(value = "complete_filings")
50
-    private String completeFilings;
50
+    private Integer completeFilings;
51 51
 
52 52
     /**
53 53
      * 验收备案时间
@@ -95,12 +95,12 @@ public class DataAcquisitionInstrument {
95 95
      * 是否有排气筒 1是 0否
96 96
      */
97 97
     @TableField(value = "have_exhaust")
98
-    private String haveExhaust;
98
+    private Integer haveExhaust;
99 99
     /**
100 100
      * 排气筒温度
101 101
      */
102 102
     @TableField(value = "exhaust_temperature")
103
-    private String exhaustTemperature;
103
+    private BigDecimal exhaustTemperature;
104 104
     /**
105 105
      * 排气筒高度
106 106
      */

+ 2 - 2
src/main/java/com/cn/esermis/dpld/entity/DetectMonitorFactor.java

@@ -47,7 +47,7 @@ public class DetectMonitorFactor {
47 47
      * 缺省数据类型(浓度)
48 48
      */
49 49
     @TableField(value = "type")
50
-    private String type;
50
+    private Integer type;
51 51
     /**
52 52
      * 简称
53 53
      */
@@ -57,7 +57,7 @@ public class DetectMonitorFactor {
57 57
      * 监测因子类型 1 废气 2 废水
58 58
      */
59 59
     @TableField(value = "factorType")
60
-    private String factorType;
60
+    private Integer factorType;
61 61
 
62 62
 
63 63
 }

+ 7 - 0
src/main/java/com/cn/esermis/dpld/mapper/DataAcquisitionInstrumentMapper.java

@@ -3,6 +3,7 @@ package com.cn.esermis.dpld.mapper;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.cn.esermis.dpld.entity.DataAcquisitionInstrument;
5 5
 import com.cn.esermis.dpld.model.OutletAndFactorVo;
6
+import org.apache.ibatis.annotations.MapKey;
6 7
 import org.apache.ibatis.annotations.Mapper;
7 8
 
8 9
 import java.util.List;
@@ -16,4 +17,10 @@ public interface DataAcquisitionInstrumentMapper extends BaseMapper<DataAcquisit
16 17
     List<Map<String,Object>> getCompony();
17 18
 
18 19
     List<Map<String, Object>> getDepartment(String componyid);
20
+
21
+    @MapKey("companyid")
22
+    Map<String, Object> getComponyMap();
23
+
24
+    @MapKey("departmentid")
25
+    Map<String, Object> getDepartmentMap();
19 26
 }

+ 2 - 0
src/main/java/com/cn/esermis/dpld/model/DataAcquisitionInstrumentVo.java

@@ -16,5 +16,7 @@ public class DataAcquisitionInstrumentVo extends DataAcquisitionInstrument {
16 16
    private Integer pageNum;
17 17
 
18 18
    private Integer pageSize;
19
+   private String companyName;
20
+   private String departmentName;
19 21
 
20 22
 }

+ 4 - 0
src/main/java/com/cn/esermis/dpld/service/IDataAcquisitionInstrumentService.java

@@ -17,4 +17,8 @@ public interface IDataAcquisitionInstrumentService extends IService<DataAcquisit
17 17
     List<Map<String,Object>> getCompony();
18 18
 
19 19
     List<Map<String, Object>> getDepartment(String componyid);
20
+
21
+    Map<String, Object> getComponyMap();
22
+
23
+    Map<String, Object> getDepartmentMap();
20 24
 }

+ 10 - 0
src/main/java/com/cn/esermis/dpld/service/impl/DataAcquisitionInstrumentServiceImpl.java

@@ -33,4 +33,14 @@ public class DataAcquisitionInstrumentServiceImpl extends ServiceImpl<DataAcquis
33 33
     public List<Map<String, Object>> getDepartment(String componyid) {
34 34
         return mapper.getDepartment(componyid);
35 35
     }
36
+
37
+    @Override
38
+    public Map<String, Object> getComponyMap() {
39
+        return mapper.getComponyMap();
40
+    }
41
+
42
+    @Override
43
+    public Map<String, Object> getDepartmentMap() {
44
+        return mapper.getDepartmentMap();
45
+    }
36 46
 }

+ 8 - 0
src/main/resources/static/mybatis/DataAcquisitionInstrumentMapper.xml

@@ -19,5 +19,13 @@
19 19
         FROM department t
20 20
         WHERE t.companyid = #{companyid}
21 21
     </select>
22
+    <select id="getComponyMap" resultType="java.util.Map">
23
+        SELECT t.companyid,t.companylongname
24
+        FROM company t
25
+    </select>
26
+    <select id="getDepartmentMap" resultType="java.util.Map">
27
+        SELECT t.departmentid,t.departmentname
28
+        FROM department t
29
+    </select>
22 30
 </mapper>
23 31