统计-责任领域跳转

This commit is contained in:
zhn
2023-12-05 16:42:38 +08:00
parent 67ed7ffa87
commit 8c31c979fe
@@ -2316,7 +2316,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
projectCertificationInventoryEOList = projectCertificationInventoryEOService.list(queryWrapper);
for (ProjectCertificationInventoryEO certificationInventoryEO : pciEoList) {
List<LawsInventoryPlatformEO> collect = lawsInventoryPlatformEOList.stream()
.filter(e -> e.getPlatformLawsInventoryId().equals(certificationInventoryEO.getId()))
.filter(e -> e.getLawsInventoryId().equals(certificationInventoryEO.getId()))
.collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect)){
yesList.add(certificationInventoryEO);
@@ -2522,6 +2522,9 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper);
//如果法规清单关联平台件,需要特殊处理
projectLawsInventoryEOList = getProjectLawsInventoryEOS(projectLawsInventoryEOList);
List<SysDictItem> sysDictItems = new ArrayList<>();
// 法规清单所有的责任领域
String pliDutyTerritoryStr = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getDutyTerritory).collect(Collectors.joining(","));
@@ -2692,6 +2695,10 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryId);
pciQueryWrap.lambda().ne(ProjectCertificationInventoryEO::getFlowStatus, FlowStateEnum.UNINVOLVED.getValue());
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(pciQueryWrap);
//如果认证清单关联平台件,需要特殊处理
projectCertificationInventoryEOList = getProjectCertificationInventoryEOS(projectCertificationInventoryEOList);
String pciDutyTerritoryStr = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyTerritory).collect(Collectors.joining(","));
if (StringUtils.isNotEmpty(pciDutyTerritoryStr)) {
List<String> pciDutyTerritoryList = Arrays.asList(pciDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList());
@@ -2765,6 +2772,93 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
return result;
}
private List<ProjectCertificationInventoryEO> getProjectCertificationInventoryEOS(List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList) {
List<String> projectCertificationInventoryIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getId).collect(Collectors.toList());
//认证清单关联的平台件
LambdaQueryWrapper<LawsInventoryPlatformEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,projectCertificationInventoryIdList);
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = lawsInventoryPlatformEOService.list(wrapper);
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOListTemp = new ArrayList<>();
List<ProjectCertificationInventoryEO> yesList = new ArrayList<>();
List<ProjectCertificationInventoryEO> noList = new ArrayList<>();
if(ObjectUtils.isNotEmpty(lawsInventoryPlatformEOList)){
List<String> idList = lawsInventoryPlatformEOList.stream()
.map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).collect(Collectors.toList());
LambdaQueryWrapper<ProjectCertificationInventoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ProjectCertificationInventoryEO::getId,idList);
projectCertificationInventoryEOListTemp = projectCertificationInventoryEOService.list(queryWrapper);
for (ProjectCertificationInventoryEO certificationInventoryEO : projectCertificationInventoryEOList) {
List<LawsInventoryPlatformEO> collect = lawsInventoryPlatformEOList.stream()
.filter(e -> e.getLawsInventoryId().equals(certificationInventoryEO.getId()))
.collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect)){
yesList.add(certificationInventoryEO);
}else{
noList.add(certificationInventoryEO);
}
}
}
if(ObjectUtils.isNotEmpty(projectCertificationInventoryEOList)
&& ObjectUtils.isNotEmpty(yesList)
&& projectCertificationInventoryEOList.size() != yesList.size()){
//法规清单有数据且部分关联了平台件
projectCertificationInventoryEOList = noList;
projectCertificationInventoryEOList.addAll(projectCertificationInventoryEOListTemp);
}else if(ObjectUtils.isNotEmpty(projectCertificationInventoryEOList)
&& ObjectUtils.isNotEmpty(yesList)
&& projectCertificationInventoryEOList.size() == yesList.size()){
//认证清单有数据且全部关联了平台件
projectCertificationInventoryEOList = projectCertificationInventoryEOListTemp;
}
return projectCertificationInventoryEOList;
}
@NotNull
private List<ProjectLawsInventoryEO> getProjectLawsInventoryEOS(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
List<String> projectLawsInventoryIdList = projectLawsInventoryEOList.stream()
.distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
//法规清单关联的所有平台件
LambdaQueryWrapper<LawsInventoryPlatformEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,projectLawsInventoryIdList);
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = lawsInventoryPlatformEOService.list(wrapper);
//区分哪些法规清单关联了平台件,哪些法规清单没有关联平台件
List<ProjectLawsInventoryEO> yesList = new ArrayList<>();
List<ProjectLawsInventoryEO> noList = new ArrayList<>();
List<ProjectLawsInventoryEO> projectLawsInventoryPlatFormList = new ArrayList<>();
if(ObjectUtils.isNotEmpty(lawsInventoryPlatformEOList)){
//所关联平台件的法规清单id
List<String> idList = lawsInventoryPlatformEOList.stream()
.map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).collect(Collectors.toList());
LambdaQueryWrapper<ProjectLawsInventoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ProjectLawsInventoryEO::getId,idList);
projectLawsInventoryPlatFormList = projectLawsInventoryEOMapper.selectList(queryWrapper);
for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOList) {
List<LawsInventoryPlatformEO> collect = lawsInventoryPlatformEOList.stream()
.filter(e -> e.getLawsInventoryId().equals(projectLawsInventoryEO.getId())).collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect)){
yesList.add(projectLawsInventoryEO);
}else{
noList.add(projectLawsInventoryEO);
}
}
}
if(ObjectUtils.isNotEmpty(projectLawsInventoryEOList)
&& ObjectUtils.isNotEmpty(yesList)
&& yesList.size() != projectLawsInventoryEOList.size()
){
//法规清单有数据且部分关联平台件数据
projectLawsInventoryEOList = noList;
projectLawsInventoryEOList.addAll(projectLawsInventoryPlatFormList);
}else if(ObjectUtils.isNotEmpty(projectLawsInventoryEOList)
&& ObjectUtils.isNotEmpty(yesList)
&& yesList.size() == projectLawsInventoryEOList.size()){
//法规清单有数据且全部关联了平台件
projectLawsInventoryEOList = projectLawsInventoryPlatFormList;
}
return projectLawsInventoryEOList;
}
/**
* 项目库详情统计-根据责任领域分组统计数据-表头排序
* @param dataList