Browse Source

2011 不接收

zjs 2 weeks ago
parent
commit
1e03e15b1a

+ 1 - 0
src/main/java/com/cn/esermis/dpld/business/MonitorBusiness.java

@@ -330,6 +330,7 @@ public class MonitorBusiness {
330 330
                 }
331 331
             }
332 332
         } catch (Exception e) {
333
+//            throw new RuntimeException(e);
333 334
             log.error("插入数据库异常:"+e);
334 335
         }
335 336
     }

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

@@ -83,7 +83,7 @@ public class BootNettyChannelInboundHandlerAdapter extends ChannelInboundHandler
83 83
                 String[] split = message.split("&&");
84 84
                 if (split.length == 3) {
85 85
                     JSONObject jsonObject = HJ212MsgUtils.dealMsg2(message);
86
-                    if (jsonObject.getString(Constant.CN).equals(Constant.MINUTE)
86
+                    if (jsonObject!=null && jsonObject.getString(Constant.CN).equals(Constant.MINUTE)
87 87
                             || jsonObject.getString(Constant.CN).equals(Constant.HOUR)
88 88
                             || jsonObject.getString(Constant.CN).equals(Constant.REAL)){
89 89
                         adapter.publisherService.pubMsg(jsonObject);
@@ -94,7 +94,7 @@ public class BootNettyChannelInboundHandlerAdapter extends ChannelInboundHandler
94 94
                         String startStr = dataMap.get(ctx.channel().id().toString());
95 95
                         startStr = startStr + message;
96 96
                         JSONObject jsonObject = HJ212MsgUtils.dealMsg2(startStr);
97
-                        if (jsonObject.getString(Constant.CN).equals(Constant.MINUTE)
97
+                        if (jsonObject!=null &&  jsonObject.getString(Constant.CN).equals(Constant.MINUTE)
98 98
                                 || jsonObject.getString(Constant.CN).equals(Constant.HOUR)
99 99
                                 || jsonObject.getString(Constant.CN).equals(Constant.REAL)){
100 100
 //                            adapter.redisQueueService.sendMessage(Constant.SERVER, jsonObject);

+ 1 - 1
src/main/java/com/cn/esermis/utils/HJ212MsgUtils.java

@@ -68,7 +68,7 @@ public class HJ212MsgUtils {
68 68
             data.put("SIZE", headStr.substring(0, 4));
69 69
             data.putAll(JSONObject.parseObject("{\"" + headStr.substring(4) + "\"}"));
70 70
             if (!Constant.COMMAND.contains(data.getString("CN"))){
71
-                return data;
71
+                return null;
72 72
             }
73 73
             // 清洗数据体基本数据
74 74
             String[] monitors = subMsg[1].split(";");