左晓为主开发手持机充值管理机
zuoxiao
2023-11-14 5a843ba11b991722f8f2af386f0e546e2769f7c3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.dayu.recharge.socketBean;
 
import com.dayu.recharge.tools.ArraysUtil;
import com.dayu.recharge.utils.CRC8;
 
/**
 * Copyright (C), 2022,
 * Author: zuo
 * Date: 2022/2/7 14:53
 * Description: 查询余额
 */
public class BalanceSelecteRequestBean extends BaseSocketBean {
    String control;//控制域
    String initCode;//= new String[15];//设备注册号
    String xuLie;//= new String[3];//充值管理机序列号(低)充值管理机序列号(中)充值管理机序列号(高)
    String AFN = "94";//余额查询
    String initPeasantCode; //= new String[16];//农户注册编号
 
    @Override
    public byte[] toByte() {
        byte[] data = new byte[37];
        data[0] = CRC8.hexStrToBinaryStr(control)[0];
        byte[] initCodeBytes = CRC8.hexStrToBinaryStr(initCode);
        ArraysUtil.copyof(data, initCodeBytes, 1);
        byte[] machineCodeByte = CRC8.hexStrToBinaryStr(xuLie);
        ArraysUtil.copyof(data, machineCodeByte, 17);
        ArraysUtil.copyof(data, CRC8.hexStrToBinaryStr(AFN)[0], 20);
        byte[] initPeasantCodeByte = CRC8.hexStrToBinaryStr(initPeasantCode);
        ArraysUtil.copyof(data, initPeasantCodeByte, 21);
        return data;
    }
 
    @Override
    public String toString() {
        return
                control +
                        initCode +
                        xuLie +
                        AFN +
                        initPeasantCode;
    }
 
    public String getControl() {
        return control;
    }
 
    public void setControl(String control) {
        this.control = control;
    }
 
    public String getInitCode() {
        return initCode;
    }
 
    public void setInitCode(String initCode) {
        this.initCode = initCode;
    }
 
    public String getXuLie() {
        return xuLie;
    }
 
    public void setXuLie(String xuLie) {
        this.xuLie = xuLie;
    }
 
    public String getAFN() {
        return AFN;
    }
 
    public void setAFN(String AFN) {
        this.AFN = AFN;
    }
 
    public String getInitPeasantCode() {
        return initPeasantCode;
    }
 
    public void setInitPeasantCode(String initPeasantCode) {
        this.initPeasantCode = initPeasantCode;
    }
 
 
}