| | |
| | | import com.dayu.qihealonelibrary.card.ConfigurationPowerCard; |
| | | import com.dayu.qihealonelibrary.card.DomainCard; |
| | | import com.dayu.qihealonelibrary.card.ElectricPriceCard; |
| | | import com.dayu.qihealonelibrary.card.ManageCard; |
| | | import com.dayu.qihealonelibrary.card.RegionCard; |
| | | import com.dayu.qihealonelibrary.card.UserCard; |
| | | import com.dayu.qihealonelibrary.databinding.ActivityRedCardQhaBinding; |
| | |
| | | redCardBinding.redRechargeDate.setText("本卡最后购水日期:无"); |
| | | } |
| | | redCardBinding.redInitCode.setText(cardNumber); |
| | | redCardBinding.redRechargeNumber.setText("本卡充值次数:" + userCard.getRechargeTimes() + ""); |
| | | redCardBinding.redTotalWater.setText("总用水量:" + userCard.getTotalWater()); |
| | | redCardBinding.redTotalPower.setText("总用电量:" + userCard.getTotalElectric()); |
| | | redCardBinding.redRemainderBlance.setText("剩余金额:" + MornyUtil.changeF2Y(userCard.getBalance()) + "元"); |
| | | redCardBinding.redRemainderWater.setText("剩余水量:" + userCard.getSurplusWater()); |
| | | // redCardBinding.redRechargeNumber.setText("本卡充值次数:" + userCard.getRechargeTimes() + " 次"); |
| | | // redCardBinding.redTotalWater.setText("总用水量:" + MornyUtil.changeF2Y(userCard.getTotalWater()) + " 吨"); |
| | | // redCardBinding.redTotalPower.setText("总用电量:" + MornyUtil.changeF2Y(userCard.getTotalElectric()) + " 度"); |
| | | // redCardBinding.redRemainderBlance.setText("剩余金额:" + MornyUtil.changeF2Y(userCard.getBalance()) + " 元"); |
| | | redCardBinding.redRemainderWater.setText("剩余水量:" + MornyUtil.changeF2Y(userCard.getSurplusWater()) + " 吨"); |
| | | } |
| | | } |
| | | |
| | |
| | | String[] cardTypes = cardType.split(","); |
| | | if (cardTypes != null && cardTypes.length == 2) { |
| | | cardNumber = cardType.split(",")[0]; |
| | | cardNumber = HexUtil.spaceHex(cardNumber); |
| | | cardNumber = HexUtil.HighLowHex(cardNumber); |
| | | cardType = cardType.split(",")[1]; |
| | | } |
| | | List<byte[]> data = NfcReadHelper.getInstence(intent, this).getOnesectorData(); |
| | |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | | } |
| | | |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.MANAGE_CRAD: |
| | | ManageCard manageCard = ManageCard.getBean(data); |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为管理卡"); |
| | | stopAnim(); |
| | | String hex = manageCard.getUserCard().toUpperCase(); |
| | | hex = HexUtil.spaceHex(hex); |
| | | hex = HexUtil.HighLowHex(hex); |
| | | redCardBinding.readCardTypeTV.setText("当前为管理卡" + "\n\n" |
| | | + "原始卡号:" + hex); |
| | | break; |
| | | case CardCommon.CLEAN_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为清零卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.REGISTERED_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为重新注册设备卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.CLEAN_ALL_USER_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为删除全部用户卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.DOMAIN_CARD_TYPE: |
| | | viweGone(false); |
| | |
| | | } else { |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | | } |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.TEST_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为测试卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.CONFIGURATION_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为配置设备注册信息卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.CONFIGURATION_POWER_CARD_TYPE: |
| | | viweGone(false); |
| | |
| | | } else { |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | | } |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.BLACK: |
| | | viweGone(false); |
| | |
| | | if (!data.isEmpty()) { |
| | | ElectricPriceCard electricPriceCard = ElectricPriceCard.getBean(data); |
| | | StringBuilder electricPriceBuilder = new StringBuilder(); |
| | | electricPriceBuilder.append("电量单价:").append(electricPriceCard.getElectricPrice()).append("\n"); |
| | | electricPriceBuilder.append("电量单价:").append(electricPriceCard.getElectricPrice()); |
| | | electricPriceBuilder.append("元"); |
| | | redCardBinding.readCardDataTV.setText(electricPriceBuilder.toString()); |
| | | } else { |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | |
| | | break; |
| | | default: |
| | | TipUtil.show(ReadCardAcitivy.this, "卡片无法识别"); |
| | | stopAnim(); |
| | | break; |
| | | } |
| | | |
| | | stopAnim(); |
| | | |
| | | } |
| | | |