师傅未通过审核不能绑定银行卡
This commit is contained in:
parent
85debaa2cf
commit
f77a3c2535
|
|
@ -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("绑定银行卡成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue