左晓为主开发手持机充值管理机
qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/RegionCard.java
@@ -1,7 +1,7 @@
package com.dayu.qihealonelibrary.card;
import com.dayu.baselibrary.tools.HexUtil;
import com.dayu.qihealonelibrary.utils.MyCommon;
import com.dayu.qihealonelibrary.utils.CardCommon;
import java.io.Serializable;
import java.util.List;
@@ -14,19 +14,27 @@
 */
public class RegionCard extends BaseCard implements Serializable {
    public String cardType = MyCommon.REGION;//卡命令
    public String cardType = CardCommon.REGION;//卡命令
    public short region;//区域地址(低前高后) 可以识别某县镇村
    public int region;//区域地址(低前高后) 可以识别某县镇村
    public short controllerCodel;// 控制器编号(低前高后) 本区域内控制器编号
    public int controllerCodel;// 控制器编号(低前高后) 本区域内控制器编号
    public short getRegion() {
    public int getRegion() {
        return region;
    }
    public short getControllerCodel() {
    public void setRegion(int region) {
        this.region = region;
    }
    public int getControllerCodel() {
        return controllerCodel;
    }
    public void setControllerCodel(int controllerCodel) {
        this.controllerCodel = controllerCodel;
    }
    public byte[] toByte() {
@@ -35,20 +43,19 @@
    }
    public static RegionCard getBean(List<byte[]> data){
        RegionCard regionCard=new RegionCard();
        byte[] zero=data.get(0);
        regionCard.cardType= HexUtil.byteToHex(zero[0]);
    public static RegionCard getBean(List<byte[]> data) {
        RegionCard regionCard = new RegionCard();
        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 = (short) HexUtil.get16to10LowHigh(HexUtil.bytesToHex(regionByte));
        regionCard.region = HexUtil.get16To10LowHightByBytes(regionByte);
        byte[] controllerCodelByte = new byte[2];
        System.arraycopy(zero, 3, controllerCodelByte, 0, controllerCodelByte.length);
        regionCard.controllerCodel = (short) HexUtil.get16to10LowHigh(HexUtil.bytesToHex(controllerCodelByte));
        regionCard.controllerCodel = HexUtil.get16To10LowHightByBytes(controllerCodelByte);
        return regionCard;
@@ -58,7 +65,7 @@
    /**
     * 第1扇区0块 存储的数据
     */
    public class Zero  {
    public class Zero {
        public byte[] toByte() {
            byte[] data = new byte[16];
            data[0] = HexUtil.hexToByte(cardType);