From b59cce37e4180dac3e4f523e90a58a1c2b99640a Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期二, 02 七月 2024 10:32:23 +0800
Subject: [PATCH] 2024-07-02 朱宝民 强制关阀
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java | 146 +++++++++++-------------------------------------
1 files changed, 35 insertions(+), 111 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java
index cf23f06..2efc729 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java
@@ -3,6 +3,8 @@
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.*;
import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlParse;
+import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd83CloseVo;
+import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd83OpenVo;
import com.dy.common.util.ByteUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -98,47 +100,24 @@
cdData.type = opType ;
short index = ProtocolConstantV206V1_0_0.dataIndex + 1 ;
- //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆�
- cdData.totalAmount = 0.0D ;
- int 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~99999999.99锛屽崟浣嶄负m3銆�
+ int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ;
+ cdData.totalAmount = tpInt/100.0 ;
+ index += 5 ;
//鐢ㄦ按鎴峰彿鏁版嵁鏍煎紡锛�5瀛楄妭BCD鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛��
cdData.icCardNo = ByteUtil.BCD2String_LE(bs, index, index + 4) ;
+
index += 5 ;
-
//IC鍗″彿鏍煎紡锛�4瀛楄妭HEX鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛��
- cdData.icCardAddr = ByteUtil.bytesToHex(bs, index, index + 3) ;
+ cdData.icCardAddr = ByteUtil.bytes2Hex_LE(bs, false, index, 4) ;
+
index += 4 ;
-
//鐢ㄦ按鎴蜂綑棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦��
- cdData.remainMoney = 0.0D ;
- 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 ;
+ tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 3) ;
+ cdData.remainMoney = tpInt/100.0 ;
+ index += 4 ;
//鐢ㄦ按鎴风敤姘村紑濮嬫椂闂达細6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬��
cdData.openDt = GlParse.parseTp(bs, index) ;
@@ -173,108 +152,53 @@
short index = ProtocolConstantV206V1_0_0.dataIndex + 1 ;
//绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆�
- cdData.totalAmount = 0.0D ;
- int 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 ;
+ int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ;
+ cdData.totalAmount = tpInt/100.0 ;
+ index += 5 ;
//鐢ㄦ按鎴峰彿鏁版嵁鏍煎紡锛�5瀛楄妭BCD鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛��
cdData.icCardNo = ByteUtil.BCD2String_LE(bs, index, index + 4) ;
+
index += 5 ;
-
//IC鍗″彿鏍煎紡锛�4瀛楄妭HEX鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛��
- cdData.closeDt = ByteUtil.bytesToHex(bs, index, index + 3) ;
+ cdData.icCardAddr = ByteUtil.bytes2Hex_LE(bs, false, index, 4) ;
+
index += 4 ;
-
//鐢ㄦ按鎴蜂綑棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦��
- cdData.remainMoney = 0.0D ;
- 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 ;
+ tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 3) ;
+ cdData.remainMoney = tpInt/100.0 ;
+ index += 4 ;
//鐢ㄦ按鎴风敤姘村紑濮嬫椂闂达細6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬��
cdData.openDt = GlParse.parseTp(bs, index) ;
- index += 6 ;
+ index += 6 ;
//鐢ㄦ按鎴风敤姘寸粨鏉熸椂闂达細6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬��
cdData.closeDt = GlParse.parseTp(bs, index) ;
+
index += 6 ;
-
//鐢ㄦ按鎴锋湰娆$敤姘撮噺锛氱疮璁℃祦閲�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆�
- cdData.thisAmount = 0.0D ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisAmount += tpInt/100.0 ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisAmount += tpInt ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisAmount += tpInt * 100.0 ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisAmount += tpInt * 10000.0 ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisAmount += tpInt * 1000000.0 ;
+ tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ;
+ cdData.thisAmount = tpInt/100.0 ;
+ index += 5 ;
//鐢ㄦ按鎴锋湰娆℃秷璐归噾棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦��
- cdData.thisMoney = 0.0D ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisMoney += tpInt/100.0 ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisMoney += tpInt;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisMoney += tpInt * 100.0 ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisMoney += tpInt * 10000.0 ;
+ tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 3) ;
+ cdData.thisMoney = tpInt/100.0 ;
+ index += 4 ;
//鐢ㄦ按鎴锋湰娆$敤姘存椂闀匡細鐢ㄦ按鏃堕暱2瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999锛屽崟浣嶄负鍒嗛挓銆�
- cdData.thisTime = 0 ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisTime += tpInt;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.thisTime += tpInt * 100 ;
+ tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 1) ;
+ cdData.thisTime = tpInt;
-
+ index += 2 ;
cdData.priceType = bs[index] ;
index++ ;
- cdData.price = 0.0D ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.price += tpInt/100.0 ;
- tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
- index++ ;
- cdData.price += tpInt;
+ tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 1) ;
+ cdData.price = tpInt/100.0 ;
+ index += 2 ;
cdData.cardType = bs[index] ;
index++ ;
--
Gitblit v1.8.0