左晓为主开发手持机充值管理机
zuoxiao
2024-05-09 b8f8323cc39091d3119101923251a0455da87f55
qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java
@@ -32,11 +32,10 @@
    }
    public static ElectricPriceCard getBean(List<byte[]> data){
        ElectricPriceCard regionCard=new ElectricPriceCard();
        byte[] zero=data.get(0);
        regionCard.cardType= HexUtil.byteToHex(zero[0]);
    public static ElectricPriceCard getBean(List<byte[]> data) {
        ElectricPriceCard regionCard = new ElectricPriceCard();
        byte[] zero = data.get(0);
        regionCard.cardType = HexUtil.byteToHex(zero[0]);
        byte[] cardDataByte = new byte[4];
        System.arraycopy(zero, 1, cardDataByte, 0, cardDataByte.length);
@@ -45,7 +44,7 @@
        byte[] electricPriceByte = new byte[4];
        System.arraycopy(zero, 5, electricPriceByte, 0, electricPriceByte.length);
        regionCard.electricPrice = HexUtil.bytesToFloat(electricPriceByte);
        regionCard.electricPrice = HexUtil.hexToFloatLowHigh(electricPriceByte);
        return regionCard;
@@ -55,7 +54,7 @@
    /**
     * 第1扇区0块 存储的数据
     */
    public class Zero  {
    public class Zero {
        public byte[] toByte() {
            byte[] data = new byte[16];
            data[0] = HexUtil.hexToByte(cardType);
@@ -65,7 +64,7 @@
                System.arraycopy(regionBytes, 0, data, 1, regionBytes.length);
            }
            byte[] controllerCodelBytes = HexUtil.folatToByte(electricPrice);
            byte[] controllerCodelBytes = HexUtil.hexToByteArray(HexUtil.floatToHexLowHigh(electricPrice));
            if (controllerCodelBytes != null) {
                System.arraycopy(controllerCodelBytes, 0, data, 5, controllerCodelBytes.length);
            }