|
|
@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.digiwin.app.service.DWEAIResult; |
|
|
|
import com.digiwin.athena.app.infra.common.enums.OptionEnums; |
|
|
|
import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; |
|
|
|
import com.digiwin.athena.app.infra.dto.staff.StaffDTO; |
|
|
|
import com.digiwin.athena.app.infra.entity.StaffEntity; |
|
|
|
import com.digiwin.athena.app.infra.repository.StaffRepository; |
|
|
|
import com.digiwin.athena.app.infra.service.StaffService; |
|
|
@ -71,33 +70,33 @@ public class StaffGetEAIService extends AbsEAIService { |
|
|
|
} |
|
|
|
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); |
|
|
|
} else if (OptionEnums.TASK.equals(option)) { |
|
|
|
List<StaffDTO> staffDTOS = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); |
|
|
|
List<StaffEntity> list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); |
|
|
|
LambdaQueryWrapper<StaffEntity> lmq = new LambdaQueryWrapper<>(); |
|
|
|
lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); |
|
|
|
lmq.and(queryWrapperInner -> { |
|
|
|
for (StaffDTO staffDTO : staffDTOS) { |
|
|
|
for (StaffEntity staff : list) { |
|
|
|
queryWrapperInner.or( |
|
|
|
wrapper -> wrapper |
|
|
|
.eq(!StringUtils.isEmpty(staffDTO.getTabStatus()), StaffEntity::getTabStatus, staffDTO.getTabStatus()) |
|
|
|
.eq(!StringUtils.isEmpty(staffDTO.getId()), StaffEntity::getId, staffDTO.getId()) |
|
|
|
.eq(!StringUtils.isEmpty(staff.getTabStatus()), StaffEntity::getTabStatus, staff.getTabStatus()) |
|
|
|
.eq(!StringUtils.isEmpty(staff.getId()), StaffEntity::getId, staff.getId()) |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|
List<StaffEntity> staffEntities = staffRepository.selectList(lmq); |
|
|
|
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); |
|
|
|
} else if (OptionEnums.BASIC.equals(option)) { |
|
|
|
List<StaffDTO> staffDTOS = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); |
|
|
|
List<StaffEntity> list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); |
|
|
|
LambdaQueryWrapper<StaffEntity> lmq = new LambdaQueryWrapper<>(); |
|
|
|
lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); |
|
|
|
lmq.and(queryWrapperInner -> { |
|
|
|
for (StaffDTO staffDTO : staffDTOS) { |
|
|
|
for (StaffEntity staff : list) { |
|
|
|
queryWrapperInner.or( |
|
|
|
wrapper -> wrapper |
|
|
|
.eq(!StringUtils.isEmpty(staffDTO.getEmployeeNo()), StaffEntity::getEmployeeNo, staffDTO.getEmployeeNo()) |
|
|
|
.eq(!StringUtils.isEmpty(staffDTO.getEmployeeName()), StaffEntity::getEmployeeName, staffDTO.getEmployeeName()) |
|
|
|
.eq(!StringUtils.isEmpty(staffDTO.getEnEmployeeName()), StaffEntity::getEnEmployeeName, staffDTO.getEnEmployeeName()) |
|
|
|
.eq(!StringUtils.isEmpty(staffDTO.getEmail()), StaffEntity::getEmail, staffDTO.getEmail()) |
|
|
|
.eq(!StringUtils.isEmpty(staffDTO.getMobileNo()), StaffEntity::getMobileNo, staffDTO.getMobileNo()) |
|
|
|
.eq(!StringUtils.isEmpty(staff.getEmployeeNo()), StaffEntity::getEmployeeNo, staff.getEmployeeNo()) |
|
|
|
.eq(!StringUtils.isEmpty(staff.getEmployeeName()), StaffEntity::getEmployeeName, staff.getEmployeeName()) |
|
|
|
.eq(!StringUtils.isEmpty(staff.getEnEmployeeName()), StaffEntity::getEnEmployeeName, staff.getEnEmployeeName()) |
|
|
|
.eq(!StringUtils.isEmpty(staff.getEmail()), StaffEntity::getEmail, staff.getEmail()) |
|
|
|
.eq(!StringUtils.isEmpty(staff.getMobileNo()), StaffEntity::getMobileNo, staff.getMobileNo()) |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|