From 15257448672f5ad1e1a3f2296fbd379e16131a53 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Wed, 20 Sep 2023 10:05:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95->=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/ProjectLawsInventoryEO.java | 4 + .../ProjectLawsInventoryEOServiceImpl.java | 128 ++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java index 34c78aec1..d65ae364c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java @@ -15,6 +15,7 @@ import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -539,4 +540,7 @@ public class ProjectLawsInventoryEO implements Serializable { @TableField(exist = false) private String projectName;//项目名称 + + @TableField(exist = false) + private List projectLawsInventoryEOS; } 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 ae9423dc4..0d5fdee66 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 @@ -289,6 +289,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl pageList = this.page(page, queryWrapper); List result = pageList.getRecords(); + //关联平台件数据 + platformDispose(projectLawsInventoryEO, result); + this.dataDispose(result,currentUser,isProjectRole,projectLawsInventoryEO.getCut()); this.dataDictDispose(result,projectLawsInventoryEO.getCut()); //表头排序 @@ -11724,6 +11731,127 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl result) { + List lawsInventoryPlatformEOList = new ArrayList<>(); + List projectLawsInventoryEOS = new ArrayList<>(); + + List lawsInventoryIdList = new ArrayList<>(); + List inventoryIdList = new ArrayList<>(); + List userIdList = new ArrayList<>(); + if(!result.isEmpty()){ + lawsInventoryIdList = result.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,lawsInventoryIdList); + lawsInventoryPlatformEOList = lawsInventoryPlatformEOService.list(wrapper); + if(!lawsInventoryPlatformEOList.isEmpty()){ + List collect = lawsInventoryPlatformEOList.stream().map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).distinct().collect(Collectors.toList()); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(ProjectLawsInventoryEO::getId,collect); + projectLawsInventoryEOS = this.list(lambdaQueryWrapper); + if(!projectLawsInventoryEOS.isEmpty()){ + inventoryIdList = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); + List collect1 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDutyId).distinct().collect(Collectors.toList()); + List collect2 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDutyId).distinct().collect(Collectors.toList()); + if(!collect1.isEmpty()){ + userIdList.addAll(collect1); + } + if(!collect2.isEmpty()){ + userIdList.addAll(collect2); + } + } + } + } + //树形结构数据字典(技术领域) + List categoryList = sysCategoryService.list(); + //文件 + List fileInfos = new ArrayList<>(); + if (inventoryIdList.size() != 0) { + fileInfos = iOSSFileService.getFileInfos(StringUtils.join(inventoryIdList, ",")); + } + List sysUsers = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(userIdList)) { + userIdList = userIdList.stream().distinct().collect(Collectors.toList()); + QueryWrapper sysUserQueryWrapper = new QueryWrapper<>(); + sysUserQueryWrapper.lambda().in(SysUser::getId, userIdList); + sysUsers = sysUserMapper.selectList(sysUserQueryWrapper); + } + String cut = projectLawsInventoryEO.getCut(); + for (ProjectLawsInventoryEO lawsInventoryEO : result) { + if(!lawsInventoryPlatformEOList.isEmpty()){ + List inventoryPlatformEOList = lawsInventoryPlatformEOList.stream() + .filter(e -> lawsInventoryEO.getId().equals(e.getLawsInventoryId())).collect(Collectors.toList()); + if(!inventoryPlatformEOList.isEmpty()){ + List idList = inventoryPlatformEOList.stream() + .map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).collect(Collectors.toList()); + List lawsInventoryEOS = projectLawsInventoryEOS.stream() + .filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); + lawsInventoryEO.setProjectLawsInventoryEOS(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); + } + } + 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(",")); + 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(""); + } + } + } + } + } + } + @Override public Result finalizationVerify(Map params) { boolean result = false; // 返回true,可以定版,返回false 不能定版