From 44c675dbebd1957c972b88eeff609c45cfedb5d8 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Wed, 20 Sep 2023 15:15:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E4=B8=AD-=E5=A4=84=E7=90=86=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=BB=B6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 159 ++++++++++++------ 1 file changed, 104 insertions(+), 55 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index 54b295aee..a18d0c095 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -11740,6 +11740,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl lawsInventoryIdList = new ArrayList<>(); List inventoryIdList = new ArrayList<>(); + List fileIdList = new ArrayList<>(); List userIdList = new ArrayList<>(); if(!result.isEmpty()){ lawsInventoryIdList = result.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); @@ -11755,12 +11756,20 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl collect1 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDutyId).distinct().collect(Collectors.toList()); List collect2 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDutyId).distinct().collect(Collectors.toList()); + List collect3 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDeliverableTemplate).distinct().collect(Collectors.toList()); + List collect4 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDeliverableTemplate).distinct().collect(Collectors.toList()); if(!collect1.isEmpty()){ userIdList.addAll(collect1); } if(!collect2.isEmpty()){ userIdList.addAll(collect2); } + if(!collect3.isEmpty()){ + fileIdList.addAll(collect3); + } + if(!collect4.isEmpty()){ + fileIdList.addAll(collect4); + } } } } @@ -11768,8 +11777,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl categoryList = sysCategoryService.list(); //文件 List fileInfos = new ArrayList<>(); - if (inventoryIdList.size() != 0) { - fileInfos = iOSSFileService.getFileInfos(StringUtils.join(inventoryIdList, ",")); + if (fileIdList.size() != 0) { + fileInfos = iOSSFileService.getFileInfos(StringUtils.join(fileIdList, ",")); } List sysUsers = new ArrayList<>(); if (CollectionUtils.isNotEmpty(userIdList)) { @@ -11778,6 +11787,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl projectLawsInventoryEOList = new ArrayList<>(); String cut = projectLawsInventoryEO.getCut(); for (ProjectLawsInventoryEO lawsInventoryEO : result) { if(!lawsInventoryPlatformEOList.isEmpty()){ @@ -11789,65 +11799,104 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl lawsInventoryEOS = projectLawsInventoryEOS.stream() .filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); lawsInventoryEO.setProjectLawsInventoryEOS(lawsInventoryEOS); + if(!lawsInventoryEOS.isEmpty()){ + projectLawsInventoryEOList.addAll(lawsInventoryEOS); + } //如果关联平台件数据不为空,编辑时将设计符合性和验证符合性的数据覆盖 if(!lawsInventoryEOS.isEmpty()){ - ProjectLawsInventoryEO inventoryEO = lawsInventoryEOS.get(0); - //设计 - String designDeliverableType = inventoryEO.getDesignDeliverableType();//交付物类型 - String designDutyId = inventoryEO.getDesignDutyId();//责任人 - String designDeliverableTemplate = inventoryEO.getDesignDeliverableTemplate();//交付物模板 - //验证 - String verifyDeliverableType = inventoryEO.getVerifyDeliverableType();//交付物类型 - String verifyDutyId = inventoryEO.getVerifyDutyId();//责任人 - String verifyDeliverableTemplate = inventoryEO.getVerifyDeliverableTemplate();//交付物模板 - //设计交付物类型 - if (StringUtils.isNotBlank(designDeliverableType)) { - lawsInventoryEO.setDesignDeliverableType(designDeliverableType); - List designDeliverableTypeList = Arrays.asList(designDeliverableType.split(",")); - String name = getTreeName(cut, categoryList, designDeliverableTypeList); - lawsInventoryEO.setDesignDeliverableTypeName(name); - } - //验证交付物类型 - if (StringUtils.isNotBlank(verifyDeliverableType)) { - lawsInventoryEO.setVerifyDeliverableType(verifyDeliverableType); - List verifyDeliverableTypeList = Arrays.asList(verifyDeliverableType.split(",")); - String name = getTreeName(cut, categoryList, verifyDeliverableTypeList); - lawsInventoryEO.setVerifyDeliverableTypeName(name); - } - //交付物类型模板 - if (fileInfos.size() != 0) { - if (StringUtils.isNotBlank(designDeliverableTemplate)) { - lawsInventoryEO.setDesignDeliverableTemplate(designDeliverableTemplate); - String fileName = this.editService.getFileName(null, fileInfos, designDeliverableTemplate); - if (StringUtils.isNotBlank(fileName)) { - lawsInventoryEO.setDesignDeliverableTemplateName(fileName); + for (ProjectLawsInventoryEO inventoryEO : lawsInventoryEOS) { + //设计 + String designDeliverableType = inventoryEO.getDesignDeliverableType();//交付物类型 + String designDutyId = inventoryEO.getDesignDutyId();//责任人 + String designDeliverableTemplate = inventoryEO.getDesignDeliverableTemplate();//交付物模板 + //验证 + String verifyDeliverableType = inventoryEO.getVerifyDeliverableType();//交付物类型 + String verifyDutyId = inventoryEO.getVerifyDutyId();//责任人 + String verifyDeliverableTemplate = inventoryEO.getVerifyDeliverableTemplate();//交付物模板 + //设计交付物类型 + if (StringUtils.isNotBlank(designDeliverableType)) { +// lawsInventoryEO.setDesignDeliverableType(designDeliverableType); + List designDeliverableTypeList = Arrays.asList(designDeliverableType.split(",")); + String name = getTreeName(cut, categoryList, designDeliverableTypeList); + inventoryEO.setDesignDeliverableTypeName(name); + } + //验证交付物类型 + if (StringUtils.isNotBlank(verifyDeliverableType)) { +// lawsInventoryEO.setVerifyDeliverableType(verifyDeliverableType); + List verifyDeliverableTypeList = Arrays.asList(verifyDeliverableType.split(",")); + String name = getTreeName(cut, categoryList, verifyDeliverableTypeList); + inventoryEO.setVerifyDeliverableTypeName(name); + } + //交付物类型模板 + if (fileInfos.size() != 0) { + if (StringUtils.isNotBlank(designDeliverableTemplate)) { +// lawsInventoryEO.setDesignDeliverableTemplate(designDeliverableTemplate); + String fileName = this.editService.getFileName(null, fileInfos, designDeliverableTemplate); + if (StringUtils.isNotBlank(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); - String fileName = this.editService.getFileName(null, fileInfos, verifyDeliverableTemplate); - if (StringUtils.isNotBlank(fileName)) { - lawsInventoryEO.setVerifyDeliverableTemplateName(fileName); - } + //设计责任人 + if (StringUtils.isNotEmpty(designDutyId)) { +// lawsInventoryEO.setVerifyDutyId(designDutyId); + String designDutyName = sysUsers.stream().filter(e -> designDutyId.equals(e.getId())). + 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(",")); - lawsInventoryEO.setDesignDutyIdName(designDutyName); - } else { - lawsInventoryEO.setDesignDutyIdName(""); - } - //验证责任人 - if (StringUtils.isNotEmpty(verifyDutyId)) { - lawsInventoryEO.setVerifyDutyId(verifyDutyId); - String verifyDutyName = sysUsers.stream().filter(e -> verifyDutyId.equals(e.getId())). - map(SysUser::getUsername).collect(Collectors.joining(",")); - lawsInventoryEO.setVerifyDutyIdName(verifyDutyName); - } else { - lawsInventoryEO.setVerifyDutyIdName(""); + } + } + } + } + if(!projectLawsInventoryEOList.isEmpty()){ + List projectLibraryIdList = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(ProjectLibraryBase::getId,projectLibraryIdList); + List libraryBaseList = projectLibraryBaseService.list(wrapper); + for (ProjectLawsInventoryEO lawsInventoryEO : result) { + List lawsInventoryEOS = lawsInventoryEO.getProjectLawsInventoryEOS(); + if(!lawsInventoryEOS.isEmpty()){ + for (ProjectLawsInventoryEO inventoryEO : lawsInventoryEOS) { + List collect = libraryBaseList.stream().filter(e -> inventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); + if(!collect.isEmpty()){ + inventoryEO.setProjectName(collect.get(0).getProjectNameId()); } } }