From 2daa780ed9c74cb689f7c1e6a13f8aadebd57208 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 15 五月 2025 16:59:09 +0800
Subject: [PATCH] 表阀一体协议,修改域名及端口解析,适应空值情况。

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java
index 5759e11..9111656 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java
@@ -42,7 +42,7 @@
 
         midRs.reportOrResponse_trueOrFalse = false ;
 
-        callback.callback(midRs.reportOrResponse_trueOrFalse);
+        callback.callback(midRs.reportOrResponse_trueOrFalse, para.data.subData==null?null:((DataV202404)(para.data.subData)).subData);
         return new MidResult[]{midRs} ;
     }
     /**
@@ -54,9 +54,9 @@
      * @throws Exception 寮傚父
      */
     protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
-        DataV202404 dV1 = (DataV202404)data.getSubData() ;
+        DataV202404 dV202404 = (DataV202404)data.getSubData() ;
         DataCd87Vo cdData = new DataCd87Vo(CodeV202404.getCodeName(dataCode)) ;
-        dV1.subData = cdData ;
+        dV202404.subData = cdData ;
         int index = ProtocolConstantV206V202404.dataIndex ;
         cdData.controllerType = ByteUtil.bytes2Hex(bs, false, index, 1) ;
 
@@ -73,10 +73,17 @@
         short portLen = ByteUtilUnsigned.byte2Byte(bs, index) ;
 
         index++ ;
-        cdData.domain = ByteUtil.bytes2String_BE(bs, index, index + domainLen - 1) ;
-
+        if(domainLen > 0){
+            cdData.domain = ByteUtil.bytes2String_BE(bs, index, index + domainLen - 1) ;
+        }else{
+            cdData.domain = "" ;
+        }
         index += domainLen ;
-        cdData.port = Integer.parseInt(ByteUtil.bytes2String_BE(bs, index, index + portLen - 1)) ;
+        if(portLen > 0){
+            cdData.port = Integer.parseInt(ByteUtil.bytes2String_BE(bs, index, index + portLen - 1)) ;
+        }else{
+            cdData.port = 0 ;
+        }
     }
 
 }

--
Gitblit v1.8.0