| | |
| | | userCard = UserCard.getBean(data); |
| | | List<UserCardBean> userCardBeans = baseDao.userCardDao().findUserName(cardNumber); |
| | | AdminDataBean adminDataBean = baseDao.adminDao().findFirst(); |
| | | if (!userCardBeans.isEmpty()){ |
| | | userCardBean = userCardBeans.get(0); |
| | | if (adminDataBean.addressCode.equalsIgnoreCase(String.valueOf(userCard.getArerNumber()))) { |
| | | |
| | | |
| | | if (adminDataBean.addressCode.equalsIgnoreCase(String.valueOf(userCard.getArerNumber()))) { |
| | | if (!userCardBeans.isEmpty()) { |
| | | userCardBean = userCardBeans.get(0); |
| | | this.userName = userCardBean.getUserName(); |
| | | binding.rechargeReadLL.setVisibility(View.GONE); |
| | | binding.rechargeTextLL.setVisibility(View.VISIBLE); |
| | | binding.rechargeRegistBtn.setVisibility(View.VISIBLE); |
| | | binding.userName.setText(userName); |
| | | binding.redStatu.setText(state); |
| | | if (userCard != null) { |
| | | Calendar calendar = userCard.getRechargeDate(); |
| | | if (calendar != null) { |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH); // 月份从0开始,所以需要加1 |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | binding.redRechargeDate.setText("本卡最后购水日期:" + year + "年" + month + "月" + day + "日"); |
| | | } else { |
| | | binding.redRechargeDate.setText("本卡最后购水日期:无"); |
| | | } |
| | | binding.redInitCode.setText(cardNumber); |
| | | binding.redRechargeNumber.setText("本卡充值次数:" + userCard.getRechargeTimes() + ""); |
| | | binding.redTotalWater.setText("总用水量:" + userCard.getTotalWater()); |
| | | binding.redTotalPower.setText("总用电量:" + userCard.getTotalElectric()); |
| | | binding.redRemainderBlance.setText(MornyUtil.changeF2Y(userCard.getBalance()) + "元"); |
| | | binding.redRemainderWater.setText("剩余水量:" + userCard.getSurplusWater()); |
| | | } |
| | | |
| | | } else { |
| | | TipUtil.show(this, "不是本区域卡"); |
| | | userCardBean = new UserCardBean(); |
| | | userCardBean.setCardNumber(cardNumber); |
| | | userCardBean.setUserName("未知用户"); |
| | | userCardBean.setPhone("未知"); |
| | | userCardBean.setUserID("未知"); |
| | | userCardBean.setAddressCode(String.valueOf(userCard.getArerNumber())); |
| | | userCardBean.setSerial(String.valueOf(userCard.getArerNumber())); |
| | | this.userName = "未知用户"; |
| | | } |
| | | }else { |
| | | TipUtil.show(this, "未查询到该卡用户信息"); |
| | | } |
| | | |
| | | binding.rechargeReadLL.setVisibility(View.GONE); |
| | | binding.rechargeTextLL.setVisibility(View.VISIBLE); |
| | | binding.rechargeRegistBtn.setVisibility(View.VISIBLE); |
| | | binding.userName.setText(userName); |
| | | binding.redStatu.setText(state); |
| | | if (userCard != null) { |
| | | Calendar calendar = userCard.getRechargeDate(); |
| | | if (calendar != null) { |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH); // 月份从0开始,所以需要加1 |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | binding.redRechargeDate.setText("本卡最后购水日期:" + year + "年" + month + "月" + day + "日"); |
| | | } else { |
| | | binding.redRechargeDate.setText("本卡最后购水日期:无"); |
| | | } |
| | | binding.redInitCode.setText(cardNumber); |
| | | binding.redRechargeNumber.setText("本卡充值次数:" + userCard.getRechargeTimes() + ""); |
| | | binding.redTotalWater.setText("总用水量:" + userCard.getTotalWater()); |
| | | binding.redTotalPower.setText("总用电量:" + userCard.getTotalElectric()); |
| | | binding.redRemainderBlance.setText(MornyUtil.changeF2Y(userCard.getBalance()) + "元"); |
| | | binding.redRemainderWater.setText("剩余水量:" + userCard.getSurplusWater()); |
| | | } |
| | | |
| | | } else { |
| | | TipUtil.show(this, "不是本区域卡"); |
| | | } |
| | | |
| | | |
| | | } |