From 038300545d37a1407c668a4c37d3a1d65ef8d8e7 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Sat, 4 Mar 2023 11:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/DefaultDeclaredProjectManage.java | 43 ++++++++-------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java index f3dba7e..c05d4b7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java @@ -85,44 +85,31 @@ public class DefaultDeclaredProjectManage { OrgInfoDTO startOrgInfoDto = new OrgInfoDTO(); startOrgInfoDto.setOrganizationCode(startOrgCode); startOrgInfoDto.setOrganizationName(startOrgName); - Map startOrgModelsMap = orgModelsList.stream() - .filter(v -> v.getOrgCode().equals(startOrgCode)) - .filter(v -> StringUtils.isNotEmpty(model.getProcessDefId()) && - v.getProcessDefId().equals(model.getProcessDefId())) - .filter(v -> Boolean.FALSE.equals(v.getIsDelete())).collect(Collectors.toMap(m -> { - if (ProcessDefTypeEnum.SEAL.name().equals(m.getType()) || - ProcessDefTypeEnum.DEFAULT.name().equals(m.getType())) { - return m.getType(); - } - return m.getProcessDefId(); - }, v -> v)); - startOrgInfoDto.setOrgModelMap(startOrgModelsMap); + + startOrgInfoDto.setOrgModelMap(orgModelsList.stream() + .filter(v -> v.getOrgCode().equals(startOrgCode) + && Boolean.FALSE.equals(v.getIsDelete()) + && (ProcessDefTypeEnum.SEAL.name().equals(v.getType()) || + ProcessDefTypeEnum.DEFAULT.name().equals(v.getType()))) + .collect(Collectors.toMap(WflowOrgModels::getType, v -> v))); OrgInfoDTO parentOrgInfoDto = new OrgInfoDTO(); parentOrgInfoDto.setOrganizationCode(startOrgParentCode); parentOrgInfoDto.setOrganizationName(startOrgParentName); - Map parentOrgModelMap = orgModelsList.stream() - .filter(v -> v.getOrgCode().equals(startOrgParentCode)) - .filter(v -> StringUtils.isNotEmpty(model.getProcessDefId()) && - v.getProcessDefId().equals(model.getProcessDefId())) - .filter(v -> Boolean.FALSE.equals(v.getIsDelete())).collect(Collectors.toMap(m -> { - if (ProcessDefTypeEnum.SEAL.name().equals(m.getType()) || - ProcessDefTypeEnum.DEFAULT.name().equals(m.getType())) { - return m.getType(); - } - return m.getProcessDefId(); - }, v -> v)); - parentOrgInfoDto.setOrgModelMap(parentOrgModelMap); + parentOrgInfoDto.setOrgModelMap(orgModelsList.stream() + .filter(v -> v.getOrgCode().equals(startOrgParentCode) + && Boolean.FALSE.equals(v.getIsDelete()) + && (ProcessDefTypeEnum.SEAL.name().equals(v.getType()) || + ProcessDefTypeEnum.DEFAULT.name().equals(v.getType()))) + .collect(Collectors.toMap(WflowOrgModels::getType, v -> v))); orgMap.put(OrgTypeEnum.TARGET_OWNER.name(),startOrgInfoDto); orgMap.put(OrgTypeEnum.TARGET_MANAGEMENT.name(),parentOrgInfoDto); // 如果是指定单位,直接根据流程定义ID放入map OrgInfoDTO orgInfoDTO = new OrgInfoDTO(); - Map orgModelMap = orgModelsList.stream() - .filter(v -> v.getProcessDefId().equals(model.getProcessDefId())) - .collect(Collectors.toMap(WflowOrgModels::getProcessDefId, v -> v)); - orgInfoDTO.setOrgModelMap(orgModelMap); + orgInfoDTO.setOrgModelMap(orgModelsList.stream() + .collect(Collectors.toMap(WflowOrgModels::getProcessDefId, v -> v))); orgMap.put(model.getProcessDefId(),orgInfoDTO); return orgMap; }