认证清单分页-关联平台件数据

This commit is contained in:
zhn
2023-09-21 17:29:02 +08:00
parent 54991f6b58
commit 00552ddbe3
@@ -1924,11 +1924,49 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
}
IPage<ProjectCertificationInventoryEO> pageList = this.page(page, queryWrapper);
//平台件数据处理
platformDispose(projectCertificationInventoryEO, pageList.getRecords());
this.disposeData(pageList.getRecords(),cut);
List<ProjectCertificationInventoryEO> records = this.hearSort(projectCertificationInventoryEO, pageList.getRecords());
pageList.setRecords(records);
return pageList;
}
private void platformDispose(ProjectCertificationInventoryEO projectCertificationInventoryEO, List<ProjectCertificationInventoryEO> result) {
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = new ArrayList<>();
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS = new ArrayList<>();
if(!result.isEmpty()){
//认证清单ID
List<String> certificationInventoryIdList = result.stream().map(ProjectCertificationInventoryEO::getId).collect(Collectors.toList());
LambdaQueryWrapper<LawsInventoryPlatformEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,certificationInventoryIdList);
lawsInventoryPlatformEOList = lawsInventoryPlatformEOService.list(wrapper);
if(!lawsInventoryPlatformEOList.isEmpty()){
List<String> collect = lawsInventoryPlatformEOList.stream().map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).distinct().collect(Collectors.toList());
LambdaQueryWrapper<ProjectCertificationInventoryEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(ProjectCertificationInventoryEO::getId,collect);
projectCertificationInventoryEOS = this.list(lambdaQueryWrapper);//平台件清单
}
}
for (ProjectCertificationInventoryEO certificationInventoryEO : result) {
if(!projectCertificationInventoryEOS.isEmpty()){
List<LawsInventoryPlatformEO> inventoryPlatformEOList = lawsInventoryPlatformEOList.stream()
.filter(e -> certificationInventoryEO.getId().equals(e.getLawsInventoryId())).collect(Collectors.toList());
if(!inventoryPlatformEOList.isEmpty()){
List<String> idList = inventoryPlatformEOList.stream()
.map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).collect(Collectors.toList());
List<ProjectCertificationInventoryEO> certificationInventoryEOS = projectCertificationInventoryEOS.stream()
.filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
if(!certificationInventoryEOS.isEmpty()){
setProjectCertificationInventoryEO(certificationInventoryEOS.get(0),certificationInventoryEO);
}
}
}
}
}
/**
* 表头排序
@@ -6966,7 +7004,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return projectCertificationInventoryEOS;
}
private void setProjectCertificationInventoryEO(ProjectCertificationInventoryEO certificationInventoryEO, ProjectCertificationInventoryEO projectCertificationInventoryEO) {
private void setProjectCertificationInventoryEO(ProjectCertificationInventoryEO certificationInventoryEO,
ProjectCertificationInventoryEO projectCertificationInventoryEO) {
//交付物模板-deliverableTemplate
projectCertificationInventoryEO.setDeliverableTemplate(StringUtils.isNotEmpty(certificationInventoryEO.getDeliverableTemplate()) ? certificationInventoryEO.getDeliverableTemplate() : "");
//交付物类型-deliverableType