From 3673328730251736f9614793d9a75630c17b28f6 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期二, 13 八月 2024 09:10:27 +0800
Subject: [PATCH] 修改未关泵补卡逻辑
---
qiheonlinelibrary/src/main/java/com/dayu/qiheonlinelibrary/card/RegionCard.java | 50 ++++++++++++++------------------------------------
1 files changed, 14 insertions(+), 36 deletions(-)
diff --git a/qiheonlinelibrary/src/main/java/com/dayu/qiheonlinelibrary/card/RegionCard.java b/qiheonlinelibrary/src/main/java/com/dayu/qiheonlinelibrary/card/RegionCard.java
index 3285855..339bca6 100644
--- a/qiheonlinelibrary/src/main/java/com/dayu/qiheonlinelibrary/card/RegionCard.java
+++ b/qiheonlinelibrary/src/main/java/com/dayu/qiheonlinelibrary/card/RegionCard.java
@@ -17,25 +17,15 @@
public String cardType = CardCommon.REGION;//鍗″懡浠�
- public int region;//鍖哄煙鍦板潃(浣庡墠楂樺悗) 鍙互璇嗗埆鏌愬幙闀囨潙
-
- public int controllerCodel;// 鎺у埗鍣ㄧ紪鍙�(浣庡墠楂樺悗) 鏈尯鍩熷唴鎺у埗鍣ㄧ紪鍙�
+ public int arerNumber;//鍖哄煙鍙�(搴曚綅鍦ㄥ墠楂樹綅鍦ㄥ悗)
- public int getRegion() {
- return region;
+ public int getArerNumber() {
+ return arerNumber;
}
- public void setRegion(int region) {
- this.region = region;
- }
-
- public int getControllerCodel() {
- return controllerCodel;
- }
-
- public void setControllerCodel(int controllerCodel) {
- this.controllerCodel = controllerCodel;
+ public void setArerNumber(int arerNumber) {
+ this.arerNumber = arerNumber;
}
public byte[] toByte() {
@@ -49,14 +39,9 @@
byte[] zero = data.get(0);
regionCard.cardType = HexUtil.byteToHex(zero[0]);
- byte[] regionByte = new byte[2];
- System.arraycopy(zero, 1, regionByte, 0, regionByte.length);
- regionCard.region = HexUtil.get16To10LowHightByBytes(regionByte);
-
-
- byte[] controllerCodelByte = new byte[2];
- System.arraycopy(zero, 3, controllerCodelByte, 0, controllerCodelByte.length);
- regionCard.controllerCodel = HexUtil.get16To10LowHightByBytes(controllerCodelByte);
+ byte[] arerNumberByte = new byte[4];
+ System.arraycopy(zero, 1, arerNumberByte, 0, arerNumberByte.length);
+ regionCard.arerNumber = HexUtil.get16To10LowHightByBytes(arerNumberByte);
return regionCard;
@@ -70,20 +55,13 @@
public byte[] toByte() {
byte[] data = new byte[16];
data[0] = HexUtil.hexToByte(cardType);
- byte[] regionBytes = new byte[2];
- byte[] regionDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(region));
- System.arraycopy(regionDatas, 0, regionBytes, 0, regionDatas.length);
- if (regionBytes != null) {
- System.arraycopy(regionBytes, 0, data, 1, regionBytes.length);
+ //鍖哄煙鍙�
+ byte[] arerNumberBytes = new byte[4];
+ byte[] arerNumberDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(arerNumber));
+ System.arraycopy(arerNumberDatas, 0, arerNumberBytes, 0, arerNumberDatas.length);
+ if (arerNumberBytes != null) {
+ System.arraycopy(arerNumberBytes, 0, data, 1, arerNumberBytes.length);
}
- byte[] controllerCodelBytes = new byte[2];
- byte[] controllerCodelDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(controllerCodel));
- System.arraycopy(controllerCodelDatas, 0, controllerCodelBytes, 0, controllerCodelDatas.length);
- if (controllerCodelBytes != null) {
- System.arraycopy(controllerCodelBytes, 0, data, 3, controllerCodelBytes.length);
- }
-
-
data[15] = getByteSum(data);
return data;
}
--
Gitblit v1.8.0