From 0c0ea94f13274439749acc41e2cd55d7abbc4a02 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 18 Nov 2024 17:13:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201.=20=E9=A6=96=E9=A1=B5=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=85=B3=E8=81=94=E7=B3=BB=E7=BB=9F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ProjectGovSystemReplaceInfoManage.java | 9 ++++++--- .../model/vo/UnitProjectGovSystemReplaceVO.java | 11 +++++++++++ .../hz/pm/api/workbench/manage/WorkbenchManage.java | 18 ++++++++++-------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java index bf4ba38..56590ea 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java @@ -27,6 +27,8 @@ import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; +import static com.hz.pm.api.workbench.manage.WorkbenchManage.IS_VALID_SYSTEM; + /** *

* ProjectGovSystemReplaceInfoManage @@ -43,7 +45,6 @@ public class ProjectGovSystemReplaceInfoManage { private final IProjectService projectService; private final MhUnitCache mhUnitCache; - public SystemReplaceInfoVO systemReplaceInfos(String targetSystem) { SystemReplaceInfoVO retDetail = new SystemReplaceInfoVO(); LambdaQueryWrapper pgsriQuery; @@ -78,6 +79,8 @@ public class ProjectGovSystemReplaceInfoManage { continue; } ProjectGovSystemReplaceVO projectSystem = new ProjectGovSystemReplaceVO(); + projectSystem.setProjectId(proj.getId()); + projectSystem.setProjectCode(proj.getProjectCode()); projectSystem.setProjectName(proj.getProjectName()); item.getProjectSystemReplaces().add(projectSystem); Map> replaceInfoGroup = CollUtils.group(replaceInfos, @@ -93,13 +96,13 @@ public class ProjectGovSystemReplaceInfoManage { List sourceSystemNames = CollUtils.fieldList(currBatchValues, val -> { String sourceSystem = val.getSourceSystem(); - if (!StrUtil.SLASH.equals(sourceSystem)) { + if (IS_VALID_SYSTEM.test(sourceSystem)) { before.incrementAndGet(); } return sourceSystem; }); replaceInfo.setSourceSystemNames(sourceSystemNames); - if (!StrUtil.SLASH.equals(replaceInfo.getTargetSystemName())) { + if (IS_VALID_SYSTEM.test(replaceInfo.getTargetSystemName())) { after.incrementAndGet(); } return replaceInfo; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/UnitProjectGovSystemReplaceVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/UnitProjectGovSystemReplaceVO.java index d0557f9..0b74f12 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/UnitProjectGovSystemReplaceVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/UnitProjectGovSystemReplaceVO.java @@ -1,6 +1,7 @@ package com.hz.pm.api.projectlib.model.vo; import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @@ -16,15 +17,25 @@ import java.util.List; @Data public class UnitProjectGovSystemReplaceVO { + @ApiModelProperty("单位名称") private String unitName; + @ApiModelProperty("项目信息") private List projectSystemReplaces; @Data public static class ProjectGovSystemReplaceVO { + @ApiModelProperty("项目名称") private String projectName; + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("关联系统信息") private List replaceSystems; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java index 9fc0579..44d2c82 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java @@ -264,9 +264,9 @@ public class WorkbenchManage { int targetCount = 0; for (List currSystems : replaceGroupProject.values()) { sourceCount += CollUtil.count(CollUtils.fieldSet(currSystems, ProjectGovSystemReplaceInfos::getSourceSystem), - isValidSystem::test); + IS_VALID_SYSTEM::test); targetCount += CollUtil.count(CollUtils.fieldSet(currSystems, ProjectGovSystemReplaceInfos::getTargetSystem), - isValidSystem::test); + IS_VALID_SYSTEM::test); } return SystemReplaceStatVO.builder() .sourceCount(sourceCount) @@ -281,7 +281,7 @@ public class WorkbenchManage { return retDetail; } - static Predicate isValidSystem = x -> StrUtil.isNotBlank(x) && !"/".equals(x); + public static final Predicate IS_VALID_SYSTEM = x -> StrUtil.isNotBlank(x) && !"/".equals(x); private Pair countReplaceSystemByProjectIds(Collection projectIds) { List projectCodes = CollUtils.convert(projectIds, ProjectIdCodeCacheUtil::get); @@ -306,9 +306,9 @@ public class WorkbenchManage { Collectors.collectingAndThen(Collectors.toList(), w -> { Set sourceNames = CollUtils.fieldSet(w, ProjectGovSystemReplaceInfos::getSourceSystem); - int sourceCount = CollUtil.count(sourceNames, isValidSystem::test); + int sourceCount = CollUtil.count(sourceNames, IS_VALID_SYSTEM::test); Set targetNames = CollUtils.fieldSet(w, ProjectGovSystemReplaceInfos::getTargetSystem); - int targetCount = CollUtil.count(targetNames, isValidSystem::test); + int targetCount = CollUtil.count(targetNames, IS_VALID_SYSTEM::test); return Pair.create(sourceCount, targetCount); }))).values(); int totalTargetCount = 0; @@ -718,7 +718,7 @@ public class WorkbenchManage { } query.notIn(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode() , ProjectStatus.STOPPED_PASSED.getCode()) - .select(Project::getProjectCode, Project::getProjectName, + .select(Project::getProjectCode, Project::getProjectName, Project::getId, Project::getBuildOrgCode, Project::getBuildOrgName); projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT); switch (req.getProcessNode()) { @@ -819,6 +819,8 @@ public class WorkbenchManage { List replaceInfos = projectSystemMap.get(proj.getProjectCode()); if (replaceInfos != null) { ProjectGovSystemReplaceVO projectSystem = new ProjectGovSystemReplaceVO(); + projectSystem.setProjectId(proj.getId()); + projectSystem.setProjectCode(proj.getProjectCode()); projectSystem.setProjectName(proj.getProjectName()); currOrgReplaceInfos.add(projectSystem); Map> replaceInfoGroup = CollUtils.group(replaceInfos, @@ -833,13 +835,13 @@ public class WorkbenchManage { replaceInfo.setTargetSystemName(firstReplaceInfo.getTargetSystem()); List sourceSystemNames = CollUtils.fieldList(currBatchValues, val -> { String sourceSystem = val.getSourceSystem(); - if (isValidSystem.test(sourceSystem)) { + if (IS_VALID_SYSTEM.test(sourceSystem)) { sourceCount.incrementAndGet(); } return sourceSystem; }); replaceInfo.setSourceSystemNames(sourceSystemNames); - if (isValidSystem.test(replaceInfo.getTargetSystemName())) { + if (IS_VALID_SYSTEM.test(replaceInfo.getTargetSystemName())) { targetCount.incrementAndGet(); } return replaceInfo;