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;