左晓为主开发手持机充值管理机
zuoxiao
2024-08-12 2b11b80884fbdbc05bd8f8a76515616306a03a0a
qiheonlinelibrary/src/main/java/com/dayu/qiheonlinelibrary/activity/CardSearchActivity.java
@@ -48,6 +48,7 @@
    List<CardInfoListResult.Records> records = new ArrayList<>();
    int type;
    ConfirmDialog confirmDialog;
    CardInfoListResult.Records mRecord;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
@@ -75,6 +76,7 @@
        adapter = new CardAdapter(this, records, new CardAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(int position) {
                mRecord = records.get(position);
                String title;
                if (type == BaseCommon.LOSS_CARD) {
                    title = "挂失卡片";
@@ -86,14 +88,21 @@
                String data = "卡号:" + records.get(position).getIccardNum();
                confirmDialog = new ConfirmDialog(CardSearchActivity.this, title, data, v -> {
                    String iccardInfoId = records.get(position).getIccardInfoId();
                    String iccardInfoId = mRecord.getIccardInfoId();
                    if (type == BaseCommon.LOSS_CARD) {
                        lossCard(iccardInfoId);
                    } else if (type == BaseCommon.REPORT_LOSS_CARD) {
                        reportLossCard(iccardInfoId);
                    } else if (type == BaseCommon.REPLACE_HAS_CARD) {
                    } else if (type == BaseCommon.REPLACE_NO_CARD) {
                    } else if (type == BaseCommon.REPLACE_HAS_CARD) {//未关泵补卡
                        //补卡前需要先挂失
                        if (mRecord.getIccardStatus() == 0) {
                            lossCard(iccardInfoId);
                        } else if (mRecord.getIccardStatus() == 2) {
                            startManagerActivity(iccardInfoId, mRecord.getIccardNum());
                        } else {
                            TipUtil.show("当前卡状态不能再补卡");
                        }
                    } else if (type == BaseCommon.REPLACE_NO_CARD) {//已关泵补卡
                        //补卡前需要先挂失
                        if (records.get(position).getIccardStatus() == 0) {
                            lossCard(iccardInfoId);
@@ -102,14 +111,10 @@
                        } else {
                            TipUtil.show("当前卡状态不能再补卡");
                        }
                    }
                    confirmDialog.dismiss();
                });
                confirmDialog.show();
            }
        });
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
@@ -213,4 +218,13 @@
        startActivity(intent);
        CardSearchActivity.this.finish();
    }
    private void startManagerActivity(String iccardInfoId, String oldCardNumber) {
        Intent intent = new Intent(CardSearchActivity.this, ManagerReadActivity.class);
        intent.putExtra("iccardInfoId", iccardInfoId);
        intent.putExtra("replaceType", type);
        intent.putExtra("oldCardNumber", oldCardNumber);
        startActivity(intent);
        CardSearchActivity.this.finish();
    }
}