From baff68fa55ed3212f618330e18cc5735b1caf57f Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期六, 12 十月 2024 10:06:37 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

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

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java
index 51818e1..ed08e68 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java
@@ -1,10 +1,10 @@
 package com.dy.common.mw.protocol.p206V202404.parse;
 
 import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
 import com.dy.common.mw.protocol.*;
 import com.dy.common.mw.protocol.p206V202404.CodeV202404;
 import com.dy.common.mw.protocol.p206V202404.ParseParamsForDownV202404;
-import com.dy.common.mw.protocol.p206V202404.downVos.ComCd10Vo;
 import com.dy.common.mw.protocol.p206V202404.downVos.ComCd15Vo;
 import com.dy.common.mw.protocol.p206V202404.parse.global.GlCreate;
 import com.dy.common.util.ByteUtil;
@@ -22,9 +22,11 @@
 
         MidResultToRtu midRs = new MidResultToRtu() ;
         midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О
+        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;
         midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃
         midRs.commandId = para.commandId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉
         midRs.downCode = para.commandCode ;//涓嬭鍛戒护鍔熻兘鐮�;
+        midRs.downCodeName = CodeV202404.getCodeName(para.commandCode) ;//涓嬭鍛戒护鍔熻兘鐮佸悕绉�;
         midRs.downBuffer = bs ;//涓嬭鍛戒护鏁版嵁
         midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡
         midRs.hasResponse = true ;//鏄惁鏈夊簲绛�
@@ -48,7 +50,8 @@
     public byte[] doParse(ParseParamsForDownV202404 para) throws Exception {
         byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode);
         if(para.param != null){
-            String json = (String)para.param;
+            JSONObject obj = (JSONObject)para.param;
+            String json = obj.toJSONString();
             ComCd15Vo cvo = JSON.parseObject(json, ComCd15Vo.class) ;
             if(cvo == null){
                 throw new Exception("json杞珻omCd15Vo涓簄ull") ;
@@ -62,7 +65,7 @@
             if(cvo.flowNo.length() != 12){
                 throw new Exception("娴佹按鍙峰繀椤绘槸12浣嶆暟瀛�") ;
             }
-            byte[] bs = new byte[34] ;
+            byte[] bs = new byte[43] ;
             int index = 0 ;
             bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16));
 
@@ -96,9 +99,9 @@
                     bs[index++] = 0 ;
                 }
             }
-            if(cvo.chargeMoney != null){
-                String chargeMoney = "" + (Double.valueOf(cvo.chargeWater * 100)).longValue() ;
-                byte[] bTemp = ByteUtil.string2BCD_LE(chargeMoney) ;
+            if(cvo.chargeWater != null){
+                String chargeWater = "" + (Double.valueOf(cvo.chargeWater * 100)).longValue() ;
+                byte[] bTemp = ByteUtil.string2BCD_LE(chargeWater) ;
                 int bTempLen = bTemp.length ;
                 int count = 0 ;
                 for(int i = 0 ; i < bTempLen; i++){
@@ -120,6 +123,9 @@
             ByteUtil.string2BCD_BE(bs, cvo.flowNo, index) ;
 
             index += 6 ;
+            GlCreate.createDt(bs, index);
+
+            index += 6 ;
             GlCreate.createPw(bs, index);
 
             index += 2 ;

--
Gitblit v1.8.0