Browse Source

create接口状态添加默认值

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

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

@ -3,6 +3,8 @@ package com.digiwin.athena.app.service.staff;
import com.alibaba.fastjson.JSONObject;
import com.digiwin.app.container.exceptions.DWRuntimeException;
import com.digiwin.app.service.DWEAIResult;
import com.digiwin.athena.app.infra.common.enums.StatusEnums;
import com.digiwin.athena.app.infra.common.enums.TabStatusEnums;
import com.digiwin.athena.app.infra.entity.StaffEntity;
import com.digiwin.athena.app.infra.repository.StaffRepository;
import com.digiwin.athena.app.infra.service.StaffService;
@ -43,6 +45,10 @@ public class StaffCreateEAIService extends AbsEAIService {
//反序列化字段
EAIRequest request = new EAIRequest(messageBody);
List<StaffEntity> staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF);
staffList.forEach(item ->{
item.setStatus(StatusEnums.TOBEREPORTED.getValue());
item.setTabStatus(TabStatusEnums.NOSET.getValue());
});
if (CollectionUtils.isEmpty(staffList)){
throw new DWRuntimeException("缺少必要参数");
}


Loading…
Cancel
Save