zjs hace 3 semanas
padre
commit
6e05e7a098

+ 1 - 0
src/main/java/com/cn/esermis/constant/Constant.java

@@ -8,6 +8,7 @@ public class Constant {
8
         public static final  String HOUR = "2061"; //小时值
8
         public static final  String HOUR = "2061"; //小时值
9
         public static final String MINUTE = "2051"; //分钟值
9
         public static final String MINUTE = "2051"; //分钟值
10
         public static final String REAL = "2011"; //实时值
10
         public static final String REAL = "2011"; //实时值
11
+        public static final String DAY = "2031"; //日数据
11
 
12
 
12
         public static final  String CN = "CN"; //大气环境污染源
13
         public static final  String CN = "CN"; //大气环境污染源
13
         public static final  String SERVER = "server"; //大气环境污染源
14
         public static final  String SERVER = "server"; //大气环境污染源

+ 20 - 22
src/main/java/com/cn/esermis/controller/DataAcquisitionInstrumentController.java

@@ -52,7 +52,7 @@ public class DataAcquisitionInstrumentController {
52
             List<DataAcquisitionInstrumentVo> revoList = new ArrayList<>();
52
             List<DataAcquisitionInstrumentVo> revoList = new ArrayList<>();
53
             records.forEach(x->{
53
             records.forEach(x->{
54
                 DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
54
                 DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
55
-                List<AnalyticalInstruments> analyticalInstruments = analyticalInstrumentsService.list(new QueryWrapper<AnalyticalInstruments>().eq("data_acquisition_instrument_id", x.getId()));
55
+                List<AnalyticalInstruments> analyticalInstruments = analyticalInstrumentsService.getByDataAcquisitionInstrumentid(x.getId());
56
                 BeanUtils.copyProperties(x, instrumentVo);
56
                 BeanUtils.copyProperties(x, instrumentVo);
57
                 if (!analyticalInstruments.isEmpty()){
57
                 if (!analyticalInstruments.isEmpty()){
58
                     List<AnalyticalInstrumentsVo> analyticalInstrumentList = new ArrayList<>();
58
                     List<AnalyticalInstrumentsVo> analyticalInstrumentList = new ArrayList<>();
@@ -60,7 +60,7 @@ public class DataAcquisitionInstrumentController {
60
                         AnalyticalInstrumentsVo analyticalInstrumentsVo = new AnalyticalInstrumentsVo();
60
                         AnalyticalInstrumentsVo analyticalInstrumentsVo = new AnalyticalInstrumentsVo();
61
                         BeanUtils.copyProperties(y, analyticalInstrumentsVo);
61
                         BeanUtils.copyProperties(y, analyticalInstrumentsVo);
62
                         analyticalInstrumentList.add(analyticalInstrumentsVo);
62
                         analyticalInstrumentList.add(analyticalInstrumentsVo);
63
-                        List<DetectMonitoringFactor> analyticalInstrumentId = detectMonitoringFactorService.list(new QueryWrapper<DetectMonitoringFactor>().eq("analytical_instrument_id", y.getId()));
63
+                        List<DetectMonitoringFactor> analyticalInstrumentId = detectMonitoringFactorService.listByParentId(y.getId());
64
                         if (!analyticalInstrumentId.isEmpty()){
64
                         if (!analyticalInstrumentId.isEmpty()){
65
                             analyticalInstrumentId.forEach(z->{
65
                             analyticalInstrumentId.forEach(z->{
66
                                 analyticalInstrumentsVo.getDetectMonitoringFactors().add(z);
66
                                 analyticalInstrumentsVo.getDetectMonitoringFactors().add(z);
@@ -79,30 +79,26 @@ public class DataAcquisitionInstrumentController {
79
     /**
79
     /**
80
      * 根据菜单编号获取详细信息
80
      * 根据菜单编号获取详细信息
81
      */
81
      */
82
-    @GetMapping(value = "/{id}")
82
+    @GetMapping(value = "delete/{id}")
83
     public AjaxResult getInfo(@PathVariable String id)
83
     public AjaxResult getInfo(@PathVariable String id)
84
     {
84
     {
85
         DataAcquisitionInstrument dataAcquisitionInstrument = dataAcquisitionInstrumentService.getById(id);
85
         DataAcquisitionInstrument dataAcquisitionInstrument = dataAcquisitionInstrumentService.getById(id);
86
         DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
86
         DataAcquisitionInstrumentVo instrumentVo = new DataAcquisitionInstrumentVo();
87
         if (dataAcquisitionInstrument != null){
87
         if (dataAcquisitionInstrument != null){
88
             BeanUtils.copyProperties(dataAcquisitionInstrument, instrumentVo);
88
             BeanUtils.copyProperties(dataAcquisitionInstrument, instrumentVo);
89
-            List<AnalyticalInstruments> analyticalInstruments = analyticalInstrumentsService.list(new QueryWrapper<AnalyticalInstruments>().eq("data_acquisition_instrument_id", instrumentVo.getId()));
89
+            List<AnalyticalInstruments> analyticalInstruments = analyticalInstrumentsService.getByDataAcquisitionInstrumentid(dataAcquisitionInstrument.getId());
90
             if (!analyticalInstruments.isEmpty()){
90
             if (!analyticalInstruments.isEmpty()){
91
                 List<AnalyticalInstrumentsVo> analyticalInstrumentList = new ArrayList<>();
91
                 List<AnalyticalInstrumentsVo> analyticalInstrumentList = new ArrayList<>();
92
                 analyticalInstruments.forEach(y->{
92
                 analyticalInstruments.forEach(y->{
93
-                    AnalyticalInstrumentsVo analyticalInstrumentsVo = new AnalyticalInstrumentsVo();
94
-                    BeanUtils.copyProperties(y, analyticalInstrumentsVo);
95
-                    analyticalInstrumentList.add(analyticalInstrumentsVo);
96
-                    List<DetectMonitoringFactor> analyticalInstrumentId = detectMonitoringFactorService.list(new QueryWrapper<DetectMonitoringFactor>().eq("analytical_instrument_id", y.getId()));
97
-                    if (!analyticalInstrumentId.isEmpty()){
98
-                        analyticalInstrumentId.forEach(z->{
99
-                            analyticalInstrumentsVo.getDetectMonitoringFactors().add(z);
100
-                        });
101
-                    }
93
+                    if (y.getId() != null)
94
+                    detectMonitoringFactorService.remove(new QueryWrapper<DetectMonitoringFactor>().eq("analytical_instrument_id", y.getId()));
102
                 });
95
                 });
96
+                if (analyticalInstruments.isEmpty())
97
+                analyticalInstrumentsService.remove(new QueryWrapper<AnalyticalInstruments>().eq("data_acquisition_instrument_id", dataAcquisitionInstrument.getId()));
103
                 instrumentVo.setAnalyticalInstruments(analyticalInstrumentList);
98
                 instrumentVo.setAnalyticalInstruments(analyticalInstrumentList);
104
             }
99
             }
105
         }
100
         }
101
+        dataAcquisitionInstrumentService.remove(new QueryWrapper<DataAcquisitionInstrument>().eq("id", id));
106
         return success(instrumentVo);
102
         return success(instrumentVo);
107
     }
103
     }
108
 
104
 
@@ -117,28 +113,30 @@ public class DataAcquisitionInstrumentController {
117
         DataAcquisitionInstrument dataAcquisitionInstrument = new DataAcquisitionInstrument();
113
         DataAcquisitionInstrument dataAcquisitionInstrument = new DataAcquisitionInstrument();
118
         BeanUtils.copyProperties(vo, dataAcquisitionInstrument);
114
         BeanUtils.copyProperties(vo, dataAcquisitionInstrument);
119
         boolean save = dataAcquisitionInstrumentService.saveOrUpdate(dataAcquisitionInstrument);
115
         boolean save = dataAcquisitionInstrumentService.saveOrUpdate(dataAcquisitionInstrument);
120
-        if (save){
116
+        if (save && vo.getAnalyticalInstruments()!=null){
121
             List<AnalyticalInstrumentsVo> analyticalInstrumentList = vo.getAnalyticalInstruments();
117
             List<AnalyticalInstrumentsVo> analyticalInstrumentList = vo.getAnalyticalInstruments();
122
             // 删除子项 全删全增操作
118
             // 删除子项 全删全增操作
123
             {
119
             {
124
-                List<AnalyticalInstruments> dataAcquisitionInstrumentId = analyticalInstrumentsService.list(new QueryWrapper<AnalyticalInstruments>().eq("data_acquisition_instrument_id", dataAcquisitionInstrument.getId()));
125
-                if (!dataAcquisitionInstrumentId.isEmpty()){
126
-                    analyticalInstrumentList.forEach(y->{
127
-                        detectMonitoringFactorService.remove(new QueryWrapper<DetectMonitoringFactor>().eq("analytical_instrument_id", y.getId()));
128
-                    });
129
-                    analyticalInstrumentsService.remove(new QueryWrapper<AnalyticalInstruments>().eq("data_acquisition_instrument_id", dataAcquisitionInstrument.getId()));
120
+                if (dataAcquisitionInstrument.getId() != null){
121
+                    List<AnalyticalInstruments> dataAcquisitionInstrumentId = analyticalInstrumentsService.getByDataAcquisitionInstrumentid(dataAcquisitionInstrument.getId());
122
+                    if (!dataAcquisitionInstrumentId.isEmpty()){
123
+                        analyticalInstrumentList.forEach(y->{
124
+                            detectMonitoringFactorService.remove(new QueryWrapper<DetectMonitoringFactor>().eq("analytical_instrument_id", y.getId()));
125
+                        });
126
+                        analyticalInstrumentsService.remove(new QueryWrapper<AnalyticalInstruments>().eq("data_acquisition_instrument_id", dataAcquisitionInstrument.getId()));
127
+                    }
130
                 }
128
                 }
131
             }
129
             }
132
             // 新增子表
130
             // 新增子表
133
             analyticalInstrumentList.forEach(x->{
131
             analyticalInstrumentList.forEach(x->{
134
                 AnalyticalInstruments analyticalInstruments = new AnalyticalInstruments();
132
                 AnalyticalInstruments analyticalInstruments = new AnalyticalInstruments();
135
-                analyticalInstruments.setDataAcquisitionInstrumentId(dataAcquisitionInstrument.getId());
136
                 BeanUtils.copyProperties(x, analyticalInstruments);
133
                 BeanUtils.copyProperties(x, analyticalInstruments);
134
+                analyticalInstruments.setDataAcquisitionInstrumentId(dataAcquisitionInstrument.getId());
137
                 boolean save1 = analyticalInstrumentsService.save(analyticalInstruments);
135
                 boolean save1 = analyticalInstrumentsService.save(analyticalInstruments);
138
                 if (save1){
136
                 if (save1){
139
                     List<DetectMonitoringFactor> detectMonitoringFactors = x.getDetectMonitoringFactors();
137
                     List<DetectMonitoringFactor> detectMonitoringFactors = x.getDetectMonitoringFactors();
140
                     detectMonitoringFactors.forEach(y->{
138
                     detectMonitoringFactors.forEach(y->{
141
-                        y.setAnalytical_instrument_id(analyticalInstruments.getId());
139
+                        y.setAnalyticalInstrumentId(analyticalInstruments.getId());
142
                         boolean save2 = detectMonitoringFactorService.save(y);
140
                         boolean save2 = detectMonitoringFactorService.save(y);
143
                         if (!save2){
141
                         if (!save2){
144
                             throw new RuntimeException("添加失败");
142
                             throw new RuntimeException("添加失败");

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

@@ -16,7 +16,7 @@ import static com.cn.esermis.dpld.model.AjaxResult.success;
16
  * 事后标记
16
  * 事后标记
17
  */
17
  */
18
 @RestController
18
 @RestController
19
-@RequestMapping("/post_markingC")
19
+@RequestMapping("/post_marking")
20
 public class PostMarkingController
20
 public class PostMarkingController
21
 {
21
 {
22
     @Resource
22
     @Resource

+ 25 - 12
src/main/java/com/cn/esermis/dpld/business/MonitorBusiness.java

@@ -95,11 +95,13 @@ public class MonitorBusiness {
95
                             airMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
95
                             airMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
96
                                     x.getMin()!=null?x.getMin().doubleValue():0,
96
                                     x.getMin()!=null?x.getMin().doubleValue():0,
97
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
97
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
98
-                            if (!airMonitorMinuteRecord.getIsExceed().equals("Y") || !airMonitorMinuteRecord.getIsLose().equals("Y") || !airMonitorMinuteRecord.getIsSix().equals("Y")){
98
+                            if ((airMonitorMinuteRecord.getIsExceed()!=null && !airMonitorMinuteRecord.getIsExceed().equals("Y") )||
99
+                                    (airMonitorMinuteRecord.getIsLose()!=null && !airMonitorMinuteRecord.getIsLose().equals("Y") )||
100
+                                    (airMonitorMinuteRecord.getIsSix()!=null && !airMonitorMinuteRecord.getIsSix().equals("Y"))){
99
                                 saveExcepLog(x, airMonitorMinuteRecord);
101
                                 saveExcepLog(x, airMonitorMinuteRecord);
100
                             }
102
                             }
101
                         } catch (Exception e) {
103
                         } catch (Exception e) {
102
-                            log.error("调用 ExceptionDataDispose 方法异常{} 当前参数为:{}",e,airMonitorMinuteRecord);
104
+                            log.error("调用 ExceptionDataDispose1 方法异常{} 当前参数为:{}",e,airMonitorMinuteRecord);
103
                         }
105
                         }
104
                         listData.add(airMonitorMinuteRecord);
106
                         listData.add(airMonitorMinuteRecord);
105
                     });
107
                     });
@@ -131,11 +133,13 @@ public class MonitorBusiness {
131
                             airMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
133
                             airMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
132
                                     x.getMin()!=null?x.getMin().doubleValue():0,
134
                                     x.getMin()!=null?x.getMin().doubleValue():0,
133
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
135
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
134
-                            if (!airMonitorMinuteRecord.getIsExceed().equals("Y") || !airMonitorMinuteRecord.getIsLose().equals("Y") || !airMonitorMinuteRecord.getIsSix().equals("Y")){
136
+                            if ((airMonitorMinuteRecord.getIsExceed()!=null && !airMonitorMinuteRecord.getIsExceed().equals("Y") )||
137
+                                    (airMonitorMinuteRecord.getIsLose()!=null && !airMonitorMinuteRecord.getIsLose().equals("Y") )||
138
+                                    (airMonitorMinuteRecord.getIsSix()!=null && !airMonitorMinuteRecord.getIsSix().equals("Y"))){
135
                                 saveExcepLog(x, airMonitorMinuteRecord);
139
                                 saveExcepLog(x, airMonitorMinuteRecord);
136
                             }
140
                             }
137
                         } catch (Exception e) {
141
                         } catch (Exception e) {
138
-                            log.error("调用 ExceptionDataDispose 方法异常{} 当前参数为:{}",e,airMonitorMinuteRecord);
142
+                            log.error("调用 ExceptionDataDispose2 方法异常{} 当前参数为:{}",e,airMonitorMinuteRecord);
139
                         }
143
                         }
140
                         listData.add(airMonitorMinuteRecord);
144
                         listData.add(airMonitorMinuteRecord);
141
                     });
145
                     });
@@ -170,11 +174,14 @@ public class MonitorBusiness {
170
                                     x.getMin()!=null?x.getMin().doubleValue():0,
174
                                     x.getMin()!=null?x.getMin().doubleValue():0,
171
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
175
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
172
                             airMonitorHourRecord.setIsSix(exceptionDataDispose.SixData(factorModel.getMN(), x.getFactor(),x.getAvg()!=null?x.getAvg().doubleValue():0, factorModel.getDataTime()));
176
                             airMonitorHourRecord.setIsSix(exceptionDataDispose.SixData(factorModel.getMN(), x.getFactor(),x.getAvg()!=null?x.getAvg().doubleValue():0, factorModel.getDataTime()));
173
-                            if (!airMonitorHourRecord.getIsExceed().equals("Y") || !airMonitorHourRecord.getIsLose().equals("Y") || !airMonitorHourRecord.getIsSix().equals("Y")){
177
+//                            if (!airMonitorHourRecord.getIsExceed().equals("Y") || !airMonitorHourRecord.getIsLose().equals("Y") || !airMonitorHourRecord.getIsSix().equals("Y")){
178
+                            if ((airMonitorHourRecord.getIsExceed()!=null && !airMonitorHourRecord.getIsExceed().equals("Y") )||
179
+                                    (airMonitorHourRecord.getIsLose()!=null && !airMonitorHourRecord.getIsLose().equals("Y") )||
180
+                                    (airMonitorHourRecord.getIsSix()!=null && !airMonitorHourRecord.getIsSix().equals("Y"))){
174
                                 saveExcepLog(x, airMonitorHourRecord);
181
                                 saveExcepLog(x, airMonitorHourRecord);
175
                             }
182
                             }
176
                         } catch (Exception e) {
183
                         } catch (Exception e) {
177
-                            log.error("调用 ExceptionDataDispose 方法异常{} 当前参数为:{}",e,airMonitorHourRecord);
184
+                            log.error("调用 ExceptionDataDispose3 方法异常{} 当前参数为:{}",e,airMonitorHourRecord);
178
                         }
185
                         }
179
                         listData.add(airMonitorHourRecord);
186
                         listData.add(airMonitorHourRecord);
180
                     });
187
                     });
@@ -206,11 +213,13 @@ public class MonitorBusiness {
206
                             waterMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
213
                             waterMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
207
                                     x.getMin()!=null?x.getMin().doubleValue():0,
214
                                     x.getMin()!=null?x.getMin().doubleValue():0,
208
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
215
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
209
-                            if (!waterMonitorMinuteRecord.getIsExceed().equals("Y") || !waterMonitorMinuteRecord.getIsLose().equals("Y") || !waterMonitorMinuteRecord.getIsSix().equals("Y")){
216
+                            if ((waterMonitorMinuteRecord.getIsExceed()!=null && !waterMonitorMinuteRecord.getIsExceed().equals("Y") )||
217
+                                    (waterMonitorMinuteRecord.getIsLose()!=null && !waterMonitorMinuteRecord.getIsLose().equals("Y") )||
218
+                                    (waterMonitorMinuteRecord.getIsSix()!=null && !waterMonitorMinuteRecord.getIsSix().equals("Y"))){
210
                                 saveExcepLog(x, waterMonitorMinuteRecord);
219
                                 saveExcepLog(x, waterMonitorMinuteRecord);
211
                             }
220
                             }
212
                         } catch (Exception e) {
221
                         } catch (Exception e) {
213
-                            log.error("调用 ExceptionDataDispose 方法异常{} 当前参数为:{}",e,waterMonitorMinuteRecord);
222
+                            log.error("调用 ExceptionDataDispose4 方法异常{} 当前参数为:{}",e,waterMonitorMinuteRecord);
214
                         }
223
                         }
215
                         listData.add(waterMonitorMinuteRecord);
224
                         listData.add(waterMonitorMinuteRecord);
216
                     });
225
                     });
@@ -239,11 +248,13 @@ public class MonitorBusiness {
239
                             waterMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
248
                             waterMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
240
                                     x.getMin()!=null?x.getMin().doubleValue():0,
249
                                     x.getMin()!=null?x.getMin().doubleValue():0,
241
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
250
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
242
-                            if (!waterMonitorMinuteRecord.getIsExceed().equals("Y") || !waterMonitorMinuteRecord.getIsLose().equals("Y") || !waterMonitorMinuteRecord.getIsSix().equals("Y")){
251
+                            if ((waterMonitorMinuteRecord.getIsExceed()!=null && !waterMonitorMinuteRecord.getIsExceed().equals("Y") )||
252
+                                    (waterMonitorMinuteRecord.getIsLose()!=null && !waterMonitorMinuteRecord.getIsLose().equals("Y") )||
253
+                                    (waterMonitorMinuteRecord.getIsSix()!=null && !waterMonitorMinuteRecord.getIsSix().equals("Y"))){
243
                                 saveExcepLog(x, waterMonitorMinuteRecord);
254
                                 saveExcepLog(x, waterMonitorMinuteRecord);
244
                             }
255
                             }
245
                         } catch (Exception e) {
256
                         } catch (Exception e) {
246
-                            log.error("调用 ExceptionDataDispose 方法异常{} 当前参数为:{}",e,waterMonitorMinuteRecord);
257
+                            log.error("调用 ExceptionDataDispose5 方法异常{} 当前参数为:{}",e,waterMonitorMinuteRecord);
247
                         }
258
                         }
248
 
259
 
249
                         listData.add(waterMonitorMinuteRecord);
260
                         listData.add(waterMonitorMinuteRecord);
@@ -277,11 +288,13 @@ public class MonitorBusiness {
277
                                     x.getMin()!=null?x.getMin().doubleValue():0,
288
                                     x.getMin()!=null?x.getMin().doubleValue():0,
278
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
289
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
279
                             waterMonitorHourRecord.setIsSix(exceptionDataDispose.SixData(factorModel.getMN(), x.getFactor(),x.getAvg()!=null?x.getAvg().doubleValue():0, factorModel.getDataTime()));
290
                             waterMonitorHourRecord.setIsSix(exceptionDataDispose.SixData(factorModel.getMN(), x.getFactor(),x.getAvg()!=null?x.getAvg().doubleValue():0, factorModel.getDataTime()));
280
-                            if (!waterMonitorHourRecord.getIsExceed().equals("Y") || !waterMonitorHourRecord.getIsLose().equals("Y") || !waterMonitorHourRecord.getIsSix().equals("Y")){
291
+                            if ((waterMonitorHourRecord.getIsExceed()!=null && !waterMonitorHourRecord.getIsExceed().equals("Y") )||
292
+                                    (waterMonitorHourRecord.getIsLose()!=null && !waterMonitorHourRecord.getIsLose().equals("Y") )||
293
+                                    (waterMonitorHourRecord.getIsSix()!=null && !waterMonitorHourRecord.getIsSix().equals("Y"))){
281
                                 saveExcepLog(x, waterMonitorHourRecord);
294
                                 saveExcepLog(x, waterMonitorHourRecord);
282
                             }
295
                             }
283
                         } catch (Exception e) {
296
                         } catch (Exception e) {
284
-                            log.error("调用 ExceptionDataDispose 方法异常{} 当前参数为:{}",e,waterMonitorHourRecord);
297
+                            log.error("调用 ExceptionDataDispose6 方法异常{} 当前参数为:{}",e,waterMonitorHourRecord);
285
                         }
298
                         }
286
                         listData.add(waterMonitorHourRecord);
299
                         listData.add(waterMonitorHourRecord);
287
                     });
300
                     });

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

@@ -40,12 +40,12 @@ public class AnalyticalInstruments {
40
     /**
40
     /**
41
      *监测污染物因子及限值(小时均值、月排放总量、年排放总量)
41
      *监测污染物因子及限值(小时均值、月排放总量、年排放总量)
42
      */
42
      */
43
-    @TableField(value = "factorInfor")
44
-    private Date factorInfor;
43
+    @TableField(value = "factor_infor")
44
+    private String factorInfor;
45
     /**
45
     /**
46
      * 量程
46
      * 量程
47
      */
47
      */
48
-    @TableField(value = "range")
48
+    @TableField(value = "range_str")
49
     private String range;
49
     private String range;
50
 
50
 
51
     /**
51
     /**
@@ -68,8 +68,8 @@ public class AnalyticalInstruments {
68
     /**
68
     /**
69
      * 皮托管系数
69
      * 皮托管系数
70
      */
70
      */
71
-    @TableField(value = "pitotTubeCoefficient")
72
-    private String pitot_tube_coefficient;
71
+    @TableField(value = "pitot_tube_coefficient")
72
+    private String pitotTubeCoefficient;
73
     /**
73
     /**
74
      * k值
74
      * k值
75
      */
75
      */

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

@@ -42,7 +42,7 @@ public class DataAcquisitionInstrument {
42
      *建设投用日期
42
      *建设投用日期
43
      */
43
      */
44
     @TableField(value = "use_data")
44
     @TableField(value = "use_data")
45
-    private Date use_data;
45
+    private Date useData;
46
     /**
46
     /**
47
      * 是否完成验收备案(0否 1是)
47
      * 是否完成验收备案(0否 1是)
48
      */
48
      */
@@ -58,6 +58,11 @@ public class DataAcquisitionInstrument {
58
     /**
58
     /**
59
      * 数采仪品牌
59
      * 数采仪品牌
60
      */
60
      */
61
+    @TableField(value = "collection_name")
62
+    private String collectionName;
63
+    /**
64
+     * 数采仪品牌
65
+     */
61
     @TableField(value = "collection_brand")
66
     @TableField(value = "collection_brand")
62
     private String collectionBrand;
67
     private String collectionBrand;
63
     /**
68
     /**

+ 3 - 3
src/main/java/com/cn/esermis/dpld/entity/DetectMonitoringFactor.java

@@ -12,7 +12,7 @@ import java.util.Date;
12
  * 监测因子表
12
  * 监测因子表
13
  */
13
  */
14
 @Data
14
 @Data
15
-@TableName("analytical_instruments")
15
+@TableName("monitoring_factor")
16
 public class DetectMonitoringFactor {
16
 public class DetectMonitoringFactor {
17
 
17
 
18
     private static final long serialVersionUID = 8887499842971074427L;
18
     private static final long serialVersionUID = 8887499842971074427L;
@@ -26,7 +26,7 @@ public class DetectMonitoringFactor {
26
      * 分析仪主键ID
26
      * 分析仪主键ID
27
      */
27
      */
28
     @TableField(value = "analytical_instrument_id")
28
     @TableField(value = "analytical_instrument_id")
29
-    private String analytical_instrument_id;
29
+    private String analyticalInstrumentId;
30
     /**
30
     /**
31
      * 检测因子编码
31
      * 检测因子编码
32
      */
32
      */
@@ -68,7 +68,7 @@ public class DetectMonitoringFactor {
68
     /**
68
     /**
69
      * 量程
69
      * 量程
70
      */
70
      */
71
-    @TableField(value = "range")
71
+    @TableField(value = "range_str")
72
     private String range;
72
     private String range;
73
     /**
73
     /**
74
      * 量程单位
74
      * 量程单位

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

@@ -58,7 +58,7 @@ public class PostMarking {
58
      * 管理员核实状态  1属实、2不属实
58
      * 管理员核实状态  1属实、2不属实
59
      */
59
      */
60
     @TableField(value = "verifies_status")
60
     @TableField(value = "verifies_status")
61
-    private String verifiesStatus;
61
+    private Integer verifiesStatus;
62
     /**
62
     /**
63
      * 管理员分类  1停炉、2故障
63
      * 管理员分类  1停炉、2故障
64
      */
64
      */

+ 6 - 0
src/main/java/com/cn/esermis/dpld/mapper/AnalyticalInstrumentsMapper.java

@@ -3,9 +3,15 @@ package com.cn.esermis.dpld.mapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.cn.esermis.dpld.entity.AnalyticalInstruments;
4
 import com.cn.esermis.dpld.entity.AnalyticalInstruments;
5
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.Select;
8
+
9
+import java.util.List;
6
 
10
 
7
 @Mapper
11
 @Mapper
8
 public interface AnalyticalInstrumentsMapper extends BaseMapper<AnalyticalInstruments> {
12
 public interface AnalyticalInstrumentsMapper extends BaseMapper<AnalyticalInstruments> {
9
 
13
 
14
+    List<AnalyticalInstruments> getByDataAcquisitionInstrumentid(@Param("productId") String productId);
10
 
15
 
16
+    boolean saveOb(AnalyticalInstruments analyticalInstruments);
11
 }
17
 }

+ 4 - 0
src/main/java/com/cn/esermis/dpld/mapper/DetectMonitoringFactorMapper.java

@@ -3,9 +3,13 @@ package com.cn.esermis.dpld.mapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.cn.esermis.dpld.entity.DetectMonitoringFactor;
4
 import com.cn.esermis.dpld.entity.DetectMonitoringFactor;
5
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
6
 
9
 
7
 @Mapper
10
 @Mapper
8
 public interface DetectMonitoringFactorMapper extends BaseMapper<DetectMonitoringFactor> {
11
 public interface DetectMonitoringFactorMapper extends BaseMapper<DetectMonitoringFactor> {
9
 
12
 
10
 
13
 
14
+    List<DetectMonitoringFactor> listByParentId(@Param("parentId") String parentId);
11
 }
15
 }

+ 5 - 0
src/main/java/com/cn/esermis/dpld/service/IAnalyticalInstrumentsService.java

@@ -4,6 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.cn.esermis.dpld.entity.AnalyticalInstruments;
4
 import com.cn.esermis.dpld.entity.AnalyticalInstruments;
5
 import org.springframework.stereotype.Service;
5
 import org.springframework.stereotype.Service;
6
 
6
 
7
+import java.util.List;
8
+
7
 @Service
9
 @Service
8
 public interface IAnalyticalInstrumentsService extends IService<AnalyticalInstruments> {
10
 public interface IAnalyticalInstrumentsService extends IService<AnalyticalInstruments> {
11
+    List<AnalyticalInstruments> getByDataAcquisitionInstrumentid(String id);
12
+
13
+    boolean saveOb(AnalyticalInstruments analyticalInstruments);
9
 }
14
 }

+ 3 - 0
src/main/java/com/cn/esermis/dpld/service/IDetectMonitoringFactorService.java

@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.cn.esermis.dpld.entity.DetectMonitoringFactor;
4
 import com.cn.esermis.dpld.entity.DetectMonitoringFactor;
5
 import org.springframework.stereotype.Service;
5
 import org.springframework.stereotype.Service;
6
 
6
 
7
+import java.util.List;
8
+
7
 @Service
9
 @Service
8
 public interface IDetectMonitoringFactorService extends IService<DetectMonitoringFactor> {
10
 public interface IDetectMonitoringFactorService extends IService<DetectMonitoringFactor> {
11
+    List<DetectMonitoringFactor> listByParentId(String id);
9
 }
12
 }

+ 17 - 0
src/main/java/com/cn/esermis/dpld/service/impl/AnalyticalInstrumentsServiceImpl.java

@@ -6,6 +6,23 @@ import com.cn.esermis.dpld.mapper.AnalyticalInstrumentsMapper;
6
 import com.cn.esermis.dpld.service.IAnalyticalInstrumentsService;
6
 import com.cn.esermis.dpld.service.IAnalyticalInstrumentsService;
7
 import org.springframework.stereotype.Service;
7
 import org.springframework.stereotype.Service;
8
 
8
 
9
+import javax.annotation.Resource;
10
+import java.util.Collections;
11
+import java.util.List;
12
+
9
 @Service
13
 @Service
10
 public class AnalyticalInstrumentsServiceImpl extends ServiceImpl<AnalyticalInstrumentsMapper, AnalyticalInstruments> implements IAnalyticalInstrumentsService {
14
 public class AnalyticalInstrumentsServiceImpl extends ServiceImpl<AnalyticalInstrumentsMapper, AnalyticalInstruments> implements IAnalyticalInstrumentsService {
15
+
16
+
17
+    @Resource
18
+    private AnalyticalInstrumentsMapper analyticalInstrumentsMapper;
19
+    @Override
20
+    public List<AnalyticalInstruments> getByDataAcquisitionInstrumentid(String id) {
21
+        return analyticalInstrumentsMapper.getByDataAcquisitionInstrumentid(id);
22
+    }
23
+
24
+    @Override
25
+    public boolean saveOb(AnalyticalInstruments analyticalInstruments) {
26
+        return analyticalInstrumentsMapper.saveOb(analyticalInstruments);
27
+    }
11
 }
28
 }

+ 12 - 0
src/main/java/com/cn/esermis/dpld/service/impl/DetectMonitoringFactorImpl.java

@@ -6,6 +6,18 @@ import com.cn.esermis.dpld.mapper.DetectMonitoringFactorMapper;
6
 import com.cn.esermis.dpld.service.IDetectMonitoringFactorService;
6
 import com.cn.esermis.dpld.service.IDetectMonitoringFactorService;
7
 import org.springframework.stereotype.Service;
7
 import org.springframework.stereotype.Service;
8
 
8
 
9
+import javax.annotation.Resource;
10
+import java.util.Collections;
11
+import java.util.List;
12
+
9
 @Service
13
 @Service
10
 public class DetectMonitoringFactorImpl extends ServiceImpl<DetectMonitoringFactorMapper, DetectMonitoringFactor> implements IDetectMonitoringFactorService {
14
 public class DetectMonitoringFactorImpl extends ServiceImpl<DetectMonitoringFactorMapper, DetectMonitoringFactor> implements IDetectMonitoringFactorService {
15
+
16
+    @Resource
17
+    private DetectMonitoringFactorMapper detectMonitoringFactorMapper;
18
+
19
+    @Override
20
+    public List<DetectMonitoringFactor> listByParentId(String parentId) {
21
+        return detectMonitoringFactorMapper.listByParentId(parentId);
22
+    }
11
 }
23
 }

+ 23 - 3
src/main/java/com/cn/esermis/model/FactorModel.java

@@ -1,5 +1,6 @@
1
 package com.cn.esermis.model;
1
 package com.cn.esermis.model;
2
 
2
 
3
+import com.alibaba.fastjson2.JSON;
3
 import com.alibaba.fastjson2.JSONObject;
4
 import com.alibaba.fastjson2.JSONObject;
4
 import lombok.Data;
5
 import lombok.Data;
5
 
6
 
@@ -9,11 +10,30 @@ import java.util.List;
9
 @Data
10
 @Data
10
 public class FactorModel {
11
 public class FactorModel {
11
 
12
 
13
+    public static void main(String[] args) {
12
 
14
 
13
-    public FactorModel factorModel(JSONObject msg){
14
-        FactorModel javaObject = msg.toJavaObject(FactorModel.class);
15
-
15
+        String json = "{\n" +
16
+                "\t\"SIZE\": \"0114\",\n" +
17
+                "\t\"QN\": \"20241015151000142\",\n" +
18
+                "\t\"ST\": \"59\",\n" +
19
+                "\t\"CN\": \"2011\",\n" +
20
+                "\t\"PW\": \"123456\",\n" +
21
+                "\t\"MN\": \"399435X0017503\",\n" +
22
+                "\t\"Flag\": \"5\",\n" +
23
+                "\t\"DataTime\": \"20241015151000\",\n" +
24
+                "\t\"CP\": [{\n" +
25
+                "\t\t\"Rtd\": \"Fb\",\n" +
26
+                "\t\t\"factor\": \"p10103\"\n" +
27
+                "\t}],\n" +
28
+                "\t\"End\": \"4DC0\\r\\n\"\n" +
29
+                "}";
30
+        FactorModel javaObject = JSON.parseObject(JSON.toJSONString(json), FactorModel.class);
31
+        System.out.println(javaObject);
32
+    }
16
 
33
 
34
+    public FactorModel factorModel(JSONObject msg){
35
+//        FactorModel javaObject = msg.toJavaObject(FactorModel.class);
36
+        FactorModel javaObject = JSON.parseObject(JSON.toJSONString(msg), FactorModel.class);
17
         return javaObject;
37
         return javaObject;
18
     }
38
     }
19
 
39
 

+ 7 - 4
src/main/resources/application.yml

@@ -44,7 +44,12 @@ spring:
44
 
44
 
45
 mybatis-plus:
45
 mybatis-plus:
46
   mapper-locations: classpath:static/**/*.xml
46
   mapper-locations: classpath:static/**/*.xml
47
-
47
+  configuration:
48
+    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl # 指定 MyBatis 使用 SLF4J 日志实现
49
+logging:
50
+  level:
51
+    cnooc.esermis: DEBUG
52
+    com.baomidou.mybatisplus.core.mapper: debug # 设置 Mapper 接口的日志级别为 DEBUG
48
   ## 工程设置
53
   ## 工程设置
49
 #project:
54
 #project:
50
 #  debug: false
55
 #  debug: false
@@ -86,9 +91,7 @@ mybatis-plus:
86
 #    cache-enabled: false
91
 #    cache-enabled: false
87
 
92
 
88
   ##日志配置
93
   ##日志配置
89
-logging:
90
-  level:
91
-    cnooc.esermis: DEBUG
94
+
92
 
95
 
93
 #线程池
96
 #线程池
94
 ##线程池维护线程的最少数量 -
97
 ##线程池维护线程的最少数量 -

+ 22 - 0
src/main/resources/static/mybatis/AnalyticalInstrumentsMapper.xml

@@ -0,0 +1,22 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.cn.esermis.dpld.mapper.AnalyticalInstrumentsMapper">
6
+    <insert id="saveOb" parameterType="com.cn.esermis.dpld.entity.AnalyticalInstruments">
7
+        insert into analytical_instruments(id,brand,model,name,factorInfor,range,data_acquisition_instrument_id,reference_oxygen_content,velocity_field_coefficient,pitot_tube_coefficient,k_value,flue_area,dilution_ratio,type)
8
+        values(#{id},#{brand},#{model},#{name},#{factorInfor},#{range},#{dataAcquisitionInstrumentId},#{referenceOxygenContent},#{velocityFieldCoefficient},#{pitotTubeCoefficient},#{kValue},#{flueArea},#{dilutionRatio},#{type})
9
+
10
+    </insert>
11
+
12
+    <select id="getByDataAcquisitionInstrumentid" resultType="com.cn.esermis.dpld.entity.AnalyticalInstruments"
13
+            parameterType="java.lang.String">
14
+        select * from analytical_instruments
15
+            <where>
16
+            <if test="productId != null">
17
+                and data_acquisition_instrument_id = #{productId}
18
+            </if>
19
+            </where>
20
+    </select>
21
+</mapper>
22
+

+ 17 - 0
src/main/resources/static/mybatis/DetectMonitoringFactorMapper.xml

@@ -0,0 +1,17 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.cn.esermis.dpld.mapper.DetectMonitoringFactorMapper">
6
+
7
+
8
+    <select id="listByParentId" resultType="com.cn.esermis.dpld.entity.DetectMonitoringFactor">
9
+        select * from monitoring_factor
10
+        <where>
11
+            <if test="parentId != null">
12
+                and analytical_instrument_id = #{parentId}
13
+            </if>
14
+        </where>
15
+    </select>
16
+</mapper>
17
+