shinnosuke
2026-08-06 4aeb8bbb12ceb9090f070fbfab8da2b9730d377d
fix(admin): 支持完整展示银行卡号 (bug #24230)
1个文件已添加
2个文件已修改
12 ■■■■■ 已修改文件
talent-card-server/src/main/java/com/talentcard/server/business/admin/MerchantSettlementAdminService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/merchant/MerchantSettlementService.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/resources/db/migration/V104__merchant_bank_card_encrypted_number.sql 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/admin/MerchantSettlementAdminService.java
@@ -40,7 +40,11 @@
    @Transactional(readOnly = true)
    public PageResult<Map<String, Object>> bankCards(int page, int size, String merchantName, String contactMobile, String merchantType, String status, String startDate, String endDate) {
        PageResult<Map<String, Object>> result = page("select c.*, m.merchant_name, m.merchant_type, m.contact_mobile, s.store_name from merchant_bank_card c join merchant m on m.id = c.merchant_id join merchant_store s on s.id = c.store_id", "select count(*) from merchant_bank_card c join merchant m on m.id = c.merchant_id join merchant_store s on s.id = c.store_id", "c", page, size, merchantName, contactMobile, merchantType, status, startDate, endDate);
        result.records().forEach(row -> row.put("cityName", bankCardCityName(row.get("cityCode"))));
        result.records().forEach(row -> {
            String encrypted = String.valueOf(row.remove("cardNoEncrypted"));
            if (!encrypted.isBlank() && !"null".equals(encrypted)) row.put("cardMasked", sensitiveDataCrypto.decrypt(encrypted));
            row.put("cityName", bankCardCityName(row.get("cityCode")));
        });
        return result;
    }
    @Transactional(readOnly = true)
talent-card-server/src/main/java/com/talentcard/server/business/merchant/MerchantSettlementService.java
@@ -122,11 +122,11 @@
        if (!same.isEmpty()) {
            Map<String, Object> existing = same.get(0);
            if (!"rejected".equals(clean(existing.get("status")))) return bankCard(existing);
            jdbc.update("update merchant_bank_card set status='pending', reject_reason=null, provider_token_no=null, provider_apply_no=null, provider_request_no=null, provider_response_code=null, provider_response_message=null where id=?", existing.get("id"));
            jdbc.update("update merchant_bank_card set status='pending', card_no_encrypted=?, reject_reason=null, provider_token_no=null, provider_apply_no=null, provider_request_no=null, provider_response_code=null, provider_response_message=null where id=?", sensitiveDataCrypto.encrypt(number), existing.get("id"));
            submitBankCardToHuifu(principal, existing, number, branch);
            return bankCard(rows("select * from merchant_bank_card where id = ?", existing.get("id")).get(0));
        }
        jdbc.update("insert into merchant_bank_card(merchant_id, store_id, bank_name, branch_name, branch_code, city_code, card_tail, card_masked, card_hash, idempotency_key) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", principal.merchantId(), principal.storeId(), clean(branch.get("bankName")), clean(branch.get("branchName")), clean(branch.get("clearingCode")), request.cityCode().trim(), number.substring(number.length() - 4), "**** **** **** " + number.substring(number.length() - 4), hash, key.trim());
        jdbc.update("insert into merchant_bank_card(merchant_id, store_id, bank_name, branch_name, branch_code, city_code, card_tail, card_masked, card_hash, card_no_encrypted, idempotency_key) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", principal.merchantId(), principal.storeId(), clean(branch.get("bankName")), clean(branch.get("branchName")), clean(branch.get("clearingCode")), request.cityCode().trim(), number.substring(number.length() - 4), "**** **** **** " + number.substring(number.length() - 4), hash, sensitiveDataCrypto.encrypt(number), key.trim());
        Map<String, Object> card = rows("select * from merchant_bank_card where merchant_id = ? and card_hash = ?", principal.merchantId(), hash).get(0);
        submitBankCardToHuifu(principal, card, number, branch);
        return bankCard(rows("select * from merchant_bank_card where id = ?", card.get("id")).get(0));
talent-card-server/src/main/resources/db/migration/V104__merchant_bank_card_encrypted_number.sql
New file
@@ -0,0 +1,2 @@
alter table merchant_bank_card
    add column card_no_encrypted varchar(1024) default null after card_hash;