热认证清单关联平台件
This commit is contained in:
+30
-2
@@ -7055,6 +7055,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
|
|
||||||
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
|
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
|
||||||
|
|
||||||
|
List<ProjectCertificationInventoryEO> result = new ArrayList<>();
|
||||||
|
|
||||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
|
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
|
||||||
//类别
|
//类别
|
||||||
String category = projectCertificationInventoryEO.getCategory();
|
String category = projectCertificationInventoryEO.getCategory();
|
||||||
@@ -7067,6 +7069,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
//责任领域
|
//责任领域
|
||||||
String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory();
|
String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory();
|
||||||
|
|
||||||
|
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = new ArrayList<>();
|
||||||
|
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
|
||||||
|
|
||||||
for (ProjectCertificationInventoryEO certificationInventoryEO : certificationInventoryEOS) {
|
for (ProjectCertificationInventoryEO certificationInventoryEO : certificationInventoryEOS) {
|
||||||
List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseList.stream()
|
List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseList.stream()
|
||||||
.filter(e -> certificationInventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
|
.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)){
|
if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){
|
||||||
//如果车型项目库中的配置项为空或为标配时,直接将平台件信息添加到关联表
|
//如果车型项目库中的配置项为空或为标配时,直接将平台件信息添加到关联表
|
||||||
setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
|
projectCertificationInventoryEOList.add(certificationInventoryEO);
|
||||||
|
|
||||||
}else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){
|
}else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){
|
||||||
//如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配
|
//如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配
|
||||||
//如果一致,则用类别,检验项目,编号,责任领域去做匹配
|
//如果一致,则用类别,检验项目,编号,责任领域去做匹配
|
||||||
@@ -7096,10 +7102,32 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
&& inspectionItem.equals(inspectionItemTemp)
|
&& inspectionItem.equals(inspectionItemTemp)
|
||||||
&& serialNumber.equals(serialNumberTemp)
|
&& serialNumber.equals(serialNumberTemp)
|
||||||
&& dutyTerritory.equals(dutyTerritoryTemp)){
|
&& 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()){
|
if(!lawsInventoryPlatformEOS.isEmpty()){
|
||||||
lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS);
|
lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS);
|
||||||
|
|||||||
Reference in New Issue
Block a user