银行卡绑定通过判断是否要更新师傅状态

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-07-10 18:23:44 +08:00
parent 361956cab1
commit 8d714a4dd7
1 changed files with 8 additions and 2 deletions

View File

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