合并分支 'dev_PersonChange_20230712' 到 'master'
项目库-全局替换用户功能优化。 查看合并请求 laws-nio/laws-weilai!352
This commit is contained in:
+28
-8
@@ -44,12 +44,22 @@ public class ProjectLawsInventoryEOEditServiceImpl {
|
||||
* @param newPliEo 新的法规清单对象
|
||||
* @param oldPliEoList 旧的法规清单数组
|
||||
*/
|
||||
public void updateRegulationOwner(ProjectLawsInventoryEO newPliEo, List<ProjectLawsInventoryEO> oldPliEoList) {
|
||||
public void updateRegulationOwner(ProjectLawsInventoryEO newPliEo, List<ProjectLawsInventoryEO> oldPliEoList,List<ProcessInfoDetailEO> pidList) {
|
||||
if (CollectionUtils.isNotEmpty(oldPliEoList)) {
|
||||
List<String> oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<ProcessInfoDetailEO> pidEoQueryWrap = new QueryWrapper<>();
|
||||
pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList);
|
||||
List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap);
|
||||
// QueryWrapper<ProcessInfoDetailEO> pidEoQueryWrap = new QueryWrapper<>();
|
||||
// pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList);
|
||||
// List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap);
|
||||
List<ProcessInfoDetailEO> pidEoList = pidList.stream().filter(pid -> {
|
||||
boolean flag = false;
|
||||
for (String oldPliEoId : oldPliEoIdList) {
|
||||
if(StringUtils.equals(oldPliEoId,pid.getProjectLawsInventoryId())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).distinct().collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(pidEoList)){
|
||||
List<String> taskIdList = new ArrayList<>();
|
||||
List<ProcessInfoDetailEO> updatePidEoList = new ArrayList<>();
|
||||
@@ -231,12 +241,22 @@ public class ProjectLawsInventoryEOEditServiceImpl {
|
||||
* @param newPliEo 新的法规清单对象
|
||||
* @param oldPliEoList 旧的法规清单数组
|
||||
*/
|
||||
public void updateDutyPerson(ProjectLawsInventoryEO newPliEo, List<ProjectLawsInventoryEO> oldPliEoList) {
|
||||
public void updateDutyPerson(ProjectLawsInventoryEO newPliEo, List<ProjectLawsInventoryEO> oldPliEoList,List<ProcessInfoDetailEO> pidList) {
|
||||
if (CollectionUtils.isNotEmpty(oldPliEoList)) {
|
||||
List<String> oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<ProcessInfoDetailEO> pidEoQueryWrap = new QueryWrapper<>();
|
||||
pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList);
|
||||
List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap);
|
||||
// QueryWrapper<ProcessInfoDetailEO> pidEoQueryWrap = new QueryWrapper<>();
|
||||
// pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList);
|
||||
// List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap);
|
||||
List<ProcessInfoDetailEO> pidEoList = pidList.stream().filter(pid -> {
|
||||
boolean flag = false;
|
||||
for (String oldPliEoId : oldPliEoIdList) {
|
||||
if(StringUtils.equals(oldPliEoId,pid.getProjectLawsInventoryId())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).distinct().collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(pidEoList)){
|
||||
List<String> designTaskIdList = new ArrayList<>();
|
||||
List<String> verifyTaskIdList = new ArrayList<>();
|
||||
|
||||
+4
-3
@@ -6287,9 +6287,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
newPciEo.setId(pciEo.getId());
|
||||
newPciEo.setDutyPerson(newUserId);
|
||||
|
||||
QueryWrapper<ProjectCertificationInventoryEO> certificationQueryWrap = new QueryWrapper<>();
|
||||
certificationQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getId,pciEo.getId());
|
||||
List<ProjectCertificationInventoryEO> oldPciEoList = this.list(certificationQueryWrap);
|
||||
// QueryWrapper<ProjectCertificationInventoryEO> certificationQueryWrap = new QueryWrapper<>();
|
||||
// certificationQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getId,pciEo.getId());
|
||||
// List<ProjectCertificationInventoryEO> oldPciEoList = this.list(certificationQueryWrap);
|
||||
List<ProjectCertificationInventoryEO> oldPciEoList = pciEoList.stream().filter(p -> StringUtils.equals(p.getId(),pciEo.getId())).distinct().collect(Collectors.toList());
|
||||
// 编辑责任人处理逻辑
|
||||
this.editDutyPerson(newPciEo, oldPciEoList);
|
||||
|
||||
|
||||
+48
-20
@@ -507,10 +507,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
List<ProjectLawsInventoryEO> oldPliEoList = this.list(oldPliQueryWrap);
|
||||
|
||||
this.updateProjectLawsInventorySendMessage(projectLawsInventoryEO);
|
||||
// 处理编辑法规工程师的逻辑
|
||||
this.editService.updateRegulationOwner(projectLawsInventoryEO,oldPliEoList);
|
||||
// 处理编辑责任人的逻辑
|
||||
this.editService.updateDutyPerson(projectLawsInventoryEO,oldPliEoList);
|
||||
|
||||
// 根据法规清单id,获取该法规清单在待办中心的任务明细。
|
||||
List<String> oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<ProcessInfoDetailEO> pidEoQueryWrap = new QueryWrapper<>();
|
||||
pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList);
|
||||
List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap);
|
||||
if(CollectionUtils.isNotEmpty(pidEoList)){
|
||||
// 处理编辑法规工程师的逻辑
|
||||
this.editService.updateRegulationOwner(projectLawsInventoryEO,oldPliEoList,pidEoList);
|
||||
// 处理编辑责任人的逻辑
|
||||
this.editService.updateDutyPerson(projectLawsInventoryEO,oldPliEoList,pidEoList);
|
||||
}
|
||||
// 处理修改设计或验证符合性截止日期的逻辑
|
||||
this.editService.updateDesignOrVerifyEndTime(projectLawsInventoryEO,oldPliEoList);
|
||||
|
||||
@@ -4355,10 +4363,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
// 发送消息
|
||||
this.updateProjectLawsInventorySendMessage(projectLawsInventoryEO);
|
||||
}
|
||||
// 根据法规清单id,获取该法规清单在待办中心的任务明细。
|
||||
List<String> oldPliEoIdList = infoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<ProcessInfoDetailEO> pidEoQueryWrap = new QueryWrapper<>();
|
||||
pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList);
|
||||
List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap);
|
||||
|
||||
// 处理编辑法规工程师的逻辑
|
||||
this.editService.updateRegulationOwner(projectLawsInventoryEO,infoList);
|
||||
this.editService.updateRegulationOwner(projectLawsInventoryEO,infoList,pidEoList);
|
||||
// 处理编辑责任人的逻辑
|
||||
this.editService.updateDutyPerson(projectLawsInventoryEO,infoList);
|
||||
this.editService.updateDutyPerson(projectLawsInventoryEO,infoList,pidEoList);
|
||||
// 处理修改设计或验证符合性截止日期的逻辑
|
||||
this.editService.updateDesignOrVerifyEndTime(projectLawsInventoryEO,infoList);
|
||||
|
||||
@@ -13762,6 +13776,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
pliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId, projectLibraryId);
|
||||
List<ProjectLawsInventoryEO> pliEoList = this.list(pliQueryWrap);
|
||||
|
||||
// 根据法规清单id,获取该法规清单在待办中心的任务明细。
|
||||
List<String> oldPliEoIdList = pliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<ProcessInfoDetailEO> pidEoQueryWrap = new QueryWrapper<>();
|
||||
pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList);
|
||||
List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap);
|
||||
|
||||
List<ProjectLawsInventoryEO> updateEoList = new ArrayList<>();
|
||||
for (Map<String, Object> replacementUserMap : replacementUserList) {
|
||||
String dutyTerritory = (String) replacementUserMap.get("dutyTerritory");
|
||||
@@ -13769,31 +13789,39 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if (StringUtils.isNotEmpty(newUserId)) {
|
||||
for (ProjectLawsInventoryEO pliEo : pliEoList) {
|
||||
if (StringUtils.contains(pliEo.getDutyTerritory(), dutyTerritory)) {
|
||||
QueryWrapper<ProjectLawsInventoryEO> oldPliQueryWrap = new QueryWrapper<>();
|
||||
oldPliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getId,pliEo.getId());
|
||||
List<ProjectLawsInventoryEO> oldPliEoList = this.list(oldPliQueryWrap);
|
||||
// QueryWrapper<ProjectLawsInventoryEO> oldPliQueryWrap = new QueryWrapper<>();
|
||||
// oldPliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getId,pliEo.getId());
|
||||
// List<ProjectLawsInventoryEO> oldPliEoList = this.list(oldPliQueryWrap);
|
||||
// 过滤出来修改之前的法规清单数据
|
||||
List<ProjectLawsInventoryEO> oldPliEoList = pliEoList.stream().filter(p -> StringUtils.equals(p.getId(),pliEo.getId())).distinct().collect(Collectors.toList());
|
||||
ProjectLawsInventoryEO newPliEo = new ProjectLawsInventoryEO();
|
||||
|
||||
if (StringUtils.equals(pliEo.getRegulationOwnerId(), userId)) {
|
||||
newPliEo.setRegulationOwnerId(newUserId);
|
||||
// 处理编辑法规工程师的逻辑
|
||||
this.editService.updateRegulationOwner(newPliEo, oldPliEoList);
|
||||
this.editService.updateRegulationOwner(newPliEo, oldPliEoList,pidEoList);
|
||||
pliEo.setRegulationOwnerId(newUserId);
|
||||
}
|
||||
if (StringUtils.equals(pliEo.getEngineeringInterfacePerson(), userId)) {
|
||||
pliEo.setEngineeringInterfacePerson(newUserId);
|
||||
}
|
||||
if (StringUtils.equals(pliEo.getDesignDutyId(), userId)) {
|
||||
newPliEo.setDesignDutyId(newUserId);
|
||||
pliEo.setDesignDutyId(newUserId);
|
||||
}
|
||||
if (StringUtils.equals(pliEo.getVerifyDutyId(), userId)) {
|
||||
newPliEo.setVerifyDutyId(newUserId);
|
||||
pliEo.setVerifyDutyId(newUserId);
|
||||
}
|
||||
|
||||
// 处理编辑责任人的逻辑
|
||||
this.editService.updateDutyPerson(newPliEo, oldPliEoList);
|
||||
if(StringUtils.equals(pliEo.getDesignDutyId(), userId) || StringUtils.equals(pliEo.getVerifyDutyId(), userId)){
|
||||
if (StringUtils.equals(pliEo.getDesignDutyId(), userId)) {
|
||||
newPliEo.setDesignDutyId(newUserId);
|
||||
}
|
||||
if (StringUtils.equals(pliEo.getVerifyDutyId(), userId)) {
|
||||
newPliEo.setVerifyDutyId(newUserId);
|
||||
}
|
||||
// 处理编辑责任人的逻辑
|
||||
this.editService.updateDutyPerson(newPliEo, oldPliEoList,pidEoList);
|
||||
if (StringUtils.equals(pliEo.getDesignDutyId(), userId)) {
|
||||
pliEo.setDesignDutyId(newUserId);
|
||||
}
|
||||
if (StringUtils.equals(pliEo.getVerifyDutyId(), userId)) {
|
||||
pliEo.setVerifyDutyId(newUserId);
|
||||
}
|
||||
}
|
||||
updateEoList.add(pliEo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user