1.修复16进制低位在前高位在后转换成10进制时的bug
2.完成充值相关功能
3.优化导出记录相关信息
| | |
| | | private void initView() { |
| | | binding.loginBtn.setOnClickListener(v -> { |
| | | String psStr = binding.loginPw.getText().toString(); |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.NoLibrary) { |
| | | //选择版本 |
| | | LibraryDialog dialog = new LibraryDialog(this, type -> { |
| | | if (type == BaseCommon.HeNanLibrary) { |
| | | getHNPermission(); |
| | | } else if (type == BaseCommon.QHAloneLibrary) { |
| | | getQHAlonePermission(); |
| | | } |
| | | MyApplication.myApplication.initApplication(); |
| | | }); |
| | | dialog.show(); |
| | | //没有选择版本先选择版本 |
| | | return; |
| | | } |
| | | |
| | | if (TextUtils.isEmpty(psStr)) { |
| | | TipUtil.show("请输入密码"); |
| | | return; |
| | | } |
| | | if ((passWordBean == null && psStr.equals("123456")) |
| | | || passWordBean != null && passWordBean.getPassWord().equalsIgnoreCase(WSMD5.getMD5Str(psStr))) { |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.HeNanLibrary) { |
| | | startActivity(new Intent(LoginActivity.this, com.dayu.henanlibrary.activity.HomeActivity.class)); |
| | | } else if (MyApplication.myApplication.libraryType == BaseCommon.QHAloneLibrary) { |
| | | startActivity(new Intent(LoginActivity.this, HomeActivity.class)); |
| | | |
| | | |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.NoLibrary) { |
| | | //选择版本 |
| | | LibraryDialog dialog = new LibraryDialog(this, type -> { |
| | | if (type == BaseCommon.HeNanLibrary) { |
| | | getHNPermission(); |
| | | } else if (type == BaseCommon.QHAloneLibrary) { |
| | | getQHAlonePermission(); |
| | | } |
| | | MyApplication.myApplication.initApplication(); |
| | | startToHomeActivity(); |
| | | }); |
| | | dialog.show(); |
| | | //没有选择版本先选择版本 |
| | | return; |
| | | } else { |
| | | startToHomeActivity(); |
| | | } |
| | | LoginActivity.this.finish(); |
| | | |
| | | |
| | | } else { |
| | | Toast.makeText(LoginActivity.this, "密码错误", Toast.LENGTH_SHORT).show(); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private void startToHomeActivity() { |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.HeNanLibrary) { |
| | | startActivity(new Intent(LoginActivity.this, com.dayu.henanlibrary.activity.HomeActivity.class)); |
| | | } else if (MyApplication.myApplication.libraryType == BaseCommon.QHAloneLibrary) { |
| | | startActivity(new Intent(LoginActivity.this, HomeActivity.class)); |
| | | } |
| | | LoginActivity.this.finish(); |
| | | } |
| | | |
| | | /** |
| | | * 河南版的获取权限 |
| | | */ |
| | |
| | | import java.math.BigInteger; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.ByteOrder; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | |
| | | hexString = HighLowHex(hexString); |
| | | return hexString; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 16进制转10进制并且低位在前高位在后 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public static int get16To10LowHightByBytes(byte[] data) { |
| | | List<Byte> byteList = new ArrayList<>(); |
| | | for (byte b : data) { |
| | | byteList.add(b); |
| | | } |
| | | Collections.reverse(byteList); |
| | | byte[] byteArray = new byte[byteList.size()]; |
| | | for (int i = 0; i < byteList.size(); i++) { |
| | | byteArray[i] = byteList.get(i); |
| | | } |
| | | String hex = bytesToHexNoAppen(byteArray); |
| | | return Integer.parseInt(hex, 16); |
| | | } |
| | | |
| | | /** |
| | | * byte 数组转16进制字符串 不加0前缀 |
| | | * @param bytes |
| | | * @return |
| | | */ |
| | | public static String bytesToHexNoAppen(byte[] bytes) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (int i = 0; i < bytes.length; i++) { |
| | | String hex = Integer.toHexString(bytes[i] & 0xFF); |
| | | sb.append(hex); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static int getBcdToInt(byte data) { |
| | | return ((data & 0xF0) >> 4) * 10 + ((data & 0x0F)); |
| | | } |
| | | |
| | | /** |
| | | * short10进制转16进制 低位在前高位在后 |
| | | * |
| | |
| | | while (hexString.length() < 4) { |
| | | hexString = "0" + hexString; |
| | | } |
| | | |
| | | hexString = spaceHex(hexString); |
| | | hexString = HighLowHex(hexString); |
| | | return hexString; |
| | |
| | | |
| | | /** |
| | | * 将byte数组转换为带符号的32位浮点数 |
| | | * |
| | | * <p> |
| | | * 低位在前高位在后 |
| | | * |
| | | * @param value |
| | |
| | | ByteBuffer bufferLittleEndian = ByteBuffer.wrap(value); |
| | | bufferLittleEndian.order(ByteOrder.LITTLE_ENDIAN); |
| | | return bufferLittleEndian.getFloat(); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | byte[] byteArray = buffer.array(); |
| | | return byteArray; |
| | | } |
| | | |
| | | /** |
| | | * hex字符串转byte数组 |
| | | * |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String byteArrayToHexString(byte[] byteArray) { |
| | | StringBuilder hexString = new StringBuilder(); |
| | | for (byte b : byteArray) { |
| | | // 将字节转换为无符号整数 |
| | | int unsignedInt = b & 0xff; |
| | | // 将无符号整数转换为16进制字符串 |
| | | String hex = Integer.toHexString(unsignedInt); |
| | | // 如果字符串长度小于2,在前面补0 |
| | | if (hex.length() < 2) { |
| | | hex = "0" + hex; |
| | | } |
| | | hexString.append(hex); |
| | | } |
| | | return hexString.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 字节数组转16进制 不在末尾添加0 |
| | | * |
| | | * @param bytes 需要转换的byte数组 |
| | | * @return 转换后的Hex字符串 |
| | | */ |
| | | public static String bytesToHexNoAddZero(byte[] bytes) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (int i = 0; i < bytes.length; i++) { |
| | | String hex = Integer.toHexString(bytes[i] & 0xFF); |
| | | sb.append(hex); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * 16进制转10进制高低位转换 |
| | | * @param hex |
| | | * @return |
| | | */ |
| | | public static int get16to10LowHigh(String hex) { |
| | | try { |
| | | String str = ""; |
| | | str = spaceHex(hex); |
| | | str = HighLowHex(str); |
| | | return Integer.parseInt(str, 16); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | <string name="login_title">大禹节水\n智能充值管理系统</string> |
| | | <string name="company_name">大禹节水科技研究有限公司</string> |
| | | <string name="eq_no">设备编号:</string> |
| | | <string name="eq_no">区域号:</string> |
| | | <string name="address_code">区域号:</string> |
| | | </resources> |
| | |
| | | //默认是1元 |
| | | userCard.setElectricityPrice(1.000f); |
| | | } |
| | | userCard.setSwipeNumber((short) 0); |
| | | userCard.setSwipeNumber( 0); |
| | | userCard.setState("00"); |
| | | userCard.setBalance(0); |
| | | userCard.setAddressCode(adminData.getAddressCode()); |
| | |
| | | import com.dayu.henanlibrary.socketBean.BalanceSelecteRequestBean; |
| | | import com.dayu.henanlibrary.tools.NfcReadHelper; |
| | | import com.dayu.henanlibrary.tools.WriteCardUtils; |
| | | import com.dayu.henanlibrary.utils.CardCommon; |
| | | import com.dayu.henanlibrary.utils.DeviceNumberUtils; |
| | | import com.dayu.henanlibrary.utils.SocketUtil; |
| | | import com.dayu.henanlibrary.view.ProgressDialog; |
| | |
| | | this.intent = intent; |
| | | userCard = NfcReadHelper.getInstence(intent, this).getUserCardData(); |
| | | if (userCard != null) { |
| | | ProgressDialog.show(this); |
| | | selectBalance(userCard.getInitPeasantCode()); |
| | | if (userCard.getCardType().equalsIgnoreCase(CardCommon.USER_CARD_TYPE_1) |
| | | || userCard.getCardType().equalsIgnoreCase(CardCommon.USER_CARD_TYPE_2) |
| | | || userCard.getCardType().equalsIgnoreCase(CardCommon.USER_CARD_TYPE_3)) { |
| | | ProgressDialog.show(this); |
| | | selectBalance(userCard.getInitPeasantCode()); |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "当前卡非用户卡"); |
| | | } |
| | | |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "卡片读取失败"); |
| | | } |
| | |
| | | |
| | | public int rechargeTimes;//充值次数 |
| | | |
| | | public short swipeNumber;//刷卡次数 一般不用精细管控才用 |
| | | public int swipeNumber;//刷卡次数 一般不用精细管控才用 |
| | | |
| | | public float electricityPrice;//电量单价 管理元可以修改 |
| | | |
| | |
| | | byte[] balanceBytes = new byte[4]; |
| | | System.arraycopy(zero, 9, balanceBytes, 0, balanceBytes.length); |
| | | |
| | | userCard.balance = HexUtil.get16to10LowHigh(HexUtil.bytesToHex(balanceBytes)); |
| | | |
| | | // userCard.balance = HexUtil.get16to10LowHigh(HexUtil.bytesToHex(balanceBytes)); |
| | | userCard.balance = HexUtil.get16To10LowHightByBytes(balanceBytes); |
| | | byte[] addressCodeBytes = new byte[6]; |
| | | System.arraycopy(zero, 13, addressCodeBytes, 0, 2); |
| | | System.arraycopy(two, 11, addressCodeBytes, 2, 4); |
| | |
| | | } |
| | | |
| | | |
| | | public short getSwipeNumber() { |
| | | public int getSwipeNumber() { |
| | | return swipeNumber; |
| | | } |
| | | |
| | | public void setSwipeNumber(short swipeNumber) { |
| | | public void setSwipeNumber(int swipeNumber) { |
| | | this.swipeNumber = swipeNumber; |
| | | } |
| | | |
| | |
| | | |
| | | private void initView() { |
| | | adminBinding.setupOk.setOnClickListener(v -> { |
| | | String strSerial = adminBinding.adminSerial.getText().toString(); |
| | | String strSerial = adminBinding.adminAddressCode.getText().toString(); |
| | | String strAddressCode = adminBinding.adminAddressCode.getText().toString(); |
| | | if (!TextUtils.isEmpty(strAddressCode) |
| | | && !TextUtils.isEmpty(strSerial)) { |
| | | |
| | | if (Integer.valueOf(strSerial) <= 65535) { |
| | | // if (Integer.valueOf(strSerial) <= 65535) { |
| | | if (Integer.valueOf(strAddressCode) <= 65535) { |
| | | adminData.setAddressCode(strAddressCode); |
| | | adminData.setSerial(strSerial); |
| | |
| | | TipUtil.show(AdminSetupActivity.this, "输入的区域号不能超过65535"); |
| | | } |
| | | |
| | | } else { |
| | | TipUtil.show(AdminSetupActivity.this, "输入的设备编号不能超过65535"); |
| | | } |
| | | // } else { |
| | | // TipUtil.show(AdminSetupActivity.this, "输入的设备编号不能超过65535"); |
| | | // } |
| | | } else { |
| | | TipUtil.show(AdminSetupActivity.this, "请输入完整内容"); |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.dayu.qihealonelibrary.dbBean.AdminDataBean; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Copyright (C), 2023, |
| | | * Author: zuo |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | private void initView() { |
| | | homeBinding.homeNewCard.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | if (adminData != null) { |
| | | startActivity(new Intent(HomeActivity.this, NewCardActivity.class)); |
| | | } else { |
| | | TipUtil.show("请先设置设备编号和区域号"); |
| | | TipUtil.show("请先在个人中心内设置区域号"); |
| | | } |
| | | |
| | | } |
| | |
| | | if (adminData != null) { |
| | | startActivity(new Intent(HomeActivity.this, RechargeActivity.class)); |
| | | } else { |
| | | TipUtil.show("请先设置设备编号和区域号"); |
| | | TipUtil.show("请先在个人中心内设置区域号"); |
| | | } |
| | | |
| | | } |
| | |
| | | return; |
| | | } |
| | | if (isRechargeList) { |
| | | title = new String[]{"设备序列号", "用户名", "订单号", "充值日期", "充值金额(元)", "剩余金额(元)"}; |
| | | title = new String[]{"设备序列号", "用户名", "卡号", "充值日期", "充值金额(元)", "剩余金额(元)"}; |
| | | fileName = file.toString() + "/" + ExcelUtil.outRechargePathName; |
| | | } else { |
| | | title = new String[]{"设备序列号", "用户名", "身份证号", "注册日期", "电话"}; |
| | | title = new String[]{"设备序列号", "用户名", "身份证号", "卡号", "注册日期", "电话"}; |
| | | fileName = file.toString() + "/" + ExcelUtil.outUserPathName; |
| | | } |
| | | ExcelUtil.initExcel(fileName, title); |
| | |
| | | myBinding.myAdminName.setText(adminData.getAddressCode()); |
| | | myBinding.myVillageNum.setText(adminData.getSerial()); |
| | | } else { |
| | | myBinding.myAdminName.setText("请点击区域号设置"); |
| | | myBinding.myVillageNum.setText("请点击区域号设置"); |
| | | myBinding.myAdminName.setText("请点击设置区域号"); |
| | | myBinding.myVillageNum.setText("请点击设置区域号"); |
| | | } |
| | | StringBuilder msgData = new StringBuilder(); |
| | | |
| | |
| | | package com.dayu.qihealonelibrary.activity; |
| | | |
| | | import android.content.Intent; |
| | | import android.content.res.Resources; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.widget.Toast; |
| | | |
| | | import com.dayu.baselibrary.utils.AidlUtil; |
| | | import com.dayu.baselibrary.utils.BaseCommon; |
| | | import com.dayu.baselibrary.utils.DateUtil; |
| | | import com.dayu.baselibrary.utils.MornyUtil; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.qihealonelibrary.QHAloneApplication; |
| | | import com.dayu.qihealonelibrary.card.CleanCard; |
| | |
| | | import com.dayu.qihealonelibrary.tools.WriteCardUtils; |
| | | import com.dayu.qihealonelibrary.utils.CardCommon; |
| | | import com.tencent.bugly.crashreport.CrashReport; |
| | | |
| | | import java.util.Calendar; |
| | | |
| | | /** |
| | | * Copyright (C), 2023, |
| | |
| | | binding.cardData.setText("制作配置水泵功率卡"); |
| | | } |
| | | if (this.getIntent().hasExtra("morny")) { |
| | | startAnim(); |
| | | // 充值逻辑 |
| | | isRecharge = true; |
| | | morny = this.getIntent().getStringExtra("morny"); |
| | | userName = this.getIntent().getStringExtra("userName"); |
| | | cardNumber = this.getIntent().getStringExtra("cardNumber"); |
| | | userCardBean = (UserCardBean) this.getIntent().getSerializableExtra("userCardBean"); |
| | | binding.cardData.setText("充值金额:" + morny + "元"); |
| | | // 充值逻辑 |
| | | // recharge(userCard.getInitPeasantCode(), userName, "启用"); |
| | | } |
| | | |
| | | try { |
| | |
| | | try { |
| | | if (userFlag && userCardBean != null) { |
| | | //用户卡 |
| | | startDetailActivity(userCardBean.getUserName(), "启用"); |
| | | startDetailActivity(userCardBean.getUserName(), "终端写卡"); |
| | | } else if (!TextUtils.isEmpty(morny)) { |
| | | TipUtil.show(NFCWreatActivity.this, "充值成功", () -> NFCWreatActivity.this.finish()); |
| | | } else { |
| | |
| | | checkHasUser(); |
| | | } else if (isRecharge) { |
| | | //充值逻辑 |
| | | rechargeWrratCard(); |
| | | rechargeWreatCard(); |
| | | } else { |
| | | //其他管理卡逻辑 |
| | | saveData(); |
| | |
| | | data.append(getResources().getString(com.dayu.baselibrary.R.string.login_title) + "\n"); |
| | | data.append("设备序列号:" + rechargeBean.getSerial() + "\n"); |
| | | data.append("用户名:" + rechargeBean.getUserName() + "\n"); |
| | | // data.append("户 号:" + rechargeBean.getUserNum() + "\n"); |
| | | data.append("卡 号:" + rechargeBean.getCardNumber() + "\n"); |
| | | data.append("充值金额:" + rechargeBean.getMorny() + "元" + "\n"); |
| | | data.append("卡内余额:" + rechargeBean.getBalance() + "元" + "\n"); |
| | | data.append("日 期:" + DateUtil.dateToStamp(rechargeBean.getDate(), DateUtil.type2) + "\n\n"); |
| | | data.append("*****************************"); |
| | | } |
| | | |
| | | float size = 26; |
| | | |
| | | try { |
| | |
| | | |
| | | |
| | | //往卡内写充值后的数据 |
| | | private void rechargeWrratCard() { |
| | | UserCard userCardold = NfcReadHelper.getInstence(intent, this).getUserCardData(); |
| | | if (userCardold != null) { |
| | | //判断是否充值的是一个卡 |
| | | // if (userCard.getInitPeasantCode().equals(userCardold.getInitPeasantCode())) { |
| | | // userCard.setState("00"); |
| | | // userFlag = WriteCardUtils.setUser(intent, userCard, this); |
| | | // // 打印相关 |
| | | // if (userFlag) { |
| | | // setPrinterData(rechargeBean); |
| | | // startDetailActivity(userName, "启用"); |
| | | // } else { |
| | | // TipUtil.show(NFCWreatActivity.this, "写卡失败,请重新再试"); |
| | | // } |
| | | // } else { |
| | | // TipUtil.show(NFCWreatActivity.this, "读取的卡和充值的卡不一致"); |
| | | // } |
| | | private void rechargeWreatCard() { |
| | | String cardNumberThis = NfcReadHelper.getInstence(intent, this).getCardNumber(); |
| | | //判断是否充值的是一个卡 |
| | | if (cardNumberThis.equalsIgnoreCase(cardNumber)) { |
| | | int balance = userCard.getBalance() + MornyUtil.changeY2F(morny); |
| | | userCard.setBalance(balance); |
| | | int rechageTims = userCard.getRechargeTimes() + 1; |
| | | if (rechageTims == 256) { |
| | | rechageTims = 0; |
| | | } |
| | | userCard.setRechargeTimes((short) rechageTims); |
| | | userCard.setRechargeDate(Calendar.getInstance()); |
| | | userFlag = WriteCardUtils.setUser(intent, userCard, this); |
| | | if (userFlag) { |
| | | rechargeBean = new RechargeBean(); |
| | | rechargeBean.setUserName(userName); |
| | | rechargeBean.setSerial(userCardBean.getSerial()); |
| | | rechargeBean.setUserId(userCardBean.getUserID()); |
| | | rechargeBean.setDate(System.currentTimeMillis()); |
| | | rechargeBean.setMorny(morny); |
| | | rechargeBean.setBalance(MornyUtil.changeF2Y(balance)); |
| | | rechargeBean.setCardNumber(cardNumber); |
| | | try { |
| | | baseDao.rechargeDao().insert(rechargeBean); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 打印相关 |
| | | setPrinterData(rechargeBean); |
| | | startDetailActivity(userName, "终端写卡"); |
| | | } else { |
| | | TipUtil.show(NFCWreatActivity.this, "写卡失败,请重新再试"); |
| | | } |
| | | } else { |
| | | |
| | | TipUtil.show(NFCWreatActivity.this, "读取的卡和充值的卡不一致"); |
| | | } |
| | | } |
| | | |
| | |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH); // 月份从0开始,所以需要加1 |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | int hour = calendar.get(Calendar.HOUR_OF_DAY); |
| | | int minute = calendar.get(Calendar.MINUTE); |
| | | int second = calendar.get(Calendar.SECOND); |
| | | redCardBinding.redRechargeDate.setText("本卡最后购水日期:" + year + "年" + month + "月" + day + "日"); |
| | | } else { |
| | | redCardBinding.redRechargeDate.setText("本卡最后购水日期:无"); |
| | |
| | | cardType = cardType.split(",")[1]; |
| | | } |
| | | List<byte[]> data = NfcReadHelper.getInstence(intent, this).getOnesectorData(); |
| | | String state = ""; |
| | | if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_1)) { |
| | | state = "终端写卡"; |
| | | } else if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_2)) { |
| | | state = "刷卡开泵后"; |
| | | } else if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_3)) { |
| | | state = "叠加充值"; |
| | | } |
| | | switch (cardType) { |
| | | case CardCommon.USER_CARD_TYPE_1: |
| | | case CardCommon.USER_CARD_TYPE_2: |
| | | case CardCommon.USER_CARD_TYPE_3: |
| | | |
| | | if (!data.isEmpty()) { |
| | | if (!TextUtils.isEmpty(cardNumber)) { |
| | | userCard = UserCard.getBean(data); |
| | | List<UserCardBean> userCardBeans = baseDao.userCardDao().findUserName(cardNumber); |
| | | if (userCardBeans != null && !userCardBeans.isEmpty()) { |
| | | UserCardBean userName = userCardBeans.get(0); |
| | | setUserData(userName.getUserName(), "启用", cardNumber); |
| | | setUserData(userName.getUserName(), state, cardNumber); |
| | | } else { |
| | | setUserData("未查询到用户名", "启用", cardNumber); |
| | | setUserData("未查询到用户名", state, cardNumber); |
| | | } |
| | | } else { |
| | | |
| | |
| | | import android.text.TextUtils; |
| | | import android.text.TextWatcher; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.widget.EditText; |
| | | |
| | | import com.dayu.baselibrary.utils.MornyUtil; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.qihealonelibrary.card.UserCard; |
| | | import com.dayu.qihealonelibrary.databinding.ActivityRechargeQhaBinding; |
| | | import com.dayu.qihealonelibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qihealonelibrary.dbBean.UserCardBean; |
| | | import com.dayu.qihealonelibrary.tools.NfcReadHelper; |
| | | import com.dayu.qihealonelibrary.utils.CardCommon; |
| | | import com.dayu.qihealonelibrary.utils.DeviceNumberUtils; |
| | | import com.dayu.qihealonelibrary.view.ProgressDialog; |
| | | import com.tencent.bugly.crashreport.CrashReport; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | AdminDataBean adminData; |
| | | String userName; |
| | | String cardNumber = null; |
| | | UserCardBean userCardBean; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | |
| | | } |
| | | |
| | | public void onNewIntent(Intent intent) { |
| | | |
| | | this.intent = intent; |
| | | try { |
| | | this.intent = intent; |
| | | userCard = NfcReadHelper.getInstence(intent, this).getUserCardData(); |
| | | if (userCard != null) { |
| | | ProgressDialog.show(this); |
| | | // selectBalance(userCard.getInitPeasantCode()); |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "卡片读取失败"); |
| | | } |
| | | |
| | | // readAllData(intent); |
| | | readAllData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | CrashReport.postCatchedException(e); |
| | | } |
| | | super.onNewIntent(intent); |
| | | } |
| | | |
| | | |
| | | private void readAllData() { |
| | | String cardType = NfcReadHelper.getInstence(intent, this).getCradTypeAndCardNumber(); |
| | | |
| | | String[] cardTypes = cardType.split(","); |
| | | if (cardTypes != null && cardTypes.length == 2) { |
| | | cardNumber = cardType.split(",")[0]; |
| | | cardType = cardType.split(",")[1]; |
| | | } |
| | | List<byte[]> data = NfcReadHelper.getInstence(intent, this).getOnesectorData(); |
| | | |
| | | if (!data.isEmpty()) { |
| | | if (!TextUtils.isEmpty(cardNumber)) { |
| | | setUserData(cardType, cardNumber, data); |
| | | } else { |
| | | TipUtil.show(this, "读取卡片失败,请重新贴卡"); |
| | | } |
| | | } else { |
| | | TipUtil.show(this, "卡片识别错误,请重试!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void setUserData(String cardType, String cardNumber, List<byte[]> data) { |
| | | |
| | | |
| | | String state = ""; |
| | | if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_1)) { |
| | | state = "终端写卡"; |
| | | } else if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_2)) { |
| | | state = "刷卡开泵后,当前状态不能充值"; |
| | | binding.rechargeLL.setVisibility(View.GONE); |
| | | } else if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_3)) { |
| | | state = "叠加充值"; |
| | | binding.rechargeLL.setVisibility(View.GONE); |
| | | } else { |
| | | TipUtil.show(this, "非用户卡,不能充值"); |
| | | return; |
| | | } |
| | | 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()))) { |
| | | 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, "不是本区域卡"); |
| | | } |
| | | }else { |
| | | TipUtil.show(this, "未查询到该卡用户信息"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | private void initView() { |
| | | try { |
| | |
| | | binding.rechargeRegistBtn.setOnClickListener(v -> { |
| | | String morny = binding.rechargeWater.getText().toString(); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | String initCode = DeviceNumberUtils.getDeviceNumber(); |
| | | if (TextUtils.isEmpty(initCode)) { |
| | | TipUtil.show(RechargeActivity.this, "设备注册号为空,请先设置IP和管理员地址"); |
| | | return; |
| | | } |
| | | Intent intent = new Intent(RechargeActivity.this, NFCWreatActivity.class); |
| | | //当前金额单位为元 |
| | | intent.putExtra("morny", morny); |
| | | intent.putExtra("userName", userName); |
| | | intent.putExtra("cardNumber", cardNumber); |
| | | intent.putExtra("userCard", userCard); |
| | | intent.putExtra("userCardBean", userCardBean); |
| | | startActivity(intent); |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "请输入充值金额(元)"); |
| | |
| | | int balance = userCard.getBalance(); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | binding.tip.setText("充值成功!"); |
| | | balance = userCard.getBalance() + MornyUtil.changeY2F(morny); |
| | | balance = userCard.getBalance() ; |
| | | binding.redRemainderMorny.setText("充值金额:" + morny + " 元"); |
| | | } else { |
| | | binding.tip.setText("开卡成功!"); |
| | |
| | | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { |
| | | if (holder instanceof ViewHolder) { |
| | | if (rechargeList.size() > 0) { |
| | | ((ViewHolder) holder).getBinding().userName.setText("用户名:" + rechargeList.get(position).getUserName()); |
| | | ((ViewHolder) holder).getBinding().userNo.setText("用户编号:" + rechargeList.get(position).getInitPeasantCode()); |
| | | ((ViewHolder) holder).getBinding().userName.setText("姓名:" + rechargeList.get(position).getUserName()); |
| | | ((ViewHolder) holder).getBinding().userNo.setText("卡号:" + rechargeList.get(position).getCardNumber()); |
| | | ((ViewHolder) holder).getBinding().morny.setText("充值金额:" + rechargeList.get(position).getMorny()); |
| | | ((ViewHolder) holder).getBinding().date.setText("日期:" + DateUtil.dateToStamp(rechargeList.get(position).getDate(), DateUtil.type1)); |
| | | } |
| | |
| | | |
| | | public String cardType = CardCommon.REGION;//卡命令 |
| | | |
| | | public short region;//区域地址(低前高后) 可以识别某县镇村 |
| | | public int region;//区域地址(低前高后) 可以识别某县镇村 |
| | | |
| | | public short controllerCodel;// 控制器编号(低前高后) 本区域内控制器编号 |
| | | public int controllerCodel;// 控制器编号(低前高后) 本区域内控制器编号 |
| | | |
| | | |
| | | public short getRegion() { |
| | | public int getRegion() { |
| | | return region; |
| | | } |
| | | |
| | | public short getControllerCodel() { |
| | | public void setRegion(int region) { |
| | | this.region = region; |
| | | } |
| | | |
| | | public int getControllerCodel() { |
| | | return controllerCodel; |
| | | } |
| | | |
| | | public void setControllerCodel(int controllerCodel) { |
| | | this.controllerCodel = controllerCodel; |
| | | } |
| | | |
| | | public byte[] toByte() { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public static RegionCard getBean(List<byte[]> data){ |
| | | RegionCard regionCard=new RegionCard(); |
| | | byte[] zero=data.get(0); |
| | | regionCard.cardType= HexUtil.byteToHex(zero[0]); |
| | | public static RegionCard getBean(List<byte[]> data) { |
| | | RegionCard regionCard = new RegionCard(); |
| | | byte[] zero = data.get(0); |
| | | regionCard.cardType = HexUtil.byteToHex(zero[0]); |
| | | |
| | | byte[] regionByte = new byte[2]; |
| | | System.arraycopy(zero, 1, regionByte, 0, regionByte.length); |
| | | regionCard.region = (short) HexUtil.get16to10LowHigh(HexUtil.bytesToHex(regionByte)); |
| | | regionCard.region = HexUtil.get16To10LowHightByBytes(regionByte); |
| | | |
| | | |
| | | byte[] controllerCodelByte = new byte[2]; |
| | | System.arraycopy(zero, 3, controllerCodelByte, 0, controllerCodelByte.length); |
| | | regionCard.controllerCodel = (short) HexUtil.get16to10LowHigh(HexUtil.bytesToHex(controllerCodelByte)); |
| | | regionCard.controllerCodel = HexUtil.get16To10LowHightByBytes(controllerCodelByte); |
| | | |
| | | |
| | | return regionCard; |
| | |
| | | /** |
| | | * 第1扇区0块 存储的数据 |
| | | */ |
| | | public class Zero { |
| | | public class Zero { |
| | | public byte[] toByte() { |
| | | byte[] data = new byte[16]; |
| | | data[0] = HexUtil.hexToByte(cardType); |
| | |
| | | public int arerNumber;//区域号(底位在前高位在后) |
| | | |
| | | public int deviceNumberl;//设备编号(底位在前高位在后) |
| | | public byte rechargeTimes;//充值次数 |
| | | public short rechargeTimes;//充值次数 |
| | | |
| | | public int totalWater;//用户总用水量 底位在前,高位在后2位小数点 含两个小数点的整数 |
| | | |
| | | public int totalElectric;//总用电量位 底位在前,高位在后 1位小数点 含1位小数点的整数 |
| | | |
| | | public int balance;//剩余金额 底位在前 2位小数点,单位元 |
| | | public int balance;//剩余金额 底位在前 2位小数点,单位分 |
| | | |
| | | public int surplusWater;//剩余水量 底位在前 2位小数点 单位立方米 |
| | | |
| | |
| | | |
| | | byte[] arerNumberByte = new byte[2]; |
| | | System.arraycopy(zero, 1, arerNumberByte, 0, arerNumberByte.length); |
| | | userCard.arerNumber = HexUtil.get16to10LowHigh(HexUtil.bytesToHex(arerNumberByte)); |
| | | userCard.arerNumber = HexUtil.get16To10LowHightByBytes(arerNumberByte); |
| | | |
| | | byte[] deviceNumberlByte = new byte[2]; |
| | | System.arraycopy(zero, 3, deviceNumberlByte, 0, deviceNumberlByte.length); |
| | | userCard.deviceNumberl = HexUtil.get16to10LowHigh(HexUtil.bytesToHex(deviceNumberlByte)); |
| | | userCard.deviceNumberl = HexUtil.get16To10LowHightByBytes(deviceNumberlByte); |
| | | |
| | | userCard.rechargeTimes = HexUtil.hexToByte(HexUtil.byteToHex(zero[5])); |
| | | |
| | | byte[] totalWaterByte = new byte[4]; |
| | | System.arraycopy(zero, 3, totalWaterByte, 0, totalWaterByte.length); |
| | | userCard.totalWater = HexUtil.get16to10LowHigh(HexUtil.bytesToHex(totalWaterByte)); |
| | | System.arraycopy(zero, 6, totalWaterByte, 0, totalWaterByte.length); |
| | | userCard.totalWater = HexUtil.get16To10LowHightByBytes(totalWaterByte); |
| | | |
| | | byte[] totalElectricByte = new byte[4]; |
| | | System.arraycopy(zero, 3, totalElectricByte, 0, totalElectricByte.length); |
| | | userCard.totalElectric = HexUtil.get16to10LowHigh(HexUtil.bytesToHex(totalElectricByte)); |
| | | System.arraycopy(zero, 10, totalElectricByte, 0, totalElectricByte.length); |
| | | userCard.totalElectric = HexUtil.get16To10LowHightByBytes(totalElectricByte); |
| | | |
| | | //第1块解析 |
| | | byte[] one = data.get(1); |
| | | |
| | | byte[] balanceByte = new byte[4]; |
| | | System.arraycopy(one, 0, balanceByte, 0, balanceByte.length); |
| | | userCard.balance = HexUtil.get16to10LowHigh(HexUtil.bytesToHex(balanceByte)); |
| | | userCard.balance =HexUtil.get16To10LowHightByBytes(balanceByte); |
| | | |
| | | byte[] surplusWaterByte = new byte[4]; |
| | | System.arraycopy(one, 4, surplusWaterByte, 0, surplusWaterByte.length); |
| | | userCard.surplusWater = HexUtil.get16to10LowHigh(HexUtil.bytesToHex(surplusWaterByte)); |
| | | userCard.surplusWater = HexUtil.get16To10LowHightByBytes(surplusWaterByte); |
| | | |
| | | byte[] rechargeDateByte = new byte[3]; |
| | | System.arraycopy(one, 12, rechargeDateByte, 0, rechargeDateByte.length); |
| | |
| | | try { |
| | | byte[] data = new byte[16]; |
| | | data[0] = HexUtil.hexToByte(cardType); |
| | | byte[] arerNumberBytes = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(arerNumber)); |
| | | //区域号 |
| | | byte[] arerNumberBytes = new byte[2]; |
| | | byte[] arerNumberDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(arerNumber)); |
| | | System.arraycopy(arerNumberDatas, 0, arerNumberBytes, 0, arerNumberDatas.length); |
| | | if (arerNumberBytes != null) { |
| | | System.arraycopy(arerNumberBytes, 0, data, 1, arerNumberBytes.length); |
| | | } |
| | | byte[] deviceNumberlBytes = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(deviceNumberl)); |
| | | //设备编号 |
| | | byte[] deviceNumberlBytes = new byte[2]; |
| | | byte[] deviceNumberlDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(deviceNumberl)); |
| | | System.arraycopy(deviceNumberlDatas, 0, deviceNumberlBytes, 0, deviceNumberlDatas.length); |
| | | if (deviceNumberlBytes != null) { |
| | | System.arraycopy(deviceNumberlBytes, 0, data, 3, deviceNumberlBytes.length); |
| | | } |
| | | //充值次数 |
| | | byte rechargeTimesByte = HexUtil.hexToByte(HexUtil.get10to16(rechargeTimes)); |
| | | data[5] = rechargeTimesByte; |
| | | byte[] totalWaterBytes = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(totalWater)); |
| | | |
| | | //用户总用水量 |
| | | byte[] totalWaterBytes = new byte[4]; |
| | | byte[] totalWaterDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(totalWater)); |
| | | System.arraycopy(totalWaterDatas, 0, totalWaterBytes, 0, totalWaterDatas.length); |
| | | if (totalWaterBytes != null) { |
| | | System.arraycopy(totalWaterBytes, 0, data, 6, totalWaterBytes.length); |
| | | } |
| | | byte[] totalElectricBytes = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(totalElectric)); |
| | | //总用电量位 |
| | | byte[] totalElectricBytes = new byte[4]; |
| | | byte[] totalElectricDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(totalElectric)); |
| | | System.arraycopy(totalElectricDatas, 0, totalElectricBytes, 0, totalElectricDatas.length); |
| | | if (totalElectricBytes != null) { |
| | | System.arraycopy(totalElectricBytes, 0, data, 10, totalElectricBytes.length); |
| | | } |
| | |
| | | |
| | | |
| | | try { |
| | | byte[] balanceBytes = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(balance)); |
| | | byte[] balanceBytes = new byte[4]; |
| | | byte[] balanceDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(balance)); |
| | | System.arraycopy(balanceDatas, 0, balanceBytes, 0, balanceDatas.length); |
| | | if (balanceBytes != null) { |
| | | System.arraycopy(balanceBytes, 0, data, 0, balanceBytes.length); |
| | | } |
| | | |
| | | byte[] surplusWaterBytes = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(surplusWater)); |
| | | byte[] surplusWaterBytes = new byte[4]; |
| | | byte[] surplusWaterDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(surplusWater)); |
| | | System.arraycopy(surplusWaterDatas, 0, surplusWaterBytes, 0, surplusWaterDatas.length); |
| | | if (surplusWaterBytes != null) { |
| | | System.arraycopy(surplusWaterBytes, 0, data, 0, surplusWaterBytes.length); |
| | | System.arraycopy(surplusWaterBytes, 0, data, 4, surplusWaterBytes.length); |
| | | } |
| | | |
| | | |
| | | if (rechargeDate != null) { |
| | | // 获取年、月、日、时、分、秒 |
| | |
| | | byte[] data = new byte[16]; |
| | | |
| | | try { |
| | | byte[] balanceBytes = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(balance)); |
| | | byte[] balanceBytes = new byte[4]; |
| | | byte[] balanceDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(balance)); |
| | | System.arraycopy(balanceDatas, 0, balanceBytes, 0, balanceDatas.length); |
| | | if (balanceBytes != null) { |
| | | System.arraycopy(balanceBytes, 0, data, 0, balanceBytes.length); |
| | | } |
| | | |
| | | byte[] surplusWaterBytes = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(surplusWater)); |
| | | byte[] surplusWaterBytes = new byte[4]; |
| | | byte[] surplusWaterDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(surplusWater)); |
| | | System.arraycopy(surplusWaterDatas, 0, surplusWaterBytes, 0, surplusWaterDatas.length); |
| | | if (surplusWaterBytes != null) { |
| | | System.arraycopy(surplusWaterBytes, 0, data, 0, surplusWaterBytes.length); |
| | | System.arraycopy(surplusWaterBytes, 0, data, 4, surplusWaterBytes.length); |
| | | } |
| | | |
| | | if (rechargeDate != null) { |
| | |
| | | this.deviceNumberl = deviceNumberl; |
| | | } |
| | | |
| | | public byte getRechargeTimes() { |
| | | public short getRechargeTimes() { |
| | | return rechargeTimes; |
| | | } |
| | | |
| | | public void setRechargeTimes(byte rechargeTimes) { |
| | | public void setRechargeTimes(short rechargeTimes) { |
| | | this.rechargeTimes = rechargeTimes; |
| | | } |
| | | |
| | |
| | | @Query("select COUNT(*) from UserCardBean") |
| | | int getUserTotale(); |
| | | |
| | | @Query("select * from UserCardBean where cardNumber =:data") |
| | | @Query("select * from UserCardBean where cardNumber =:data order by date desc") |
| | | List<UserCardBean> findUserName(String data); |
| | | } |
| | |
| | | public String userName; |
| | | public String userId;//用户身份证号 |
| | | public long date; |
| | | public String morny;//充值金额 |
| | | public String balance;//余额 |
| | | public String morny;//充值金额 单位元 |
| | | public String balance;//余额 单位元 |
| | | public String total_morn;//总充值金额 |
| | | //状态 0未上传 1成功上传 |
| | | public String orderID;//订单号 |
| | | //服务器返回的农户注册编号 |
| | | private String initPeasantCode; |
| | | |
| | | public int state = 0; |
| | | |
| | | public String getOrderID() { |
| | | return orderID; |
| | | public String cardNumber;//卡号 |
| | | |
| | | |
| | | public String getCardNumber() { |
| | | return cardNumber; |
| | | } |
| | | |
| | | public void setOrderID(String orderID) { |
| | | this.orderID = orderID; |
| | | } |
| | | |
| | | public String getInitPeasantCode() { |
| | | return initPeasantCode; |
| | | } |
| | | |
| | | public void setInitPeasantCode(String initPeasantCode) { |
| | | this.initPeasantCode = initPeasantCode; |
| | | public void setCardNumber(String cardNumber) { |
| | | this.cardNumber = cardNumber; |
| | | } |
| | | |
| | | public String getTotal_morn() { |
| | |
| | | RechargeBean projectBean = (RechargeBean) objList.get(j); |
| | | list.add(projectBean.getSerial()); |
| | | list.add(projectBean.getUserName()); |
| | | list.add(projectBean.getOrderID()); |
| | | list.add(projectBean.getCardNumber()); |
| | | list.add(DateUtil.dateToStamp(projectBean.getDate(), DateUtil.type2)); |
| | | list.add(projectBean.getMorny()); |
| | | list.add(projectBean.getBalance()); |
| | |
| | | list.add(userCardBean.getSerial()); |
| | | list.add(userCardBean.getUserName()); |
| | | list.add(userCardBean.getUserID()); |
| | | list.add(userCardBean.getCardNumber()); |
| | | list.add(DateUtil.dateToStamp(userCardBean.getDate(), DateUtil.type2)); |
| | | list.add(userCardBean.getPhone()); |
| | | } |
| | |
| | | <LinearLayout |
| | | style="@style/newCardLL" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | android:layout_height="wrap_content" |
| | | android:visibility="gone"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/my_village" |
| | | android:visibility="gone" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal"> |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="用户姓名:" |
| | | android:text="姓名:" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <TextView |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="用户注册编号:" |
| | | android:text="卡号:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | <TextView |
| | | android:id="@+id/red_remainder_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="剩余水量:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeDate" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="最后购水日期:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeNumber" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="充值次数:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_power" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用电量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@id/titleBar" |
| | | android:visibility="visible"> |
| | | android:visibility="gone"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="用户姓名:" |
| | | android:text="姓名:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <LinearLayout |
| | |
| | | android:layout_below="@id/titleBar" |
| | | android:background="#ffffff" |
| | | android:orientation="vertical" |
| | | android:visibility="gone"> |
| | | android:visibility="visible"> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |