Browse Source

新增接口判空处理

master
郑贵龙 1 year ago
parent
commit
971290f5be
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java

+ 3
- 3
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java View File

@ -45,13 +45,13 @@ public class StaffCreateEAIService extends AbsEAIService {
//反序列化字段
EAIRequest request = new EAIRequest(messageBody);
List<StaffEntity> staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF);
if (CollectionUtils.isEmpty(staffList)){
throw new DWRuntimeException("缺少必要参数");
}
staffList.forEach(item ->{
item.setStatus(StatusEnums.TOBEREPORTED.getValue());
item.setTabStatus(TabStatusEnums.NOSET.getValue());
});
if (CollectionUtils.isEmpty(staffList)){
throw new DWRuntimeException("缺少必要参数");
}
staffService.saveBatch(staffList);
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",staffList));
}


Loading…
Cancel
Save