| | |
| | | @GetMapping("/merchant-settlement/onboardings/{id}/payment-capability") public ApiResponse<Map<String,Object>> paymentCapability(@PathVariable Long id) { return ApiResponse.success(settlementService.paymentCapability(id)); } |
| | | @PostMapping("/merchant-settlement/onboardings/{id}/payment-capability/refresh") public ApiResponse<Map<String,Object>> refreshPaymentCapability(@PathVariable Long id) { return ApiResponse.success(settlementService.refreshPaymentCapability(id)); } |
| | | @GetMapping("/merchant-settlement/bank-cards") public ApiResponse<com.talentcard.server.business.PageResult<Map<String,Object>>> bankCards(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "20") int size, @RequestParam(required = false) String merchantName, @RequestParam(required = false) String contactMobile, @RequestParam(required = false) String merchantType, @RequestParam(required = false) String status, @RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) { return ApiResponse.success(settlementService.bankCards(page, size, merchantName, contactMobile, merchantType, status, startDate, endDate)); } |
| | | @GetMapping("/merchant-settlement/withdrawals") public ApiResponse<com.talentcard.server.business.PageResult<Map<String,Object>>> withdrawals(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "20") int size, @RequestParam(required = false) String merchantName, @RequestParam(required = false) String contactMobile, @RequestParam(required = false) String merchantType, @RequestParam(required = false) String status, @RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) { return ApiResponse.success(settlementService.withdrawals(page, size, merchantName, contactMobile, merchantType, status, startDate, endDate)); } |
| | | /** |
| | | * 按业务日补跑一次自动提现汇总(运维排查与验收用)。日期格式 yyyyMMdd,必须显式传。 |
| | | * 结算记录:向斗拱查询指定区间的真实结算流水,用于监控每天自动结算了多少到银行卡。 |
| | | * 日期格式 yyyyMMdd,默认最近 30 天。 |
| | | */ |
| | | @PostMapping("/merchant-settlement/auto-withdrawal/run") public ApiResponse<Map<String,Object>> runAutoWithdrawalAggregation(@RequestParam String businessDate) { return ApiResponse.success(settlementService.runAutoWithdrawalAggregation(parseBusinessDate(businessDate))); } |
| | | |
| | | private static java.time.LocalDate parseBusinessDate(String businessDate) { |
| | | if (businessDate == null || businessDate.isBlank()) throw new com.talentcard.server.common.BusinessException(com.talentcard.server.common.ErrorCode.BAD_REQUEST, "请指定业务日 businessDate(yyyyMMdd)"); |
| | | try { |
| | | return java.time.LocalDate.parse(businessDate.trim(), java.time.format.DateTimeFormatter.BASIC_ISO_DATE); |
| | | } catch (java.time.format.DateTimeParseException exception) { |
| | | throw new com.talentcard.server.common.BusinessException(com.talentcard.server.common.ErrorCode.BAD_REQUEST, "业务日格式应为 yyyyMMdd"); |
| | | } |
| | | @GetMapping("/merchant-settlement/settlements") public ApiResponse<Map<String,Object>> settlements(@RequestParam(required = false) String beginDate, @RequestParam(required = false) String endDate, @RequestParam(defaultValue = "100") int size) { |
| | | java.time.LocalDate today = java.time.LocalDate.now(); |
| | | String end = (endDate == null || endDate.isBlank()) ? today.format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE) : endDate.trim(); |
| | | String begin = (beginDate == null || beginDate.isBlank()) ? today.minusDays(30).format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE) : beginDate.trim(); |
| | | return ApiResponse.success(settlementService.settlements(begin, end, size)); |
| | | } |
| | | @GetMapping("/payment-reconciliation/issues") public ApiResponse<com.talentcard.server.business.PageResult<Map<String,Object>>> reconciliationIssues(@RequestParam(defaultValue = "open") String status, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "20") int size) { return ApiResponse.success(reconciliationService.issues(status, page, size)); } |
| | | @PatchMapping("/payment-reconciliation/issues/{id}") public ApiResponse<Map<String,Object>> closeReconciliationIssue(@PathVariable Long id, @RequestBody Map<String,String> body) { return ApiResponse.success(reconciliationService.close(id, body.get("status"), body.get("operator"))); } |