| | |
| | | redCardBinding.redRemainderBlance.setText("剩余金额:" + MornyUtil.changeF2Y(blance) + "元"); |
| | | redCardBinding.redStatu.setText("卡状态:" + statu); |
| | | if (userCard != null) { |
| | | redCardBinding.redInitCode.setText("用户注册编号:" + userCard.getInitPeasantCode()); |
| | | redCardBinding.redInitCode.setText( userCard.getInitPeasantCode()); |
| | | Calendar calendar = userCard.getRechargeDate(); |
| | | if (calendar != null) { |
| | | int year = calendar.get(Calendar.YEAR); |
| | |
| | | |
| | | try { |
| | | stateText = new StringBuffer(); |
| | | //金额 |
| | | byte[] blanceByte = Arrays.copyOfRange(readData.getBodyBytes(), 3, 7); |
| | | int balance = SocketUtil.get16to10LowHigh(blanceByte); |
| | | //姓名 |
| | | byte[] nameByte = Arrays.copyOfRange(readData.getBodyBytes(), 7, 19); |
| | | String name = SocketUtil.fromHexString(SocketUtil.bytesToHexClean0(nameByte)); |
| | | int balance = 0; |
| | | String name = null; |
| | | try { |
| | | //金额 |
| | | byte[] blanceByte = Arrays.copyOfRange(readData.getBodyBytes(), 3, 7); |
| | | balance = SocketUtil.get16to10LowHigh(blanceByte); |
| | | //姓名 |
| | | byte[] nameByte = Arrays.copyOfRange(readData.getBodyBytes(), 7, 19); |
| | | name = SocketUtil.fromHexString(SocketUtil.bytesToHexClean0(nameByte)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | String state = BcdUtil.bcdToStr(readData.getBodyBytes()[2]); //BCD码00启用 01禁用 02隶属信息不符 03无此卡信息 04其它s |
| | | if ("00".equals(state)) { |