取参问题

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-07-10 18:32:42 +08:00
parent 8d714a4dd7
commit 0ae1e87b4d
1 changed files with 13 additions and 11 deletions

View File

@ -9,6 +9,8 @@ import com.ghy.common.enums.WorkerCertifyStatus;
import com.ghy.common.enums.WorkerStatus;
import com.ghy.common.json.JSONObject;
import com.ghy.common.utils.ExceptionUtil;
import com.ghy.common.utils.ObjectUtils;
import com.ghy.common.utils.StringUtils;
import com.ghy.common.utils.poi.ExcelUtil;
import com.ghy.system.domain.SysArea;
import com.ghy.system.service.ISysAreaService;
@ -199,21 +201,21 @@ public class WorkerCertificationController extends BaseController
try {
int result = workerCertificationService.changeStatus(ids, status);
if(result > 0){
// 是否绑定了银行卡
List<WorkerBank> workerBanks = workerBankService.getByWorkerIds(ids);
// 没有绑定了银行卡的用户
if(CollectionUtils.isEmpty(workerBanks)){
return AjaxResult.success("操作成功!");
}
// 绑定了的话更新师傅状态
workerBanks.forEach(workerBank -> {
String [] idArray = ids.split(",");
for (String id : idArray){
WorkerCertification workerCertification = workerCertificationService.selectWorkerCertificationByWorkerCertificationId(id);
// 是否绑定了银行卡
WorkerBank workerBank = workerBankService.getByWorkerId(workerCertification.getWorkerId());
// 没有绑定了银行卡的用户
if(ObjectUtils.isEmpty(workerBank)){
return AjaxResult.success("操作成功!");
}
Worker worker = new Worker();
worker.setWorkerId(workerBank.getWorkerId());
worker.setStatus(0);
workerService.updateWorker(worker);
});
}
return AjaxResult.success("操作成功!");
}else {
return AjaxResult.warn("操作失败!");