师傅未通过审核不能绑定银行卡

This commit is contained in:
HH 2023-04-13 22:31:07 +08:00
parent 85debaa2cf
commit f77a3c2535
1 changed files with 10 additions and 9 deletions

View File

@ -51,6 +51,11 @@ public class WorkerBankController extends BaseController {
@PostMapping("bind") @PostMapping("bind")
@ResponseBody @ResponseBody
public AjaxResult bindBankCard(@RequestBody @Valid WorkerBindBankCardRequest request) throws BaseAdaPayException { public AjaxResult bindBankCard(@RequestBody @Valid WorkerBindBankCardRequest request) throws BaseAdaPayException {
// 判断师傅是否已经审核通过未通过审核不能绑定银行卡
WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(request.getWorkerId());
if (workerCertification != null && workerCertification.getStatus() == 1) {
return AjaxResult.error("师傅未通过审核,不能绑定银行卡");
}
Set<Merchant> merchants = AdapayConfig.getMerchants(); Set<Merchant> merchants = AdapayConfig.getMerchants();
for (Merchant merchant : merchants) { for (Merchant merchant : merchants) {
String memberId = AdapayUtils.getWorkerMemberId(request.getWorkerId(), merchant.getDeptId()); String memberId = AdapayUtils.getWorkerMemberId(request.getWorkerId(), merchant.getDeptId());
@ -95,15 +100,11 @@ public class WorkerBankController extends BaseController {
workerBankService.insertWorkerBank(workerBank); workerBankService.insertWorkerBank(workerBank);
} }
// 判断师傅是否已经审核过审核过就更新师傅状态为可用 // 绑卡成功 更新师傅为可用状态
WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(request.getWorkerId());
if (workerCertification != null && workerCertification.getStatus() == 1) {
// 更新师傅为可用
Worker worker = new Worker(); Worker worker = new Worker();
worker.setWorkerId(request.getWorkerId()); worker.setWorkerId(request.getWorkerId());
worker.setStatus(0); worker.setStatus(0);
workerService.updateWorker(worker); workerService.updateWorker(worker);
}
return AjaxResult.success("绑定银行卡成功"); return AjaxResult.success("绑定银行卡成功");
} }