热认证清单关联平台件

This commit is contained in:
zhn
2023-09-21 18:22:38 +08:00
parent 00552ddbe3
commit 251453b33f
@@ -7055,6 +7055,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
List<ProjectCertificationInventoryEO> result = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
//类别
String category = projectCertificationInventoryEO.getCategory();
@@ -7067,6 +7069,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
//责任领域
String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory();
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = new ArrayList<>();
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO certificationInventoryEO : certificationInventoryEOS) {
List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseList.stream()
.filter(e -> certificationInventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
@@ -7087,7 +7092,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){
//如果车型项目库中的配置项为空或为标配时直接将平台件信息添加到关联表
setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
projectCertificationInventoryEOList.add(certificationInventoryEO);
}else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){
//如果车型项目库中的配置项不为空且不为标配时如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致则不再匹配
//如果一致则用类别检验项目编号责任领域去做匹配
@@ -7096,10 +7102,32 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
&& inspectionItem.equals(inspectionItemTemp)
&& serialNumber.equals(serialNumberTemp)
&& dutyTerritory.equals(dutyTerritoryTemp)){
setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
projectCertificationInventoryEOList.add(certificationInventoryEO);
}
}
}
if(!projectCertificationInventoryEOList.isEmpty()){
setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, projectCertificationInventoryEOList.get(0));
if(projectCertificationInventoryEOList.size() > 1){
//往认证清单表中添加projectCertificationInventoryEOList.size()-1条数据
List<ProjectCertificationInventoryEO> list = new ArrayList<>();
for (int i = 1; i < projectCertificationInventoryEOList.size(); i++) {
ProjectCertificationInventoryEO projectCertificationInventoryEOTemp = new ProjectCertificationInventoryEO();
BeanUtils.copyProperties(projectCertificationInventoryEO,projectCertificationInventoryEOTemp);
projectCertificationInventoryEOTemp.setId(UUID.randomUUID().toString().replace("-", ""));
list.add(projectCertificationInventoryEOTemp);
setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEOTemp, projectCertificationInventoryEOList.get(i));
}
if(!list.isEmpty()){
result.addAll(list);
}
}
}
}
if(!result.isEmpty()){
this.saveBatch(result);
}
if(!lawsInventoryPlatformEOS.isEmpty()){
lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS);