From 20b400c3fd2d1c0540a739c81ca0a145e7a3ce7b Mon Sep 17 00:00:00 2001 From: zuoxiao <470321431@qq.com> Date: 星期一, 23 六月 2025 14:09:23 +0800 Subject: [PATCH] refactor(card): 根据水卡编号获取卡信息 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java index 8389f8e..5114ad8 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java @@ -18,7 +18,7 @@ if(topicGrp.length != 5){ throw new Exception("鎺ユ敹鐨刴qtt娑堟伅涓婚涓嶅彲璇嗗埆") ; }else{ - if(NumUtil.isPlusIntNumber(topicGrp[4])){ + if(!NumUtil.isPlusIntNumber(topicGrp[4])){ throw new Exception("鎺ユ敹鐨刴qtt娑堟伅涓婚涓嶅彲璇嗗埆") ; } if(Integer.parseInt(topicGrp[4]) <= 0){ @@ -57,7 +57,7 @@ if(com.protocolVersion == null){ throw new Exception("鎺ユ敹鍒癕QTT鍛戒护锛屼絾鏈彁渚涘崗璁増鏈彿") ; } - if(com.code != null && com.code.trim().length() != 0){ + if(com.code == null || com.code.trim().length() == 0){ throw new Exception("鎺ユ敹鍒癕QTT鍛戒护锛屼絾鏈彁渚涘姛鑳界爜") ; } if(com.protocol.equals(ProtocolConstantSdV1.protocolName)){ @@ -73,7 +73,7 @@ public static void main(String[] args) { - String s = "ym/sd1/10000/control/m1" ; + String s = "jyg/sd1/2430002404000840/weather/1" ; String[] ss = s.split("/") ; for (String s1 : ss) { System.out.println(s1); -- Gitblit v1.8.0