| | |
| | | List<Map<String, Object>> rows = rows("select a.*, m.merchant_name, m.merchant_type, m.contact_mobile, s.store_name from merchant_onboarding_application a join merchant m on m.id = a.merchant_id join merchant_store s on s.id = a.store_id where a.id = ?", id); |
| | | if (rows.isEmpty()) throw new BusinessException(ErrorCode.NOT_FOUND, "商户进件不存在"); |
| | | Map<String, Object> result = rows.get(0); |
| | | if ("individual".equalsIgnoreCase(String.valueOf(result.get("subjectType")))) { |
| | | String encrypted = String.valueOf(result.get("subjectIdNoEncrypted")); |
| | | if (!encrypted.isBlank() && !"null".equals(encrypted)) result.put("subjectIdNo", sensitiveDataCrypto.decrypt(encrypted)); |
| | | } |
| | | // 个人主体的历史记录可能使用 individual、personal 或中文类型值; |
| | | // 只要已保存加密身份证号,后台详情均应解密后完整展示。 |
| | | String encrypted = String.valueOf(result.get("subjectIdNoEncrypted")); |
| | | if (!encrypted.isBlank() && !"null".equals(encrypted)) result.put("subjectIdNo", sensitiveDataCrypto.decrypt(encrypted)); |
| | | return result; |
| | | } |
| | | @Transactional(readOnly = true) |
| | |
| | | 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 -> { |
| | | String encrypted = String.valueOf(row.remove("cardNoEncrypted")); |
| | | if (!encrypted.isBlank() && !"null".equals(encrypted)) row.put("cardMasked", sensitiveDataCrypto.decrypt(encrypted)); |
| | | if (!encrypted.isBlank() && !"null".equals(encrypted)) row.put("cardNo", sensitiveDataCrypto.decrypt(encrypted)); |
| | | else row.put("cardNo", row.get("cardMasked")); |
| | | row.put("cityName", bankCardCityName(row.get("cityCode"))); |
| | | }); |
| | | return result; |