소스 검색

fix: 湿度高限预警入库问题

aihua 3 년 전
부모
커밋
b6d604db3c
1개의 변경된 파일25개의 추가작업 그리고 25개의 파일을 삭제
  1. 25 25
      src/main/java/com/chinaitop/depot/intelligent/pushs/service/impl/GrainPushsServiceImpl.java

+ 25 - 25
src/main/java/com/chinaitop/depot/intelligent/pushs/service/impl/GrainPushsServiceImpl.java

@@ -109,7 +109,7 @@ public class GrainPushsServiceImpl implements GrainPushsService {
109 109
                     // 获取报警阈值信息7252 测湿 7253湿度高限 7254湿度低限 7509湿度预警
110 110
                     TWarningThreshold thresholdHumidity = null; //湿度高限
111 111
                     TWarningThreshold wLowestHumidity = null; //湿度底限
112
-                    TWarningThreshold wWarningHumidity = null; //湿度预警
112
+//                    TWarningThreshold wWarningHumidity = null; //湿度预警
113 113
                     String ilqYq = tTestdata.getIlqYq();
114 114
                     if (ilqYq.equals("0")) {
115 115
                         threshold = warningThresholdService.getByCfCodeAndwName(house, 0, "6972", "6983");
@@ -118,7 +118,7 @@ public class GrainPushsServiceImpl implements GrainPushsService {
118 118
 
119 119
                         thresholdHumidity = warningThresholdService.getByCfCodeAndwName(house, 0, "7252", "7253");
120 120
                         wLowestHumidity = warningThresholdService.getByCfCodeAndwName(house, 0, "7252", "7254");
121
-                        wWarningHumidity = warningThresholdService.getByCfCodeAndwName(house, 0, "7252", "7509");
121
+//                        wWarningHumidity = warningThresholdService.getByCfCodeAndwName(house, 0, "7252", "7509");
122 122
                     }
123 123
                     BigDecimal wholeSum = ps.stream().filter(TPoints -> !TPoints.getTemp().equals(new BigDecimal("250.0"))).map(TPoints::getTemp).reduce(BigDecimal.ZERO, BigDecimal::add);
124 124
                     List<BigDecimal> collect = ps.stream().filter(TPoints -> !TPoints.getTemp().equals(new BigDecimal("250.0"))).map(t -> t.getTemp()).collect(Collectors.toList());
@@ -179,17 +179,17 @@ public class GrainPushsServiceImpl implements GrainPushsService {
179 179
                             tWarningThresholdHistorieList.add(tt);
180 180
                             temp = true;
181 181
                         }
182
-                        if (wWarningHumidity != null && !temp && !inh.toString().equals("250.0") && ilqYq.equals("0")) {
183
-                            //-1 小于 0 等于 1 大于
184
-                            BigDecimal ww = wWarningHumidity.getThreshold();
185
-                            BigDecimal subtract = wh.subtract(ww); //高温减去阈值
186
-                            if (inh.compareTo(subtract) == 1 && ilqYq.equals("0")) {
187
-                                String tid = uuidUtils.getCodeId(orgId, "t_warning_threshold_history");
188
-                                String desc = "整仓仓湿(" + inh + ")高于阈值(" + subtract + ")";
189
-                                TWarningThresholdHistory tt = warningMessage.saveWThreshold(tid, house, wWarningHumidity, inh, subtract, time, desc, dataSource2, "0", "1");
190
-                                tWarningThresholdHistorieList.add(tt);
191
-                            }
192
-                        }
182
+//                        if (wWarningHumidity != null && !temp && !inh.toString().equals("250.0") && ilqYq.equals("0")) {
183
+//                            //-1 小于 0 等于 1 大于
184
+//                            BigDecimal ww = wWarningHumidity.getThreshold();
185
+//                            BigDecimal subtract = wh.subtract(ww); //高温减去阈值
186
+//                            if (inh.compareTo(subtract) == 1 && ilqYq.equals("0")) {
187
+//                                String tid = uuidUtils.getCodeId(orgId, "t_warning_threshold_history");
188
+//                                String desc = "整仓仓湿(" + inh + ")高于阈值(" + subtract + ")";
189
+//                                TWarningThresholdHistory tt = warningMessage.saveWThreshold(tid, house, wWarningHumidity, inh, subtract, time, desc, dataSource2, "0", "1");
190
+//                                tWarningThresholdHistorieList.add(tt);
191
+//                            }
192
+//                        }
193 193
                     }
194 194
                     if (wLowest != null) {
195 195
                         //用于判断是否已经报警
@@ -218,7 +218,7 @@ public class GrainPushsServiceImpl implements GrainPushsService {
218 218
                     if (wLowestHumidity != null) {
219 219
                         //用于判断是否已经报警
220 220
                         boolean temp = false;
221
-                        BigDecimal wl = wLowest.getThreshold();
221
+                        BigDecimal wl = wLowestHumidity.getThreshold();
222 222
                         BigDecimal inh = tTestdata.getInh();
223 223
                         //-1 小于 0 等于 1 大于
224 224
                         if (inh.compareTo(wl) == -1 && !inh.toString().equals("250.0") && ilqYq.equals("0")) {
@@ -228,17 +228,17 @@ public class GrainPushsServiceImpl implements GrainPushsService {
228 228
                             tWarningThresholdHistorieList.add(tt);
229 229
                             temp = true;
230 230
                         }
231
-                        if (wWarningHumidity != null && !temp && !inh.toString().equals("250.0") && ilqYq.equals("0")) {
232
-                            //-1 小于 0 等于 1 大于
233
-                            BigDecimal ww = wWarningHumidity.getThreshold();
234
-                            BigDecimal wadd = wl.add(ww);//高温减去阈值
235
-                            if (inh.compareTo(wadd) == -1 && ilqYq.equals("0")) {
236
-                                String tid = uuidUtils.getCodeId(orgId, "t_warning_threshold_history");
237
-                                String desc = "整仓仓湿(" + inh + ")低于阈值(" + wadd + ")";
238
-                                TWarningThresholdHistory tt = warningMessage.saveWThreshold(tid, house, wWarningHumidity, inh, wadd, time, desc, dataSource2, "0", "1");
239
-                                tWarningThresholdHistorieList.add(tt);
240
-                            }
241
-                        }
231
+//                        if (wWarningHumidity != null && !temp && !inh.toString().equals("250.0") && ilqYq.equals("0")) {
232
+//                            //-1 小于 0 等于 1 大于
233
+//                            BigDecimal ww = wWarningHumidity.getThreshold();
234
+//                            BigDecimal wadd = wl.add(ww);//高温减去阈值
235
+//                            if (inh.compareTo(wadd) == -1 && ilqYq.equals("0")) {
236
+//                                String tid = uuidUtils.getCodeId(orgId, "t_warning_threshold_history");
237
+//                                String desc = "整仓仓湿(" + inh + ")低于阈值(" + wadd + ")";
238
+//                                TWarningThresholdHistory tt = warningMessage.saveWThreshold(tid, house, wWarningHumidity, inh, wadd, time, desc, dataSource2, "0", "1");
239
+//                                tWarningThresholdHistorieList.add(tt);
240
+//                            }
241
+//                        }
242 242
                     }
243 243
 
244 244
                     Map<String, List<TPoints>> layerGroupV = ps.stream().collect(Collectors.groupingBy(t -> t.getZ()));