浏览代码

fix:

1. 项目详情增加关联系统ID;
tags/24111801^0
Wendy 1 个月前
父节点
当前提交
2fc57d468a
共有 4 个文件被更改,包括 48 次插入12 次删除
  1. +36
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiProjectLibManage.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java
  3. +3
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/DefaultDeclaredDTO.java
  4. +8
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java

+ 36
- 5
hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiProjectLibManage.java 查看文件

@@ -1,5 +1,6 @@
package com.hz.pm.api.open.manage;

import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -7,12 +8,13 @@ import com.hz.pm.api.common.model.constant.ExistsSqlConst;
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.common.util.BizDateUtil;
import com.hz.pm.api.open.model.po.MhSyncProjectListPO;
import com.hz.pm.api.open.model.vo.ReferSystemReplaceInfoToMhVO;
import com.hz.pm.api.open.model.vo.DeclaredProjectInfoToMhVO;
import com.hz.pm.api.open.model.vo.ReferSystemReplaceInfoToMhVO;
import com.hz.pm.api.open.util.OpenApiCheckSignUtil;
import com.hz.pm.api.projectlib.entity.MhSystemReplaceInfo;
import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.GovSystemReplaceTypeEnum;
import com.hz.pm.api.projectlib.service.IMhSystemReplaceInfoService;
import com.hz.pm.api.projectlib.service.IProjectGovSystemReplaceInfosService;
import com.hz.pm.api.projectlib.service.IProjectService;
@@ -23,6 +25,7 @@ import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;

