From 2f5f826af002b4555bb71f554785ef6faf3b5a0f Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 26 七月 2024 10:23:04 +0800
Subject: [PATCH] 1、完善代码。

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Up.java |   68 ++++++++--------------------------
 1 files changed, 16 insertions(+), 52 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Up.java
index e4fd9cd..877e0b8 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Up.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Up.java
@@ -94,64 +94,28 @@
         cdData.cardType = bs[index] ;
 
         index++ ;
-        cdData.cardAddr = ByteUtil.bytes2Hex(bs, false,  index, 4) ;
+        cdData.cardAddr = ByteUtil.bytes2Hex_LE(bs, false,  index, 4) ;
 
         index += 4 ;
-        //鐢ㄦ按鎴峰彿鏁版嵁鏍煎紡锛�5瀛楄妭BCD鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛��
-        cdData.cardNo = ByteUtil.BCD2String_LE(bs, index, index + 4) ;
+        //鐢ㄦ按鎴峰彿鏁版嵁鏍煎紡锛�8瀛楄妭浣庝綅鍦ㄥ墠楂樹綅鍦ㄥ悗銆�
+        cdData.cardNo = GlParse.parseIcCardNo(bs, index) ;
+
+        index += 8 ;
+        //鐢ㄦ按鎴蜂綑棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦��
+        int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 3) ;
+        cdData.remainMoney = tpInt/100.0 ;
+
+        index += 4 ;
+        //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆�
+        tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ;
+        cdData.totalAmount = tpInt/100.0;
 
         index += 5 ;
-        //鐢ㄦ按鎴蜂綑棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦��
-        cdData.remainMoney = 0.0D ;
-        int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.remainMoney += tpInt/100.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.remainMoney += tpInt;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.remainMoney += tpInt * 100.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.remainMoney += tpInt * 10000.0 ;
-
-        //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆�
-        cdData.totalAmount = 0.0D ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.totalAmount += tpInt;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.totalAmount += tpInt * 100.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.totalAmount += tpInt * 10000.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.totalAmount += tpInt * 1000000.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.totalAmount += tpInt * 100000000.0 ;
-
         //鐬椂娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999.999锛屽崟浣嶄负m3/h銆�
-        cdData.instantAmount = 0.0D ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.instantAmount += tpInt/1000.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.instantAmount += tpInt/10.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.instantAmount += tpInt * 10.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.instantAmount += tpInt * 1000.0 ;
-        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
-        index++ ;
-        cdData.instantAmount += tpInt * 100000.0 ;
+        tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ;
+        cdData.instantAmount = tpInt/1000.0 ;
 
+        index += 5 ;
         cdData.alarmVo = GlParse.parseAlarm(bs, index) ;
         index += 2 ;
         cdData.stateVo = GlParse.parseState(bs, index) ;

--
Gitblit v1.8.0