| | |
| | | return new PageResult<>(records, safePage, safeSize, total == null ? 0 : total); |
| | | } |
| | | |
| | | /** |
| | | * 票包核销记录:只列已核销(status = USED)的领取记录,供后台「电影票管理 → 核销记录」查询与导出。 |
| | | * |
| | | * <p>「核销商家」取领取记录上的 merchant_id。核销接口要求核销方必须等于该商户,所以这里不需要 |
| | | * 再关联 benefit_verify_record 才能知道是谁核销的。 |
| | | */ |
| | | @Transactional(readOnly = true) |
| | | public PageResult<Map<String, Object>> verifications(Long packageId, String talentKeyword, String cardLevel, |
| | | LocalDate claimedStart, LocalDate claimedEnd, |
| | | LocalDate verifiedStart, LocalDate verifiedEnd, |
| | | String merchantKeyword, int page, int size) { |
| | | int safePage = Math.max(page, 1); |
| | | int safeSize = Math.min(Math.max(size, 1), 100); |
| | | Long total = claimMapper.countAdminVerificationPage(packageId, clean(talentKeyword), clean(cardLevel), |
| | | claimedStart, claimedEnd, verifiedStart, verifiedEnd, clean(merchantKeyword)); |
| | | List<Map<String, Object>> records = claimMapper.selectAdminVerificationPage(packageId, clean(talentKeyword), |
| | | clean(cardLevel), claimedStart, claimedEnd, verifiedStart, verifiedEnd, clean(merchantKeyword), |
| | | safeSize, (safePage - 1) * safeSize) |
| | | .stream() |
| | | .map(this::verificationView) |
| | | .toList(); |
| | | return new PageResult<>(records, safePage, safeSize, total == null ? 0 : total); |
| | | } |
| | | |
| | | private Map<String, Object> verificationView(Map<String, Object> row) { |
| | | Map<String, Object> result = new LinkedHashMap<>(); |
| | | result.put("id", value(row, "id")); |
| | | result.put("claimNo", text(row, "claimNo", "claim_no")); |
| | | result.put("packageId", value(row, "packageId", "package_id")); |
| | | result.put("packageName", text(row, "packageName", "package_name")); |
| | | result.put("merchantNames", text(row, "merchantNames", "merchant_names")); |
| | | result.put("talentName", text(row, "talentName", "talent_name")); |
| | | result.put("talentMobile", text(row, "talentMobile", "talent_mobile")); |
| | | result.put("cardLevel", text(row, "cardLevel", "card_level")); |
| | | result.put("claimedAt", value(row, "createdAt", "created_at")); |
| | | result.put("usedAt", value(row, "usedAt", "used_at")); |
| | | result.put("verifyMerchantName", text(row, "verifyMerchantName", "verify_merchant_name")); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @Transactional(readOnly = true) |
| | | public Map<String, Object> codeDetail(Long codeId) { |