法规清单分页中-处理平台件信息

This commit is contained in:
zhn
2023-09-20 15:15:25 +08:00
parent 584e7928bb
commit 44c675dbeb
@@ -11740,6 +11740,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
List<String> lawsInventoryIdList = new ArrayList<>(); List<String> lawsInventoryIdList = new ArrayList<>();
List<String> inventoryIdList = new ArrayList<>(); List<String> inventoryIdList = new ArrayList<>();
List<String> fileIdList = new ArrayList<>();
List<String> userIdList = new ArrayList<>(); List<String> userIdList = new ArrayList<>();
if(!result.isEmpty()){ if(!result.isEmpty()){
lawsInventoryIdList = result.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); lawsInventoryIdList = result.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
@@ -11755,12 +11756,20 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
inventoryIdList = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); inventoryIdList = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
List<String> collect1 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDutyId).distinct().collect(Collectors.toList()); List<String> collect1 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDutyId).distinct().collect(Collectors.toList());
List<String> collect2 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDutyId).distinct().collect(Collectors.toList()); List<String> collect2 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDutyId).distinct().collect(Collectors.toList());
List<String> collect3 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDeliverableTemplate).distinct().collect(Collectors.toList());
List<String> collect4 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDeliverableTemplate).distinct().collect(Collectors.toList());
if(!collect1.isEmpty()){ if(!collect1.isEmpty()){
userIdList.addAll(collect1); userIdList.addAll(collect1);
} }
if(!collect2.isEmpty()){ if(!collect2.isEmpty()){
userIdList.addAll(collect2); userIdList.addAll(collect2);
} }
if(!collect3.isEmpty()){
fileIdList.addAll(collect3);
}
if(!collect4.isEmpty()){
fileIdList.addAll(collect4);
}
} }
} }
} }
@@ -11768,8 +11777,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
List<SysCategory> categoryList = sysCategoryService.list(); List<SysCategory> categoryList = sysCategoryService.list();
//文件 //文件
List<OSSFile> fileInfos = new ArrayList<>(); List<OSSFile> fileInfos = new ArrayList<>();
if (inventoryIdList.size() != 0) { if (fileIdList.size() != 0) {
fileInfos = iOSSFileService.getFileInfos(StringUtils.join(inventoryIdList, ",")); fileInfos = iOSSFileService.getFileInfos(StringUtils.join(fileIdList, ","));
} }
List<SysUser> sysUsers = new ArrayList<>(); List<SysUser> sysUsers = new ArrayList<>();
if (CollectionUtils.isNotEmpty(userIdList)) { if (CollectionUtils.isNotEmpty(userIdList)) {
@@ -11778,6 +11787,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sysUserQueryWrapper.lambda().in(SysUser::getId, userIdList); sysUserQueryWrapper.lambda().in(SysUser::getId, userIdList);
sysUsers = sysUserMapper.selectList(sysUserQueryWrapper); sysUsers = sysUserMapper.selectList(sysUserQueryWrapper);
} }
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = new ArrayList<>();
String cut = projectLawsInventoryEO.getCut(); String cut = projectLawsInventoryEO.getCut();
for (ProjectLawsInventoryEO lawsInventoryEO : result) { for (ProjectLawsInventoryEO lawsInventoryEO : result) {
if(!lawsInventoryPlatformEOList.isEmpty()){ if(!lawsInventoryPlatformEOList.isEmpty()){
@@ -11789,65 +11799,104 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
List<ProjectLawsInventoryEO> lawsInventoryEOS = projectLawsInventoryEOS.stream() List<ProjectLawsInventoryEO> lawsInventoryEOS = projectLawsInventoryEOS.stream()
.filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); .filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
lawsInventoryEO.setProjectLawsInventoryEOS(lawsInventoryEOS); lawsInventoryEO.setProjectLawsInventoryEOS(lawsInventoryEOS);
if(!lawsInventoryEOS.isEmpty()){
projectLawsInventoryEOList.addAll(lawsInventoryEOS);
}
//如果关联平台件数据不为空,编辑时将设计符合性和验证符合性的数据覆盖 //如果关联平台件数据不为空,编辑时将设计符合性和验证符合性的数据覆盖
if(!lawsInventoryEOS.isEmpty()){ if(!lawsInventoryEOS.isEmpty()){
ProjectLawsInventoryEO inventoryEO = lawsInventoryEOS.get(0); for (ProjectLawsInventoryEO inventoryEO : lawsInventoryEOS) {
//设计 //设计
String designDeliverableType = inventoryEO.getDesignDeliverableType();//交付物类型 String designDeliverableType = inventoryEO.getDesignDeliverableType();//交付物类型
String designDutyId = inventoryEO.getDesignDutyId();//责任人 String designDutyId = inventoryEO.getDesignDutyId();//责任人
String designDeliverableTemplate = inventoryEO.getDesignDeliverableTemplate();//交付物模板 String designDeliverableTemplate = inventoryEO.getDesignDeliverableTemplate();//交付物模板
//验证 //验证
String verifyDeliverableType = inventoryEO.getVerifyDeliverableType();//交付物类型 String verifyDeliverableType = inventoryEO.getVerifyDeliverableType();//交付物类型
String verifyDutyId = inventoryEO.getVerifyDutyId();//责任人 String verifyDutyId = inventoryEO.getVerifyDutyId();//责任人
String verifyDeliverableTemplate = inventoryEO.getVerifyDeliverableTemplate();//交付物模板 String verifyDeliverableTemplate = inventoryEO.getVerifyDeliverableTemplate();//交付物模板
//设计交付物类型 //设计交付物类型
if (StringUtils.isNotBlank(designDeliverableType)) { if (StringUtils.isNotBlank(designDeliverableType)) {
lawsInventoryEO.setDesignDeliverableType(designDeliverableType); // lawsInventoryEO.setDesignDeliverableType(designDeliverableType);
List<String> designDeliverableTypeList = Arrays.asList(designDeliverableType.split(",")); List<String> designDeliverableTypeList = Arrays.asList(designDeliverableType.split(","));
String name = getTreeName(cut, categoryList, designDeliverableTypeList); String name = getTreeName(cut, categoryList, designDeliverableTypeList);
lawsInventoryEO.setDesignDeliverableTypeName(name); inventoryEO.setDesignDeliverableTypeName(name);
} }
//验证交付物类型 //验证交付物类型
if (StringUtils.isNotBlank(verifyDeliverableType)) { if (StringUtils.isNotBlank(verifyDeliverableType)) {
lawsInventoryEO.setVerifyDeliverableType(verifyDeliverableType); // lawsInventoryEO.setVerifyDeliverableType(verifyDeliverableType);
List<String> verifyDeliverableTypeList = Arrays.asList(verifyDeliverableType.split(",")); List<String> verifyDeliverableTypeList = Arrays.asList(verifyDeliverableType.split(","));
String name = getTreeName(cut, categoryList, verifyDeliverableTypeList); String name = getTreeName(cut, categoryList, verifyDeliverableTypeList);
lawsInventoryEO.setVerifyDeliverableTypeName(name); inventoryEO.setVerifyDeliverableTypeName(name);
} }
//交付物类型模板 //交付物类型模板
if (fileInfos.size() != 0) { if (fileInfos.size() != 0) {
if (StringUtils.isNotBlank(designDeliverableTemplate)) { if (StringUtils.isNotBlank(designDeliverableTemplate)) {
lawsInventoryEO.setDesignDeliverableTemplate(designDeliverableTemplate); // lawsInventoryEO.setDesignDeliverableTemplate(designDeliverableTemplate);
String fileName = this.editService.getFileName(null, fileInfos, designDeliverableTemplate); String fileName = this.editService.getFileName(null, fileInfos, designDeliverableTemplate);
if (StringUtils.isNotBlank(fileName)) { if (StringUtils.isNotBlank(fileName)) {
lawsInventoryEO.setDesignDeliverableTemplateName(fileName); inventoryEO.setDesignDeliverableTemplateName(fileName);
}
}
if (StringUtils.isNotBlank(verifyDeliverableTemplate)) {
// lawsInventoryEO.setVerifyDeliverableTemplate(verifyDeliverableTemplate);
String fileName = this.editService.getFileName(null, fileInfos, verifyDeliverableTemplate);
if (StringUtils.isNotBlank(fileName)) {
inventoryEO.setVerifyDeliverableTemplateName(fileName);
}
} }
} }
if (StringUtils.isNotBlank(verifyDeliverableTemplate)) { //设计责任人
lawsInventoryEO.setVerifyDeliverableTemplate(verifyDeliverableTemplate); if (StringUtils.isNotEmpty(designDutyId)) {
String fileName = this.editService.getFileName(null, fileInfos, verifyDeliverableTemplate); // lawsInventoryEO.setVerifyDutyId(designDutyId);
if (StringUtils.isNotBlank(fileName)) { String designDutyName = sysUsers.stream().filter(e -> designDutyId.equals(e.getId())).
lawsInventoryEO.setVerifyDeliverableTemplateName(fileName); map(SysUser::getUsername).collect(Collectors.joining(","));
} inventoryEO.setDesignDutyIdName(designDutyName);
} else {
inventoryEO.setDesignDutyIdName("");
} }
//验证责任人
if (StringUtils.isNotEmpty(verifyDutyId)) {
// lawsInventoryEO.setVerifyDutyId(verifyDutyId);
String verifyDutyName = sysUsers.stream().filter(e -> verifyDutyId.equals(e.getId())).
map(SysUser::getUsername).collect(Collectors.joining(","));
inventoryEO.setVerifyDutyIdName(verifyDutyName);
} else {
inventoryEO.setVerifyDutyIdName("");
}
//设计交付物类型
lawsInventoryEO.setDesignDeliverableType(lawsInventoryEOS.get(0).getDesignDeliverableType());
lawsInventoryEO.setDesignDeliverableTypeName(lawsInventoryEOS.get(0).getDesignDeliverableTypeName());
//验证交付物类型
lawsInventoryEO.setVerifyDeliverableType(lawsInventoryEOS.get(0).getVerifyDeliverableType());
lawsInventoryEO.setVerifyDeliverableTypeName(lawsInventoryEOS.get(0).getVerifyDeliverableTypeName());
//交付物类型模板
lawsInventoryEO.setDesignDeliverableTemplate(lawsInventoryEOS.get(0).getDesignDeliverableTemplate());
lawsInventoryEO.setDesignDeliverableTemplateName(lawsInventoryEOS.get(0).getDesignDeliverableTemplateName());
lawsInventoryEO.setVerifyDeliverableTemplate(lawsInventoryEOS.get(0).getVerifyDeliverableTemplate());
lawsInventoryEO.setVerifyDeliverableTemplateName(lawsInventoryEOS.get(0).getVerifyDeliverableTemplateName());
lawsInventoryEO.setVerifyDutyId(lawsInventoryEOS.get(0).getDesignDutyId());
lawsInventoryEO.setDesignDutyIdName(lawsInventoryEOS.get(0).getDesignDutyIdName());
lawsInventoryEO.setVerifyDutyId(lawsInventoryEOS.get(0).getVerifyDutyId());
lawsInventoryEO.setVerifyDutyIdName(lawsInventoryEOS.get(0).getVerifyDutyIdName());
} }
//设计责任人 }
if (StringUtils.isNotEmpty(designDutyId)) { }
lawsInventoryEO.setVerifyDutyId(designDutyId); }
String designDutyName = sysUsers.stream().filter(e -> designDutyId.equals(e.getId())). }
map(SysUser::getUsername).collect(Collectors.joining(",")); if(!projectLawsInventoryEOList.isEmpty()){
lawsInventoryEO.setDesignDutyIdName(designDutyName); List<String> projectLibraryIdList = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList());
} else { LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
lawsInventoryEO.setDesignDutyIdName(""); wrapper.in(ProjectLibraryBase::getId,projectLibraryIdList);
} List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseService.list(wrapper);
//验证责任人 for (ProjectLawsInventoryEO lawsInventoryEO : result) {
if (StringUtils.isNotEmpty(verifyDutyId)) { List<ProjectLawsInventoryEO> lawsInventoryEOS = lawsInventoryEO.getProjectLawsInventoryEOS();
lawsInventoryEO.setVerifyDutyId(verifyDutyId); if(!lawsInventoryEOS.isEmpty()){
String verifyDutyName = sysUsers.stream().filter(e -> verifyDutyId.equals(e.getId())). for (ProjectLawsInventoryEO inventoryEO : lawsInventoryEOS) {
map(SysUser::getUsername).collect(Collectors.joining(",")); List<ProjectLibraryBase> collect = libraryBaseList.stream().filter(e -> inventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
lawsInventoryEO.setVerifyDutyIdName(verifyDutyName); if(!collect.isEmpty()){
} else { inventoryEO.setProjectName(collect.get(0).getProjectNameId());
lawsInventoryEO.setVerifyDutyIdName("");
} }
} }
} }