| | |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityRechargeDetailQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.dbBean.RechargeBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.UserCardBean; |
| | | import com.dayu.qiheonlinelibrary.utils.PrintUtils; |
| | | |
| | | |
| | | import java.util.Calendar; |
| | |
| | | setContentView(binding.getRoot()); |
| | | |
| | | try { |
| | | userCard = (UserCard) getIntent().getSerializableExtra("userCard"); |
| | | statu = getIntent().getStringExtra("statu"); |
| | | if (getIntent().hasExtra("morny")) { |
| | | morny = getIntent().getStringExtra("morny"); |
| | | if (getIntent().hasExtra("userCard")) { |
| | | userCard = (UserCard) getIntent().getSerializableExtra("userCard"); |
| | | } |
| | | if (getIntent().hasExtra("statu")) { |
| | | statu = getIntent().getStringExtra("statu"); |
| | | } |
| | | if (getIntent().hasExtra("rechargeBean")) { |
| | | rechargeBean = (RechargeBean) getIntent().getSerializableExtra("rechargeBean"); |
| | | } |
| | | if (getIntent().hasExtra("userCardBean")) { |
| | |
| | | } |
| | | |
| | | private void setUserData(String statu) { |
| | | int balance = userCard.getBalance(); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | |
| | | if (rechargeBean != null) { |
| | | binding.tip.setText("充值成功!"); |
| | | balance = userCard.getBalance(); |
| | | binding.redName.setText("姓名:" + rechargeBean.getUserName()); |
| | | binding.redRemainderMorny.setText("充值金额:" + morny + " 元"); |
| | | binding.redRechargeBalance.setText("剩余金额:" + MornyUtil.changeF2Y(balance) + " 元"); |
| | | binding.redRemainderMorny.setText("充值金额:" + rechargeBean.getMorny() + " 元"); |
| | | binding.redRechargeBalance.setText("剩余金额:" + rechargeBean.getBalance() + " 元"); |
| | | binding.redRechargeElectric.setText("充值电量:" + rechargeBean.getRechargeElectric() + " 度"); |
| | | binding.redSurplusElectric.setText("剩余电量:" + rechargeBean.getSurplusElectic() + " 度"); |
| | | binding.redInitCode.setText("卡号:" + rechargeBean.getCardNumber()); |
| | | binding.redUserCode.setText("用户编号:" + rechargeBean.getUserCode()); |
| | | if (MornyUtil.changeY2F(rechargeBean.getDeductionMorny()) > 0) { |
| | | binding.redDeductionMorny.setText("补扣金额:" + rechargeBean.getDeductionMorny()); |
| | | } else { |
| | | binding.redDeductionMorny.setVisibility(View.GONE); |
| | | } |
| | | binding.readBtn.setVisibility(View.VISIBLE); |
| | | binding.readBtn.setOnClickListener(v -> { |
| | | PrintUtils.printerData(rechargeBean); |
| | | }); |
| | | } else { |
| | | int balance = userCard.getBalance(); |
| | | binding.redName.setText("姓名:" + userCardBean.getUserName()); |
| | | binding.tip.setText("开卡成功!"); |
| | | binding.redInitCode.setText("卡号:" + userCardBean.getCardNumber()); |
| | |
| | | binding.redRechargeBalance.setVisibility(View.GONE); |
| | | binding.redRechargeElectric.setVisibility(View.GONE); |
| | | binding.redSurplusElectric.setVisibility(View.GONE); |
| | | binding.redDeductionMorny.setVisibility(View.GONE); |
| | | } |
| | | binding.redStatu.setText("卡状态:" + statu); |
| | | if (TextUtils.isEmpty(statu)) { |
| | | binding.redStatu.setVisibility(View.GONE); |
| | | } else { |
| | | binding.redStatu.setText("卡状态:" + statu); |
| | | } |
| | | if (userCard != null) { |
| | | Calendar calendar = userCard.getRechargeDate(); |
| | | if (calendar != null) { |