Browse Source

找不到检测影子报错 修改

zjs 1 week ago
parent
commit
6a161055c6

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

@@ -14,6 +14,16 @@ public class Constant {
14 14
         public static final String REAL = "2011"; //实时值
15 15
         public static final String DAY = "2031"; //日数据
16 16
 
17
+
18
+        public static final String HOUR_STR = "CN=2061"; //日数据
19
+        public static final String MINUTE_STR = "CN=2051"; //日数据
20
+
21
+        public static final String HJ2122005 = "2005"; //日数据
22
+        public static final String HJ2122017 = "2017"; //日数据
23
+
24
+
25
+
26
+
17 27
         public static final  String CN = "CN"; //大气环境污染源
18 28
         public static final  String SERVER = "server"; //大气环境污染源
19 29
 

+ 3 - 0
src/main/java/com/cn/esermis/datawarn/common/ExceptionDataDispose.java

@@ -53,6 +53,9 @@ public class ExceptionDataDispose {
53 53
             dataAll.add(Long.toString(dataTime1));
54 54
         }
55 55
         Integer flag = monitorFactorMapper.waterOrAir(factor);
56
+        if (flag==null){
57
+            return "0";
58
+        }
56 59
         if (flag.equals(1)) {
57 60
             dataAll.replaceAll(s -> s.concat("0000"));
58 61
             all = (ArrayList<Double>) countAirChargeMapper.airSixHour(mn, factor, dataAll.get(0),

+ 4 - 2
src/main/java/com/cn/esermis/netty/BootNettyChannelInboundHandlerAdapter.java

@@ -76,9 +76,11 @@ public class BootNettyChannelInboundHandlerAdapter extends ChannelInboundHandler
76 76
             if (msg == null) {
77 77
                 return;
78 78
             }
79
-            log.info("=============" + (new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date()) + "=============");
80 79
             String message = msg.toString();
81
-            log.info("收到数据:" + message);
80
+            if (message.contains(Constant.MINUTE_STR) || message.contains(Constant.HOUR_STR)) {
81
+                log.info("=============" + (new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date()) + "=============");
82
+                log.info("收到数据:" + message);
83
+            }
82 84
             if (message.contains("&&")) {
83 85
                 String[] split = message.split("&&");
84 86
                 if (split.length == 3) {