修改认证清单调取逻辑,不再校验法规清单

This commit is contained in:
gaosong
2023-10-27 10:04:18 +08:00
parent f9877bcd32
commit 3ea2acd84b
@@ -4475,34 +4475,34 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
prpQueryWrap.lambda().eq(ProjectRelatedPersonnel::getProjectId,projectLibraryId);
List<ProjectRelatedPersonnel> prpEoList = this.projectRelatedPersonnelService.list(prpQueryWrap);
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrap = new QueryWrapper<>();
lawsInventoryEOQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryEOQueryWrap);
// QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrap = new QueryWrapper<>();
// lawsInventoryEOQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
// List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryEOQueryWrap);
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
List<String> noSerialNumberList = new ArrayList<>();
for (AuthDummyInventoryInfoEO authDummyInventoryInfoEO : authDummyInventoryInfoEOList) {
if(CollectionUtils.isEmpty(projectLawsInventoryEOList)){
break;
}
// if(CollectionUtils.isEmpty(projectLawsInventoryEOList)){
// break;
// }
// 根据选择调取的数据法规编号跟当前项目中 法规清单数据法规编号对比如果有则加入如果没有则不加入
List<ProjectLawsInventoryEO> lawsInventoryEOListTemp = projectLawsInventoryEOList.stream().filter(lawsInventoryEO -> {
boolean flag = false;
String adiSn = authDummyInventoryInfoEO.getSerialNumber();
BussDocumentLibraryEO bl = iBussDocumentLibraryEOService.getBySerialNumber(adiSn);
if(ObjectUtils.isNotEmpty(bl)){
if (StringUtils.equals(bl.getId(), lawsInventoryEO.getStandId())) {
flag = true;
}
}
// List<ProjectLawsInventoryEO> lawsInventoryEOListTemp = projectLawsInventoryEOList.stream().filter(lawsInventoryEO -> {
// boolean flag = false;
// String adiSn = authDummyInventoryInfoEO.getSerialNumber();
// BussDocumentLibraryEO bl = iBussDocumentLibraryEOService.getBySerialNumber(adiSn);
// if(ObjectUtils.isNotEmpty(bl)){
// if (StringUtils.equals(bl.getId(), lawsInventoryEO.getStandId())) {
// flag = true;
// }
// }
//
// return flag;
// }).collect(Collectors.toList());
return flag;
}).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(lawsInventoryEOListTemp)){
// if(CollectionUtils.isNotEmpty(lawsInventoryEOListTemp)){
ProjectCertificationInventoryEO projectCertificationInventoryEOTemp = new ProjectCertificationInventoryEO();
BeanUtils.copyProperties(authDummyInventoryInfoEO,projectCertificationInventoryEOTemp);
@@ -4549,20 +4549,20 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
projectCertificationInventoryEOTemp.setUpdateTime(new Date());
projectCertificationInventoryEOTemp.setCertificationProgress(CertificationProgressEnum.NOT_START.getValue());
projectCertificationInventoryEOList.add(projectCertificationInventoryEOTemp);
}else {
noSerialNumberList.add(authDummyInventoryInfoEO.getSerialNumber());
}
// }else {
// noSerialNumberList.add(authDummyInventoryInfoEO.getSerialNumber());
// }
}
if(CollectionUtils.isNotEmpty(noSerialNumberList)){
// 判断调取的数据中是否有 在当前项目库法规清单中 没有的编号
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
result.add("您所选的数据中包含当前项目中不包含的法规编号信息,已为您过滤添加。");
}else {
result.add("The data you have selected contains regulatory number information that is not included in the current project, and has been filtered and added for you.");
}
}
// if(CollectionUtils.isNotEmpty(noSerialNumberList)){
// // 判断调取的数据中是否有 在当前项目库法规清单中 没有的编号
// if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
// result.add("您所选的数据中包含当前项目中不包含的法规编号信息,已为您过滤添加。");
// }else {
// result.add("The data you have selected contains regulatory number information that is not included in the current project, and has been filtered and added for you.");
// }
// }
// List<ProjectCertificationInventoryEO> saveDataList = this.dataUniqueCheck(projectCertificationInventoryEOList, cut, result, projectLibraryId);
@@ -5457,22 +5457,22 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
}else{
//验证编号在法规清单中是否存在
LambdaQueryWrapper<ProjectLawsInventoryEO> lwrapper = new LambdaQueryWrapper<>();
lwrapper.in(ProjectLawsInventoryEO::getSerialNumber,serialNumberList);
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOService.list(lwrapper);
List<String> LawSerialNumberListTemp = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.toList());
if(serialNumberList.size() != LawSerialNumberListTemp.size()){
//存在法规清单中没有的数据
List<String> collect = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).collect(Collectors.toList());
List<String> serialNumbers = serialNumberList.stream().filter(e -> !collect.contains(e)).collect(Collectors.toList());
if(serialNumbers.size() > 0){
if(CutEnum.CN.getValue().equals(datas.get(0).getCut())){
throw new JeroBootException(StringUtils.join(serialNumbers,",")+"法规清单中不存在,不能添加");
}else{
throw new JeroBootException(StringUtils.join(serialNumbers,",")+" does not exist in the project laws and cannot be added");
}
}
}
// LambdaQueryWrapper<ProjectLawsInventoryEO> lwrapper = new LambdaQueryWrapper<>();
// lwrapper.in(ProjectLawsInventoryEO::getSerialNumber,serialNumberList);
// List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOService.list(lwrapper);
// List<String> LawSerialNumberListTemp = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.toList());
// if(serialNumberList.size() != LawSerialNumberListTemp.size()){
// //存在法规清单中没有的数据
// List<String> collect = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).collect(Collectors.toList());
// List<String> serialNumbers = serialNumberList.stream().filter(e -> !collect.contains(e)).collect(Collectors.toList());
// if(serialNumbers.size() > 0){
// if(CutEnum.CN.getValue().equals(datas.get(0).getCut())){
// throw new JeroBootException(StringUtils.join(serialNumbers,",")+"法规清单中不存在,不能添加");
// }else{
// throw new JeroBootException(StringUtils.join(serialNumbers,",")+" does not exist in the project laws and cannot be added");
// }
// }
// }
// else{
// for (ProjectCertificationInventoryEO projectCertificationInventoryEO : datas) {
// List<BussDocumentLibraryEO> collect = bussDocumentLibraryEOList.stream()