/**
@@ -69,9 +72,10 @@ public class OpenApiProjectLibManage {
}
List<String> projectCodes = CollUtils.fieldList(projects, Project::getProjectCode);
List<ProjectGovSystemReplaceInfos> replaceInfos = systemReplaceInfosService.listByProjectCodes(projectCodes);
replaceInfos.removeIf(w -> StrUtil.isBlank(w.getSourceSystemId()));
Map<String, List<ProjectGovSystemReplaceInfos>> originReplaceInfoMap;
Map<String, List<MhSystemReplaceInfo>> replaceInfoMap;
if (!replaceInfos.isEmpty()) {
originReplaceInfoMap = CollUtils.group(replaceInfos, ProjectGovSystemReplaceInfos::getProjectCode);
List<String> sourceSystemIds = CollUtils.fieldList(replaceInfos, ProjectGovSystemReplaceInfos::getSourceSystemId);
List<MhSystemReplaceInfo> mhSystemReplaceInfos = mhSystemReplaceInfoService.listByIds(sourceSystemIds);
Map<String, MhSystemReplaceInfo> mhReplaceInfoMap = CollUtils.listToMap(mhSystemReplaceInfos, MhSystemReplaceInfo::getId);
@@ -80,6 +84,7 @@ public class OpenApiProjectLibManage {
.collect(Collectors.groupingBy(ProjectGovSystemReplaceInfos::getProjectCode,
Collectors.mapping(w -> mhReplaceInfoMap.get(w.getSourceSystemId()), Collectors.toList())));
} else {
originReplaceInfoMap = Collections.emptyMap();
replaceInfoMap = Collections.emptyMap();
}

@@ -95,9 +100,9 @@ public class OpenApiProjectLibManage {
item.setBuildOrgName(w.getBuildOrgName());
item.setDeclareAmount(w.getDeclareAmount());
item.setReviewAmount(w.getReviewAmount());
List<MhSystemReplaceInfo> replaceInfoList = replaceInfoMap.get(w.getProjectCode());
if (replaceInfoList != null) {
List<ReferSystemReplaceInfoToMhVO> referSystemList = CollUtils.convert(replaceInfoList,
if (replaceInfoMap.containsKey(w.getProjectCode())) {
List<MhSystemReplaceInfo> currReplaceInfos = replaceInfoMap.get(w.getProjectCode());
List<ReferSystemReplaceInfoToMhVO> referSystemList = CollUtils.convert(currReplaceInfos,
t -> ReferSystemReplaceInfoToMhVO.builder()
.id(t.getId())
.buildOrgCode(t.getBuildOrgCode())
@@ -107,6 +112,18 @@ public class OpenApiProjectLibManage {
.alternativeType(t.getReplaceType())
.build());
item.setReferSystemList(referSystemList);
} else if (originReplaceInfoMap.containsKey(w.getProjectCode())) {
List<ProjectGovSystemReplaceInfos> currReplaceInfos = originReplaceInfoMap.get(w.getProjectCode());
List<ReferSystemReplaceInfoToMhVO> referSystemList = CollUtils.convert(currReplaceInfos,
t -> ReferSystemReplaceInfoToMhVO.builder()
.id(t.getSourceSystemId())
.buildOrgCode(Integer.valueOf(w.getBuildOrgCode()))
.buildOrgName(w.getBuildOrgName())
.systemName(t.getSourceSystem())
.alternativeName(t.getTargetSystem())
.alternativeType(getReplaceType(t))
.build());
item.setReferSystemList(referSystemList);
} else {
item.setReferSystemList(Collections.emptyList());
}
@@ -114,4 +131,18 @@ public class OpenApiProjectLibManage {
}).collect(Collectors.toList());
}

private static String getReplaceType(ProjectGovSystemReplaceInfos t) {
String replaceType = StrUtil.EMPTY;
if (NumberUtil.isNumber(t.getReplaceType())) {
Optional<GovSystemReplaceTypeEnum> optReplaceType = GovSystemReplaceTypeEnum.get(Integer.valueOf(t.getReplaceType()));
if (optReplaceType.isPresent()) {
GovSystemReplaceTypeEnum replaceTypeEnum = optReplaceType.get();
replaceType = Optional.ofNullable(replaceTypeEnum.getMhReplaceType())
.flatMap(mhReplaceType -> Optional.of(mhReplaceType.getCode()))
.orElse(replaceTypeEnum.getVal());
}
}
return replaceType;
}

}

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java 查看文件

@@ -96,7 +96,7 @@ public class ProjectReviewManage {
throw BizException.wrap("该项目不允许申请项目评审");
}

UserInfoDetails user = LoginUserUtil.userDetail();
UserInfoDetails user = LoginUserUtil.userDetailNotNull();
WflowModels model = processModelManage.getWflowModelsNoNull(ProjectProcessType.PROJECT_REVIEW,
user.getMhUnitId());



+ 3
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/DefaultDeclaredDTO.java 查看文件

@@ -9,7 +9,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Map;

/**
@@ -28,13 +27,13 @@ public class DefaultDeclaredDTO {
private ProjectDTO projectInfo;

@ApiModelProperty("表单信息 新增模块")
private Map<String,Object> formData;
private Map<String, Object> formData;

@ApiModelProperty("是否是重新提交 默认false")
private Boolean restart = Boolean.FALSE;

public Map<String,Object> getFormData(){
if(CollUtil.isEmpty(this.formData)){
public Map<String, Object> getFormData() {
if (CollUtil.isEmpty(this.formData)) {
this.formData = Maps.newHashMap();
return this.formData;
}


+ 8
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java 查看文件

@@ -5,13 +5,13 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.core.util.StrUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.hz.pm.api.common.compare.CompareUtils;
@@ -703,8 +703,14 @@ public class ProjectLibManage {
GovSystemReplaceInfoDTO replaceInfo = new GovSystemReplaceInfoDTO();
replaceInfo.setReplaceType(firstReplaceInfo.getReplaceType());
replaceInfo.setTargetSystemName(firstReplaceInfo.getTargetSystem());
List<String> sourceSystemNames = CollUtils.fieldList(currBatchValues, ProjectGovSystemReplaceInfos::getSourceSystem);
List<String> sourceSystemNames = new ArrayList<>();
List<String> sourceSystemIds = new ArrayList<>();
for (ProjectGovSystemReplaceInfos replaceInfos : currBatchValues) {
sourceSystemIds.add(StrUtil.nullToEmpty(replaceInfos.getSourceSystemId()));
sourceSystemNames.add(replaceInfos.getSourceSystem());
}
replaceInfo.setSourceSystemNames(sourceSystemNames);
replaceInfo.setSourceSystemIds(sourceSystemIds);
Optional.ofNullable(upgradeContentMap.get(w.getKey())).ifPresent(uc -> {
replaceInfo.setIterativeUpgradeContent(uc.getIterativeUpgradeContent());
replaceInfo.setIsAddIterativeUpgradeContent(uc.getIsAddIterativeUpgradeContent());


正在加载...
取消
保存