银行卡绑定通过判断是否要更新师傅状态
This commit is contained in:
parent
361956cab1
commit
8d714a4dd7
|
|
@ -25,6 +25,7 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -200,14 +201,19 @@ public class WorkerCertificationController extends BaseController
|
||||||
if(result > 0){
|
if(result > 0){
|
||||||
// 是否绑定了银行卡
|
// 是否绑定了银行卡
|
||||||
List<WorkerBank> workerBanks = workerBankService.getByWorkerIds(ids);
|
List<WorkerBank> workerBanks = workerBankService.getByWorkerIds(ids);
|
||||||
|
|
||||||
|
// 没有绑定了银行卡的用户
|
||||||
|
if(CollectionUtils.isEmpty(workerBanks)){
|
||||||
|
return AjaxResult.success("操作成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 绑定了的话更新师傅状态
|
||||||
workerBanks.forEach(workerBank -> {
|
workerBanks.forEach(workerBank -> {
|
||||||
// 绑定了的话更新师傅状态
|
|
||||||
Worker worker = new Worker();
|
Worker worker = new Worker();
|
||||||
worker.setWorkerId(workerBank.getWorkerId());
|
worker.setWorkerId(workerBank.getWorkerId());
|
||||||
worker.setStatus(0);
|
worker.setStatus(0);
|
||||||
workerService.updateWorker(worker);
|
workerService.updateWorker(worker);
|
||||||
});
|
});
|
||||||
|
|
||||||
return AjaxResult.success("操作成功!");
|
return AjaxResult.success("操作成功!");
|
||||||
}else {
|
}else {
|
||||||
return AjaxResult.warn("操作失败!");
|
return AjaxResult.warn("操作失败!");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue