|
@@ -2,6 +2,7 @@ package com.payment.platform.module.payment.batch.controller;
|
|
|
|
|
|
|
|
import com.payment.platform.common.response.PageResult;
|
|
import com.payment.platform.common.response.PageResult;
|
|
|
import com.payment.platform.common.response.Result;
|
|
import com.payment.platform.common.response.Result;
|
|
|
|
|
+import com.payment.platform.module.payment.batch.dto.AuthorizeApplyDTO;
|
|
|
import com.payment.platform.module.payment.batch.dto.BatchCreateDTO;
|
|
import com.payment.platform.module.payment.batch.dto.BatchCreateDTO;
|
|
|
import com.payment.platform.module.payment.batch.entity.BatchAuthorizeEntity;
|
|
import com.payment.platform.module.payment.batch.entity.BatchAuthorizeEntity;
|
|
|
import com.payment.platform.module.payment.batch.entity.BatchOrderEntity;
|
|
import com.payment.platform.module.payment.batch.entity.BatchOrderEntity;
|
|
@@ -17,64 +18,61 @@ import java.io.IOException;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
-@RequestMapping("/payment/account/batch")
|
|
|
|
|
|
|
+@RequestMapping("/payment/batch")
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
public class BatchPayController {
|
|
public class BatchPayController {
|
|
|
|
|
|
|
|
private final AlipayBatchPayService batchPayService;
|
|
private final AlipayBatchPayService batchPayService;
|
|
|
private final BatchSubjectService batchSubjectService;
|
|
private final BatchSubjectService batchSubjectService;
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:authorize')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:authorize')")
|
|
|
@PostMapping("/authorize/apply")
|
|
@PostMapping("/authorize/apply")
|
|
|
- public Result<Map<String, String>> authorizeApply(@RequestBody Map<String, Object> b) {
|
|
|
|
|
- // 账号级: 主体参数来自表单(名称/uid/服务商),不再从企业解析
|
|
|
|
|
|
|
+ public Result<Map<String, String>> authorizeApply(@Valid @RequestBody AuthorizeApplyDTO dto) {
|
|
|
|
|
+ // 账号级: 主体信息来自表单(名称/uid/服务商),不再从企业解析
|
|
|
return Result.ok(batchSubjectService.apply(
|
|
return Result.ok(batchSubjectService.apply(
|
|
|
- (String) b.get("participant_name"),
|
|
|
|
|
- (String) b.get("participant_id"),
|
|
|
|
|
- b.get("service_provider_id") != null
|
|
|
|
|
- ? Long.valueOf(b.get("service_provider_id").toString()) : null));
|
|
|
|
|
|
|
+ dto.getParticipantName(), dto.getParticipantId(), dto.getServiceProviderId()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:authorize')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:authorize')")
|
|
|
@PostMapping("/authorize/rebind")
|
|
@PostMapping("/authorize/rebind")
|
|
|
public Result<Map<String, String>> authorizeRebind(@RequestBody Map<String, Object> b) {
|
|
public Result<Map<String, String>> authorizeRebind(@RequestBody Map<String, Object> b) {
|
|
|
return Result.ok(batchSubjectService.rebind(
|
|
return Result.ok(batchSubjectService.rebind(
|
|
|
b.get("id") != null ? Long.valueOf(b.get("id").toString()) : null));
|
|
b.get("id") != null ? Long.valueOf(b.get("id").toString()) : null));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:authorize')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:authorize')")
|
|
|
@GetMapping("/authorize/query")
|
|
@GetMapping("/authorize/query")
|
|
|
public Result<Map<String, String>> queryAuthorize(
|
|
public Result<Map<String, String>> queryAuthorize(
|
|
|
@RequestParam("out_biz_no") String outBizNo) {
|
|
@RequestParam("out_biz_no") String outBizNo) {
|
|
|
return Result.ok(batchSubjectService.query(outBizNo));
|
|
return Result.ok(batchSubjectService.query(outBizNo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:transfer')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:create')")
|
|
|
@PostMapping("/create")
|
|
@PostMapping("/create")
|
|
|
public Result<Map<String, Object>> batchCreate(@Valid @RequestBody BatchCreateDTO dto) {
|
|
public Result<Map<String, Object>> batchCreate(@Valid @RequestBody BatchCreateDTO dto) {
|
|
|
return Result.ok(batchPayService.batchCreate(dto));
|
|
return Result.ok(batchPayService.batchCreate(dto));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:transfer')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:create')")
|
|
|
@PostMapping("/pay")
|
|
@PostMapping("/pay")
|
|
|
public Result<Map<String, String>> renderPay(@RequestBody Map<String, Object> b) {
|
|
public Result<Map<String, String>> renderPay(@RequestBody Map<String, Object> b) {
|
|
|
return Result.ok(batchPayService.renderPay((String) b.get("out_batch_no")));
|
|
return Result.ok(batchPayService.renderPay((String) b.get("out_batch_no")));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:transfer:list')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:list')")
|
|
|
@GetMapping("/query")
|
|
@GetMapping("/query")
|
|
|
public Result<Map<String, Object>> batchQuery(
|
|
public Result<Map<String, Object>> batchQuery(
|
|
|
@RequestParam("out_batch_no") String outBatchNo) {
|
|
@RequestParam("out_batch_no") String outBatchNo) {
|
|
|
return Result.ok(batchPayService.batchQuery(outBatchNo));
|
|
return Result.ok(batchPayService.batchQuery(outBatchNo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:transfer')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:create')")
|
|
|
@PostMapping("/close")
|
|
@PostMapping("/close")
|
|
|
public Result<Map<String, String>> batchClose(@RequestBody Map<String, Object> b) {
|
|
public Result<Map<String, String>> batchClose(@RequestBody Map<String, Object> b) {
|
|
|
return Result.ok(batchPayService.batchClose((String) b.get("out_batch_no")));
|
|
return Result.ok(batchPayService.batchClose((String) b.get("out_batch_no")));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:transfer:list')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:list')")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
public Result<PageResult<BatchOrderEntity>> batchList(
|
|
public Result<PageResult<BatchOrderEntity>> batchList(
|
|
|
@RequestParam(name = "page_no", defaultValue = "1") int pageNo,
|
|
@RequestParam(name = "page_no", defaultValue = "1") int pageNo,
|
|
@@ -86,7 +84,7 @@ public class BatchPayController {
|
|
|
return Result.ok(batchPayService.batchList(participantId, status, startTime, endTime, pageNo, pageSize));
|
|
return Result.ok(batchPayService.batchList(participantId, status, startTime, endTime, pageNo, pageSize));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:transfer:detail')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:detail')")
|
|
|
@GetMapping("/detail")
|
|
@GetMapping("/detail")
|
|
|
public Result<Map<String, Object>> batchDetail(
|
|
public Result<Map<String, Object>> batchDetail(
|
|
|
@RequestParam("out_batch_no") String outBatchNo,
|
|
@RequestParam("out_batch_no") String outBatchNo,
|
|
@@ -95,7 +93,7 @@ public class BatchPayController {
|
|
|
return Result.ok(batchPayService.batchDetail(outBatchNo, pageNo, pageSize));
|
|
return Result.ok(batchPayService.batchDetail(outBatchNo, pageNo, pageSize));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:transfer:list')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:list')")
|
|
|
@GetMapping("/authorize/list")
|
|
@GetMapping("/authorize/list")
|
|
|
public Result<PageResult<BatchAuthorizeEntity>> authorizeList(
|
|
public Result<PageResult<BatchAuthorizeEntity>> authorizeList(
|
|
|
@RequestParam(name = "page_no", defaultValue = "1") int pageNo,
|
|
@RequestParam(name = "page_no", defaultValue = "1") int pageNo,
|
|
@@ -104,7 +102,7 @@ public class BatchPayController {
|
|
|
return Result.ok(batchSubjectService.list(participantId, pageNo, pageSize));
|
|
return Result.ok(batchSubjectService.list(participantId, pageNo, pageSize));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PreAuthorize("@perm.hasAny('module_payment:account:transfer:list')")
|
|
|
|
|
|
|
+ @PreAuthorize("@perm.hasAny('module_payment:batch:list')")
|
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|
|
|
public void batchExport(
|
|
public void batchExport(
|
|
|
@RequestParam(name = "participant_id", required = false) String participantId,
|
|
@RequestParam(name = "participant_id", required = false) String participantId,
|