Merge remote-tracking branch 'origin/dev_20230912_Platform' into dev_20230912_Platform

This commit is contained in:
zyx.net
2023-09-21 17:03:19 +08:00
@@ -6855,95 +6855,95 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
*
* @return
*/
@Override
public void listPlatform(Map<String,Object> params) {
String ids = (String) params.get("ids");//认证清单id
String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id
//认证清单数据
LambdaQueryWrapper<ProjectCertificationInventoryEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(",")));
List<ProjectCertificationInventoryEO> certificationInventoryEOList = this.list(wrapper);
//平台件项目对应的认证清单数据
LambdaQueryWrapper<ProjectCertificationInventoryEO> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(projectLibraryIds.split(",")));
List<ProjectCertificationInventoryEO> certificationInventoryEOS = this.list(wrapper1);
if(!certificationInventoryEOS.isEmpty()){
//平台件项目信息
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
if(!certificationInventoryEOList.isEmpty()){
List<String> projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList());
LambdaQueryWrapper<ProjectLibraryBase> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.in(ProjectLibraryBase::getId,projectIdList);
projectLibraryBaseList = projectLibraryBaseService.list(wrapper2);
}
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
//类别
String category = projectCertificationInventoryEO.getCategory();
//检验项目
String inspectionItem = projectCertificationInventoryEO.getInspectionItem();
//配置项
String configItem = projectCertificationInventoryEO.getConfigItem();
//编号
String serialNumber = projectCertificationInventoryEO.getSerialNumber();
//责任领域
String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory();
List<ProjectCertificationInventoryEO> result = new ArrayList<>();
//如果车型项目库中的配置项为空或为标配时不去匹配直接关联
if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){
if(!certificationInventoryEOS.isEmpty()){
result = setData(certificationInventoryEOS, projectCertificationInventoryEO);
}
}else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){
//如果车型项目库中的配置项不为空且不为标配时如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致则不再匹配
//如果一致则用类别检验项目编号责任领域去做匹配
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS = new ArrayList<>();
for (int i = 0; i < certificationInventoryEOS.size(); i++) {
int finalI = i;
List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseList.stream()
.filter(e -> certificationInventoryEOS.get(finalI).getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
//平台件项目库中的认证清单的配置项为平台件项目名称
String configItemTemp = "";
if(!libraryBaseList.isEmpty()){
//配置项
configItemTemp = libraryBaseList.get(0).getProjectNameId();
}
//类别
String categoryTemp = certificationInventoryEOS.get(i).getCategory();
//检验项目
String inspectionItemTemp = certificationInventoryEOS.get(i).getInspectionItem();
//编号
String serialNumberTemp = certificationInventoryEOS.get(i).getSerialNumber();
//责任领域
String dutyTerritoryTemp = certificationInventoryEOS.get(i).getDutyTerritory();
if(configItem.equals(configItemTemp)
&& category.equals(categoryTemp)
&& inspectionItem.equals(inspectionItemTemp)
&& serialNumber.equals(serialNumberTemp)
&& dutyTerritory.equals(dutyTerritoryTemp)){
projectCertificationInventoryEOS.add(certificationInventoryEOS.get(i));
}
}
if(!projectCertificationInventoryEOS.isEmpty()){
result = setData(projectCertificationInventoryEOS, projectCertificationInventoryEO);
}
}
if(!result.isEmpty()){
this.saveOrUpdateBatch(result);
}
}
}
}
// @Override
// public void listPlatform(Map<String,Object> params) {
// String ids = (String) params.get("ids");//认证清单id
// String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id
//
// //认证清单数据
// LambdaQueryWrapper<ProjectCertificationInventoryEO> wrapper = new LambdaQueryWrapper<>();
// wrapper.in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(",")));
// List<ProjectCertificationInventoryEO> certificationInventoryEOList = this.list(wrapper);
//
// //平台件项目对应的认证清单数据
// LambdaQueryWrapper<ProjectCertificationInventoryEO> wrapper1 = new LambdaQueryWrapper<>();
// wrapper1.in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(projectLibraryIds.split(",")));
// List<ProjectCertificationInventoryEO> certificationInventoryEOS = this.list(wrapper1);
//
// if(!certificationInventoryEOS.isEmpty()){
// //平台件项目信息
// List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
// if(!certificationInventoryEOList.isEmpty()){
// List<String> projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList());
// LambdaQueryWrapper<ProjectLibraryBase> wrapper2 = new LambdaQueryWrapper<>();
// wrapper2.in(ProjectLibraryBase::getId,projectIdList);
// projectLibraryBaseList = projectLibraryBaseService.list(wrapper2);
// }
//
// List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
//
// List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
// for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
// //类别
// String category = projectCertificationInventoryEO.getCategory();
// //检验项目
// String inspectionItem = projectCertificationInventoryEO.getInspectionItem();
// //配置项
// String configItem = projectCertificationInventoryEO.getConfigItem();
// //编号
// String serialNumber = projectCertificationInventoryEO.getSerialNumber();
// //责任领域
// String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory();
//
// List<ProjectCertificationInventoryEO> result = new ArrayList<>();
// //如果车型项目库中的配置项为空或为标配时不去匹配直接关联
// if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){
// if(!certificationInventoryEOS.isEmpty()){
// result = setData(certificationInventoryEOS, projectCertificationInventoryEO);
// }
// }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){
// //如果车型项目库中的配置项不为空且不为标配时如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致则不再匹配
// //如果一致则用类别检验项目编号责任领域去做匹配
//
// List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS = new ArrayList<>();
// for (int i = 0; i < certificationInventoryEOS.size(); i++) {
// int finalI = i;
// List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseList.stream()
// .filter(e -> certificationInventoryEOS.get(finalI).getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
// //平台件项目库中的认证清单的配置项为平台件项目名称
// String configItemTemp = "";
// if(!libraryBaseList.isEmpty()){
// //配置项
// configItemTemp = libraryBaseList.get(0).getProjectNameId();
// }
// //类别
// String categoryTemp = certificationInventoryEOS.get(i).getCategory();
// //检验项目
// String inspectionItemTemp = certificationInventoryEOS.get(i).getInspectionItem();
// //编号
// String serialNumberTemp = certificationInventoryEOS.get(i).getSerialNumber();
// //责任领域
// String dutyTerritoryTemp = certificationInventoryEOS.get(i).getDutyTerritory();
//
// if(configItem.equals(configItemTemp)
// && category.equals(categoryTemp)
// && inspectionItem.equals(inspectionItemTemp)
// && serialNumber.equals(serialNumberTemp)
// && dutyTerritory.equals(dutyTerritoryTemp)){
//
// projectCertificationInventoryEOS.add(certificationInventoryEOS.get(i));
// }
// }
// if(!projectCertificationInventoryEOS.isEmpty()){
// result = setData(projectCertificationInventoryEOS, projectCertificationInventoryEO);
// }
// }
// if(!result.isEmpty()){
// this.saveOrUpdateBatch(result);
// }
// }
// }
// }
private List<ProjectCertificationInventoryEO> setData(List<ProjectCertificationInventoryEO> certificationInventoryEOS,
ProjectCertificationInventoryEO projectCertificationInventoryEO) {
@@ -6968,22 +6968,116 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
private void setProjectCertificationInventoryEO(ProjectCertificationInventoryEO certificationInventoryEO, ProjectCertificationInventoryEO projectCertificationInventoryEO) {
//交付物模板-deliverableTemplate
projectCertificationInventoryEO.setDeliverableTemplate(certificationInventoryEO.getDeliverableTemplate());
projectCertificationInventoryEO.setDeliverableTemplate(StringUtils.isNotEmpty(certificationInventoryEO.getDeliverableTemplate()) ? certificationInventoryEO.getDeliverableTemplate() : "");
//交付物类型-deliverableType
projectCertificationInventoryEO.setDeliverableType(certificationInventoryEO.getDeliverableType());
projectCertificationInventoryEO.setDeliverableType(StringUtils.isNotEmpty(certificationInventoryEO.getDeliverableType()) ? certificationInventoryEO.getDeliverableType() : "");
//交付结果-deliveryResult
projectCertificationInventoryEO.setDeliveryResult(certificationInventoryEO.getDeliveryResult());
projectCertificationInventoryEO.setDeliveryResult(StringUtils.isNotEmpty(certificationInventoryEO.getDeliveryResult()) ? certificationInventoryEO.getDeliveryResult() : "");
//截止日期-endTime
projectCertificationInventoryEO.setEndTime(certificationInventoryEO.getEndTime());
//流程状态-flowStatus
projectCertificationInventoryEO.setFlowStatus(certificationInventoryEO.getFlowStatus());
projectCertificationInventoryEO.setFlowStatus(StringUtils.isNotEmpty(certificationInventoryEO.getFlowStatus()) ? certificationInventoryEO.getFlowStatus() : "");
//报告编号-reportNumber
projectCertificationInventoryEO.setReportNumber(certificationInventoryEO.getReportNumber());
projectCertificationInventoryEO.setReportNumber(StringUtils.isNotEmpty(certificationInventoryEO.getReportNumber()) ? certificationInventoryEO.getReportNumber() : "");
//产品型号-productModel
projectCertificationInventoryEO.setProductModel(certificationInventoryEO.getProductModel());
projectCertificationInventoryEO.setProductModel(StringUtils.isNotEmpty(certificationInventoryEO.getProductModel()) ? certificationInventoryEO.getProductModel() : "");
//生产企业名称-productionEnterpriseName
projectCertificationInventoryEO.setProductionEnterpriseName(certificationInventoryEO.getProductionEnterpriseName());
projectCertificationInventoryEO.setProductionEnterpriseName(StringUtils.isNotEmpty(certificationInventoryEO.getProductionEnterpriseName()) ? certificationInventoryEO.getProductionEnterpriseName() : "");
}
/**
* 勾选认证清单进行关联平台件
*
* @return
*/
@Override
public void listPlatform(Map<String,Object> params) {
String cut = (String) params.get("cut");//
String ids = (String) params.get("ids");//认证清单id
String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id
//认证清单数据
LambdaQueryWrapper<ProjectCertificationInventoryEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(",")));
List<ProjectCertificationInventoryEO> certificationInventoryEOList = this.list(wrapper);
//平台件项目对应的认证清单数据
LambdaQueryWrapper<ProjectCertificationInventoryEO> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(projectLibraryIds.split(",")));
List<ProjectCertificationInventoryEO> certificationInventoryEOS = this.list(wrapper1);
//平台件项目信息
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
if(!certificationInventoryEOList.isEmpty()){
List<String> projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList());
LambdaQueryWrapper<ProjectLibraryBase> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.in(ProjectLibraryBase::getId,projectIdList);
projectLibraryBaseList = projectLibraryBaseService.list(wrapper2);
}
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
//类别
String category = projectCertificationInventoryEO.getCategory();
//检验项目
String inspectionItem = projectCertificationInventoryEO.getInspectionItem();
//配置项
String configItem = projectCertificationInventoryEO.getConfigItem();
//编号
String serialNumber = projectCertificationInventoryEO.getSerialNumber();
//责任领域
String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory();
for (ProjectCertificationInventoryEO certificationInventoryEO : certificationInventoryEOS) {
List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseList.stream()
.filter(e -> certificationInventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
//平台件项目库中的认证清单的配置项为平台件项目名称
String configItemTemp = "";
if(!libraryBaseList.isEmpty()){
//配置项
configItemTemp = libraryBaseList.get(0).getProjectNameId();
}
//类别
String categoryTemp = certificationInventoryEO.getCategory();
//检验项目
String inspectionItemTemp = certificationInventoryEO.getInspectionItem();
//编号
String serialNumberTemp = certificationInventoryEO.getSerialNumber();
//责任领域
String dutyTerritoryTemp = certificationInventoryEO.getDutyTerritory();
if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){
//如果车型项目库中的配置项为空或为标配时直接将平台件信息添加到关联表
setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
}else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){
//如果车型项目库中的配置项不为空且不为标配时如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致则不再匹配
//如果一致则用类别检验项目编号责任领域去做匹配
if(configItem.equals(configItemTemp)
&& category.equals(categoryTemp)
&& inspectionItem.equals(inspectionItemTemp)
&& serialNumber.equals(serialNumberTemp)
&& dutyTerritory.equals(dutyTerritoryTemp)){
setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
}
}
}
}
if(!lawsInventoryPlatformEOS.isEmpty()){
lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS);
}
}
private void setDataTemp(List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS,
ProjectCertificationInventoryEO projectCertificationInventoryEO,
ProjectCertificationInventoryEO certificationInventoryEO) {
LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO();
inventoryPlatformEO.setCreateTime(new Date());
inventoryPlatformEO.setUpdateTime(new Date());
inventoryPlatformEO.setLawsInventoryId(projectCertificationInventoryEO.getId());
inventoryPlatformEO.setPlatformLawsInventoryId(certificationInventoryEO.getId());
lawsInventoryPlatformEOS.add(inventoryPlatformEO);
}
// @Override
// public void listPlatform(Map<String,Object> params) {
// String cut = (String) params.get("cut");//
// String ids = (String) params.get("ids");//认证清单id
@@ -7011,8 +7105,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
//
// for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
// Map<String,Object> map = new HashMap<>();
// List<ProjectLawsInventoryEO> projectLawsInventoryEOS = new ArrayList<>();
// //类别
// String category = projectCertificationInventoryEO.getCategory();
// //检验项目
@@ -7044,7 +7136,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
//
// if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){
// //如果车型项目库中的配置项为空或为标配时直接将平台件信息添加到关联表
// setData(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
// setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
// }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){
// //如果车型项目库中的配置项不为空且不为标配时如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致则不再匹配
// //如果一致则用类别检验项目编号责任领域去做匹配
@@ -7053,7 +7145,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// && inspectionItem.equals(inspectionItemTemp)
// && serialNumber.equals(serialNumberTemp)
// && dutyTerritory.equals(dutyTerritoryTemp)){
// setData(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
// setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO);
// }
// }
// }
@@ -7063,4 +7155,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// }
// }
}