师傅未通过审核不能绑定银行卡
This commit is contained in:
parent
85debaa2cf
commit
f77a3c2535
|
|
@ -51,6 +51,11 @@ public class WorkerBankController extends BaseController {
|
|||
@PostMapping("bind")
|
||||
@ResponseBody
|
||||
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();
|
||||
for (Merchant merchant : merchants) {
|
||||
String memberId = AdapayUtils.getWorkerMemberId(request.getWorkerId(), merchant.getDeptId());
|
||||
|
|
@ -95,15 +100,11 @@ public class WorkerBankController extends BaseController {
|
|||
workerBankService.insertWorkerBank(workerBank);
|
||||
|
||||
}
|
||||
// 判断师傅是否已经审核过,审核过,就更新师傅状态为可用
|
||||
WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(request.getWorkerId());
|
||||
if (workerCertification != null && workerCertification.getStatus() == 1) {
|
||||
// 更新师傅为可用
|
||||
// 绑卡成功 更新师傅为可用状态
|
||||
Worker worker = new Worker();
|
||||
worker.setWorkerId(request.getWorkerId());
|
||||
worker.setStatus(0);
|
||||
workerService.updateWorker(worker);
|
||||
}
|
||||
return AjaxResult.success("绑定银行卡成功");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue