Pārlūkot izejas kodu

fix:

1. 首页跳转关联系统信息修改;
tags/24112201
WendyYang pirms 1 mēnesi
vecāks
revīzija
0c0ea94f13
3 mainītis faili ar 27 papildinājumiem un 11 dzēšanām
  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 Parādīt failu

@@ -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;

/**
* <p>
* 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<ProjectGovSystemReplaceInfos> 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<Integer, List<ProjectGovSystemReplaceInfos>> replaceInfoGroup = CollUtils.group(replaceInfos,
@@ -93,13 +96,13 @@ public class ProjectGovSystemReplaceInfoManage {
List<String> 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;


+ 11
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/UnitProjectGovSystemReplaceVO.java Parādīt failu

@@ -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<ProjectGovSystemReplaceVO> projectSystemReplaces;

@Data
public static class ProjectGovSystemReplaceVO {

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

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

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

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

}


+ 10
- 8
hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java Parādīt failu

@@ -264,9 +264,9 @@ public class WorkbenchManage {
int targetCount = 0;
for (List<ProjectGovSystemReplaceInfos> 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<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) {
List<String> projectCodes = CollUtils.convert(projectIds, ProjectIdCodeCacheUtil::get);
@@ -306,9 +306,9 @@ public class WorkbenchManage {
Collectors.collectingAndThen(Collectors.toList(),
w -> {
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);
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<ProjectGovSystemReplaceInfos> 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<Integer, List<ProjectGovSystemReplaceInfos>> replaceInfoGroup = CollUtils.group(replaceInfos,
@@ -833,13 +835,13 @@ public class WorkbenchManage {
replaceInfo.setTargetSystemName(firstReplaceInfo.getTargetSystem());
List<String> 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;


Notiek ielāde…
Atcelt
Saglabāt