Browse Source

fix:

1. 首页跳转关联系统信息修改;
tags/24112201
WendyYang 1 month ago
parent
commit
0c0ea94f13
3 changed files with 27 additions and 11 deletions
  1. +6
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java
  2. +11
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/UnitProjectGovSystemReplaceVO.java
  3. +10
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java

+ 6
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java View File

@@ -27,6 +27,8 @@ import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;


import static com.hz.pm.api.workbench.manage.WorkbenchManage.IS_VALID_SYSTEM;

/** /**
* <p> * <p>
* ProjectGovSystemReplaceInfoManage * ProjectGovSystemReplaceInfoManage
@@ -43,7 +45,6 @@ public class ProjectGovSystemReplaceInfoManage {
private final IProjectService projectService; private final IProjectService projectService;
private final MhUnitCache mhUnitCache; private final MhUnitCache mhUnitCache;



public SystemReplaceInfoVO systemReplaceInfos(String targetSystem) { public SystemReplaceInfoVO systemReplaceInfos(String targetSystem) {
SystemReplaceInfoVO retDetail = new SystemReplaceInfoVO(); SystemReplaceInfoVO retDetail = new SystemReplaceInfoVO();
LambdaQueryWrapper<ProjectGovSystemReplaceInfos> pgsriQuery; LambdaQueryWrapper<ProjectGovSystemReplaceInfos> pgsriQuery;
@@ -78,6 +79,8 @@ public class ProjectGovSystemReplaceInfoManage {
continue; continue;
} }
ProjectGovSystemReplaceVO projectSystem = new ProjectGovSystemReplaceVO(); ProjectGovSystemReplaceVO projectSystem = new ProjectGovSystemReplaceVO();
projectSystem.setProjectId(proj.getId());
projectSystem.setProjectCode(proj.getProjectCode());
projectSystem.setProjectName(proj.getProjectName()); projectSystem.setProjectName(proj.getProjectName());
item.getProjectSystemReplaces().add(projectSystem); item.getProjectSystemReplaces().add(projectSystem);
Map<Integer, List<ProjectGovSystemReplaceInfos>> replaceInfoGroup = CollUtils.group(replaceInfos, Map<Integer, List<ProjectGovSystemReplaceInfos>> replaceInfoGroup = CollUtils.group(replaceInfos,
@@ -93,13 +96,13 @@ public class ProjectGovSystemReplaceInfoManage {
List<String> sourceSystemNames = CollUtils.fieldList(currBatchValues, List<String> sourceSystemNames = CollUtils.fieldList(currBatchValues,
val -> { val -> {
String sourceSystem = val.getSourceSystem(); String sourceSystem = val.getSourceSystem();
if (!StrUtil.SLASH.equals(sourceSystem)) {
if (IS_VALID_SYSTEM.test(sourceSystem)) {
before.incrementAndGet(); before.incrementAndGet();
} }
return sourceSystem; return sourceSystem;
}); });
replaceInfo.setSourceSystemNames(sourceSystemNames); replaceInfo.setSourceSystemNames(sourceSystemNames);
if (!StrUtil.SLASH.equals(replaceInfo.getTargetSystemName())) {
if (IS_VALID_SYSTEM.test(replaceInfo.getTargetSystemName())) {
after.incrementAndGet(); after.incrementAndGet();
} }
return replaceInfo; return replaceInfo;


+ 11
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/UnitProjectGovSystemReplaceVO.java View File

@@ -1,6 +1,7 @@
package com.hz.pm.api.projectlib.model.vo; package com.hz.pm.api.projectlib.model.vo;


import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;


import java.util.List; import java.util.List;
@@ -16,15 +17,25 @@ import java.util.List;
@Data @Data
public class UnitProjectGovSystemReplaceVO { public class UnitProjectGovSystemReplaceVO {


@ApiModelProperty("单位名称")
private String unitName; private String unitName;


@ApiModelProperty("项目信息")
private List<ProjectGovSystemReplaceVO> projectSystemReplaces; private List<ProjectGovSystemReplaceVO> projectSystemReplaces;


@Data @Data
public static class ProjectGovSystemReplaceVO { public static class ProjectGovSystemReplaceVO {


@ApiModelProperty("项目名称")
private String projectName; private String projectName;


@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("项目编号")
private String projectCode;

@ApiModelProperty("关联系统信息")
private List<GovSystemReplaceInfoDTO> replaceSystems; private List<GovSystemReplaceInfoDTO> replaceSystems;


} }


+ 10
- 8
hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java View File

@@ -264,9 +264,9 @@ public class WorkbenchManage {
int targetCount = 0; int targetCount = 0;
for (List<ProjectGovSystemReplaceInfos> currSystems : replaceGroupProject.values()) { for (List<ProjectGovSystemReplaceInfos> currSystems : replaceGroupProject.values()) {
sourceCount += CollUtil.count(CollUtils.fieldSet(currSystems, ProjectGovSystemReplaceInfos::getSourceSystem), sourceCount += CollUtil.count(CollUtils.fieldSet(currSystems, ProjectGovSystemReplaceInfos::getSourceSystem),
isValidSystem::test);
IS_VALID_SYSTEM::test);
targetCount += CollUtil.count(CollUtils.fieldSet(currSystems, ProjectGovSystemReplaceInfos::getTargetSystem), targetCount += CollUtil.count(CollUtils.fieldSet(currSystems, ProjectGovSystemReplaceInfos::getTargetSystem),
isValidSystem::test);
IS_VALID_SYSTEM::test);
} }
return SystemReplaceStatVO.builder() return SystemReplaceStatVO.builder()
.sourceCount(sourceCount) .sourceCount(sourceCount)
@@ -281,7 +281,7 @@ public class WorkbenchManage {
return retDetail; return retDetail;
} }


static Predicate<String> isValidSystem = x -> StrUtil.isNotBlank(x) && !"/".equals(x);
public static final Predicate<String> IS_VALID_SYSTEM = x -> StrUtil.isNotBlank(x) && !"/".equals(x);


private Pair<Integer, Integer> countReplaceSystemByProjectIds(Collection<Long> projectIds) { private Pair<Integer, Integer> countReplaceSystemByProjectIds(Collection<Long> projectIds) {
List<String> projectCodes = CollUtils.convert(projectIds, ProjectIdCodeCacheUtil::get); List<String> projectCodes = CollUtils.convert(projectIds, ProjectIdCodeCacheUtil::get);
@@ -306,9 +306,9 @@ public class WorkbenchManage {
Collectors.collectingAndThen(Collectors.toList(), Collectors.collectingAndThen(Collectors.toList(),
w -> { w -> {
Set<String> sourceNames = CollUtils.fieldSet(w, ProjectGovSystemReplaceInfos::getSourceSystem); Set<String> sourceNames = CollUtils.fieldSet(w, ProjectGovSystemReplaceInfos::getSourceSystem);
int sourceCount = CollUtil.count(sourceNames, isValidSystem::test);
int sourceCount = CollUtil.count(sourceNames, IS_VALID_SYSTEM::test);
Set<String> targetNames = CollUtils.fieldSet(w, ProjectGovSystemReplaceInfos::getTargetSystem); Set<String> 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); return Pair.create(sourceCount, targetCount);
}))).values(); }))).values();
int totalTargetCount = 0; int totalTargetCount = 0;
@@ -718,7 +718,7 @@ public class WorkbenchManage {
} }
query.notIn(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode() query.notIn(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()
, ProjectStatus.STOPPED_PASSED.getCode()) , ProjectStatus.STOPPED_PASSED.getCode())
.select(Project::getProjectCode, Project::getProjectName,
.select(Project::getProjectCode, Project::getProjectName, Project::getId,
Project::getBuildOrgCode, Project::getBuildOrgName); Project::getBuildOrgCode, Project::getBuildOrgName);
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT); projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT);
switch (req.getProcessNode()) { switch (req.getProcessNode()) {
@@ -819,6 +819,8 @@ public class WorkbenchManage {
List<ProjectGovSystemReplaceInfos> replaceInfos = projectSystemMap.get(proj.getProjectCode()); List<ProjectGovSystemReplaceInfos> replaceInfos = projectSystemMap.get(proj.getProjectCode());
if (replaceInfos != null) { if (replaceInfos != null) {
ProjectGovSystemReplaceVO projectSystem = new ProjectGovSystemReplaceVO(); ProjectGovSystemReplaceVO projectSystem = new ProjectGovSystemReplaceVO();
projectSystem.setProjectId(proj.getId());
projectSystem.setProjectCode(proj.getProjectCode());
projectSystem.setProjectName(proj.getProjectName()); projectSystem.setProjectName(proj.getProjectName());
currOrgReplaceInfos.add(projectSystem); currOrgReplaceInfos.add(projectSystem);
Map<Integer, List<ProjectGovSystemReplaceInfos>> replaceInfoGroup = CollUtils.group(replaceInfos, Map<Integer, List<ProjectGovSystemReplaceInfos>> replaceInfoGroup = CollUtils.group(replaceInfos,
@@ -833,13 +835,13 @@ public class WorkbenchManage {
replaceInfo.setTargetSystemName(firstReplaceInfo.getTargetSystem()); replaceInfo.setTargetSystemName(firstReplaceInfo.getTargetSystem());
List<String> sourceSystemNames = CollUtils.fieldList(currBatchValues, val -> { List<String> sourceSystemNames = CollUtils.fieldList(currBatchValues, val -> {
String sourceSystem = val.getSourceSystem(); String sourceSystem = val.getSourceSystem();
if (isValidSystem.test(sourceSystem)) {
if (IS_VALID_SYSTEM.test(sourceSystem)) {
sourceCount.incrementAndGet(); sourceCount.incrementAndGet();
} }
return sourceSystem; return sourceSystem;
}); });
replaceInfo.setSourceSystemNames(sourceSystemNames); replaceInfo.setSourceSystemNames(sourceSystemNames);
if (isValidSystem.test(replaceInfo.getTargetSystemName())) {
if (IS_VALID_SYSTEM.test(replaceInfo.getTargetSystemName())) {
targetCount.incrementAndGet(); targetCount.incrementAndGet();
} }
return replaceInfo; return replaceInfo;


Loading…
Cancel
Save