如果用户批量设置了工程接口人,如果责任人是空,自动带入。

This commit is contained in:
wangzhijiang
2023-03-31 13:43:13 +08:00
parent 29b58541c0
commit 082521657e
2 changed files with 29 additions and 1 deletions
@@ -86,7 +86,7 @@ public class InventoryAffirmJob implements Job {
queryWrapperInventory.and(queryWrapper -> {
queryWrapper.lambda().eq(ProjectLawsInventoryEO::getDesignFlowStatus, ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
queryWrapper.or(or -> {
or.lambda().eq(ProjectLawsInventoryEO::getDesignFlowStatus, ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
or.lambda().eq(ProjectLawsInventoryEO::getVerifyFlowStatus, ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
});
});
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.projectLawsInventoryEOMapper.selectList(queryWrapperInventory);
@@ -373,11 +373,39 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
try {
List<String> idList = Arrays.asList(ids.split(","));
QueryWrapper<ProjectCertificationInventoryEO> pciQueryWrap = new QueryWrapper<>();
pciQueryWrap.lambda().in(ProjectCertificationInventoryEO::getId,idList);
List<ProjectCertificationInventoryEO> pciEoList = this.list(pciQueryWrap);
List<ProjectCertificationInventoryEO> updateList = new ArrayList<>();
for (String id : idList) {
ProjectCertificationInventoryEO updateProjectCertificationInventoryEO = new ProjectCertificationInventoryEO();
BeanUtils.copyProperties(projectCertificationInventoryEO,updateProjectCertificationInventoryEO);
updateProjectCertificationInventoryEO.setId(id);
/**
* 2023-03-30 17.36新增该需求。
* 如果用户批量设置了工程接口人字段
* 那就需要判断所选数据中责任人是否为空
* 如果责任人字段为空时 需要将工程接口人带入到所选数据的责任人字段中
*/
if(StringUtils.isNotBlank(projectCertificationInventoryEO.getSdt())){
List<ProjectCertificationInventoryEO> pciEoListTemp = pciEoList.stream().filter(pciEo -> {
boolean flag = false;
if (StringUtils.equals(pciEo.getId(), id)) {
flag = true;
}
return flag;
}).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(pciEoListTemp)){
ProjectCertificationInventoryEO pciEo = pciEoListTemp.get(0);
if(StringUtils.isEmpty(pciEo.getDutyPerson())){
updateProjectCertificationInventoryEO.setDutyPerson(projectCertificationInventoryEO.getSdt());
}
}
}
updateList.add(updateProjectCertificationInventoryEO);
}