|  |  | 
 |  |  |  | 
 |  |  |     public int balance;//剩余金额 底位在前  2位小数点,单位分 | 
 |  |  |  | 
 |  |  |     public int surplusWater;//剩余水量 底位在前  2位小数点 单位立方米 | 
 |  |  |     public int surplusWater;//剩余水量 底位在前  2位小数点 单位立方米 (跟价格一样先乘以100) | 
 |  |  |  | 
 |  |  |     public Calendar rechargeDate;// 购水时间 BCD | 
 |  |  |  | 
 |  |  | 
 |  |  |                     int year = (rechargeDate.get(Calendar.YEAR)) % 1000; | 
 |  |  |                     int month = rechargeDate.get(Calendar.MONTH) + 1; // 月份从0开始,所以需要加1 | 
 |  |  |                     int day = rechargeDate.get(Calendar.DAY_OF_MONTH); | 
 |  |  |                     byte bcdYear = (byte) ((year / 10) << 4 | ((year % 10) / 100)); | 
 |  |  |                     byte bcdMonth = (byte) ((month / 10) << 4 | (month % 10)); | 
 |  |  |                     byte bcdDay = (byte) ((day / 10) << 4 | (day % 10)); | 
 |  |  |                     byte bcdYear = HexUtil.getIntToBCD(year)[0]; | 
 |  |  |                     byte bcdMonth = HexUtil.getIntToBCD(month)[0]; | 
 |  |  |                     byte bcdDay = HexUtil.getIntToBCD(day)[0]; | 
 |  |  |                     data[12] = bcdYear; | 
 |  |  |                     data[13] = bcdMonth; | 
 |  |  |                     data[14] = bcdDay; | 
 |  |  | 
 |  |  |                     int year = (rechargeDate.get(Calendar.YEAR)) % 1000; | 
 |  |  |                     int month = rechargeDate.get(Calendar.MONTH) + 1; // 月份从0开始,所以需要加1 | 
 |  |  |                     int day = rechargeDate.get(Calendar.DAY_OF_MONTH); | 
 |  |  |                     byte bcdYear = (byte) ((year / 10) << 4 | ((year % 10) / 100)); | 
 |  |  |                     byte bcdMonth = (byte) ((month / 10) << 4 | (month % 10)); | 
 |  |  |                     byte bcdDay = (byte) ((day / 10) << 4 | (day % 10)); | 
 |  |  |                     byte bcdYear = HexUtil.getIntToBCD(year)[0]; | 
 |  |  |                     byte bcdMonth = HexUtil.getIntToBCD(month)[0]; | 
 |  |  |                     byte bcdDay = HexUtil.getIntToBCD(day)[0]; | 
 |  |  |                     data[12] = bcdYear; | 
 |  |  |                     data[13] = bcdMonth; | 
 |  |  |                     data[14] = bcdDay; |