Browse Source

验证必传参数

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

+ 25
- 21
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java View File

@ -73,33 +73,37 @@ public class StaffGetEAIService extends AbsEAIService {
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 (StaffEntity staff : list) {
queryWrapperInner.or(
wrapper -> wrapper
.eq(!StringUtils.isEmpty(staff.getTabStatus()), StaffEntity::getTabStatus, staff.getTabStatus())
.eq(!StringUtils.isEmpty(staff.getId()), StaffEntity::getId, staff.getId())
);
}
});
if (!CollectionUtils.isEmpty(list)) {
lmq.and(queryWrapperInner -> {
for (StaffEntity staff : list) {
queryWrapperInner.or(
wrapper -> wrapper
.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.getValue().equals(option)) {
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 (StaffEntity staff : list) {
queryWrapperInner.or(
wrapper -> wrapper
.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())
);
}
});
if (!CollectionUtils.isEmpty(list)) {
lmq.and(queryWrapperInner -> {
for (StaffEntity staff : list) {
queryWrapperInner.or(
wrapper -> wrapper
.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())
);
}
});
}
List<StaffEntity> staffEntities = staffRepository.selectList(lmq);
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities));
}


Loading…
Cancel
Save