Browse Source

modify:

1. 系统替代情况修改;
tags/24101601
WendyYang 2 months ago
parent
commit
980006faee
11 changed files with 138 additions and 47 deletions
  1. +2
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java
  2. +36
    -18
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectSaveHelper.java
  3. +13
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  4. +6
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/GovSystemReplaceInfoDTO.java
  5. +26
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/GovSystemReplaceInfoUpgradeContentDTO.java
  6. +0
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java
  7. +0
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/Project.java
  8. +8
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectListReq.java
  9. +0
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java
  10. +41
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java
  11. +6
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/model/WorkbenchProcessNode.java

+ 2
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java View File

@@ -179,7 +179,7 @@ public class ProjectReviewManage {
if (!projectQueryPermission(query, user, req.getDeclaredUnitId())) {
return PageVo.empty();
}
Integer status = req.getStatus();
Integer status = req.clearStatus();
if (status != null) {
req.setStatus(null);
if (ProjectStatus.PROJECT_REVIEW_PASSED.eq(status)) {
@@ -272,6 +272,7 @@ public class ProjectReviewManage {
" and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS);
}
ProjectManageUtil.projectQuery(query, req);
ProjectManageUtil.projectBaseQuery(query);
query.eq(Project::getNewest, Boolean.TRUE)
.ne(Project::getStage, ProjectStatus.STOPPED.getCode());
Page<Project> page = projectService.page(req.page(), query);


+ 36
- 18
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectSaveHelper.java View File

@@ -3,13 +3,16 @@ package com.hz.pm.api.projectlib.helper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.performance.model.dto.ProjectCoreBusinessDTO;
import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators;
import com.hz.pm.api.performance.service.IProjectCoreBusinessIndicatorsService;
import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos;
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoUpgradeContentDTO;
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO;
import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO;
@@ -19,6 +22,7 @@ import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.service.IProjectAnnualPaymentPlanService;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectGovSystemReplaceInfosService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
@@ -44,6 +48,7 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class ProjectSaveHelper {

private final IProjectService projectService;
private final IProjectApplicationService projectApplicationService;
private final IProjectGovSystemReplaceInfosService projectGovSystemReplaceInfosService;
private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService;
@@ -142,27 +147,40 @@ public class ProjectSaveHelper {
Wrapper<ProjectGovSystemReplaceInfos> delQuery = Wrappers.lambdaQuery(ProjectGovSystemReplaceInfos.class)
.eq(ProjectGovSystemReplaceInfos::getProjectCode, projectCode);
projectGovSystemReplaceInfosService.remove(delQuery);
if (CollUtil.isEmpty(systemReplaceInfos)) {
return;
}
List<ProjectGovSystemReplaceInfos> replaceInfos = new ArrayList<>();
for (int i = 0; i < systemReplaceInfos.size(); i++) {
GovSystemReplaceInfoDTO curr = systemReplaceInfos.get(i);
for (int i1 = 0; i1 < curr.getSourceSystemNames().size(); i1++) {
ProjectGovSystemReplaceInfos replaceInfo = new ProjectGovSystemReplaceInfos();
replaceInfo.setProjectId(projectId);
replaceInfo.setProjectCode(projectCode);
replaceInfo.setReplaceType(curr.getReplaceType());
replaceInfo.setSourceSystem(curr.getSourceSystemNames().get(i1));
replaceInfo.setTargetSystem(curr.getTargetSystemName());
replaceInfo.setBatchNo(i + 1);
if (ArrayUtil.isNotEmpty(curr.getSourceSystemIds())) {
replaceInfo.setSourceSystemId(curr.getSourceSystemIds().get(i1));
LambdaUpdateWrapper<Project> projectUpdate = Wrappers.lambdaUpdate(Project.class)
.eq(Project::getProjectCode, projectCode)
.eq(Project::getNewest, Boolean.TRUE);
if (CollUtil.isNotEmpty(systemReplaceInfos)) {
List<ProjectGovSystemReplaceInfos> replaceInfos = new ArrayList<>();
List<GovSystemReplaceInfoUpgradeContentDTO> upgradeContents = new ArrayList<>();
for (int i = 0; i < systemReplaceInfos.size(); i++) {
int batchNo = i + 1;
GovSystemReplaceInfoDTO curr = systemReplaceInfos.get(i);
for (int i1 = 0; i1 < curr.getSourceSystemNames().size(); i1++) {
ProjectGovSystemReplaceInfos replaceInfo = new ProjectGovSystemReplaceInfos();
replaceInfo.setProjectId(projectId);
replaceInfo.setProjectCode(projectCode);
replaceInfo.setReplaceType(curr.getReplaceType());
replaceInfo.setSourceSystem(curr.getSourceSystemNames().get(i1));
replaceInfo.setTargetSystem(curr.getTargetSystemName());
replaceInfo.setBatchNo(batchNo);
if (ArrayUtil.isNotEmpty(curr.getSourceSystemIds())) {
replaceInfo.setSourceSystemId(curr.getSourceSystemIds().get(i1));
}
replaceInfos.add(replaceInfo);
}
replaceInfos.add(replaceInfo);
GovSystemReplaceInfoUpgradeContentDTO upgradeContent = new GovSystemReplaceInfoUpgradeContentDTO();
upgradeContent.setBatchNo(batchNo);
upgradeContent.setIterativeUpgradeContent(curr.getIterativeUpgradeContent());
upgradeContent.setIsAddIterativeUpgradeContent(curr.getIsAddIterativeUpgradeContent());
upgradeContents.add(upgradeContent);
}
projectUpdate.set(Project::getIterativeUpgradeContent, JSONUtil.toJsonStr(upgradeContents));
projectGovSystemReplaceInfosService.saveBatch(replaceInfos);
} else {
projectUpdate.set(Project::getIterativeUpgradeContent, null);
}
projectGovSystemReplaceInfosService.saveBatch(replaceInfos);
projectService.update(projectUpdate);
}

}

+ 13
- 5
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java View File

@@ -4,8 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.NumberUtil;
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;
@@ -15,7 +15,6 @@ 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;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.enumeration.ProjectProcessType;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.common.model.constant.BizConst;
@@ -36,7 +35,6 @@ import com.hz.pm.api.filemanage.service.INdProjectApplyBorrowService;
import com.hz.pm.api.meeting.entity.domain.MeetingInnerProject;
import com.hz.pm.api.meeting.entity.dto.ProjectReviewResultDTO;
import com.hz.pm.api.meeting.service.IMeetingInnerProjectService;
import com.hz.pm.api.performance.model.dto.ProjectCoreBusinessDTO;
import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators;
import com.hz.pm.api.performance.service.IProjectCoreBusinessIndicatorsService;
import com.hz.pm.api.portrait.model.entity.ProjectTag;
@@ -61,6 +59,7 @@ import com.hz.pm.api.projectlib.handle.ProcessProgressHelper;
import com.hz.pm.api.projectlib.helper.ProjectManageUtil;
import com.hz.pm.api.projectlib.helper.ProjectSaveHelper;
import com.hz.pm.api.projectlib.model.constant.ProjectConstant;
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoUpgradeContentDTO;
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO;
import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO;
@@ -675,7 +674,7 @@ public class ProjectLibManage {
* @param projectId \
* @return \
*/
private List<GovSystemReplaceInfoDTO> getGovSystemReplaceInfos(Long projectId) {
private List<GovSystemReplaceInfoDTO> getGovSystemReplaceInfos(Long projectId, String upgradeContent) {
Wrapper<ProjectGovSystemReplaceInfos> query = Wrappers.lambdaQuery(ProjectGovSystemReplaceInfos.class)
.eq(ProjectGovSystemReplaceInfos::getProjectId, projectId)
.orderByAsc(ProjectGovSystemReplaceInfos::getId)
@@ -684,6 +683,11 @@ public class ProjectLibManage {
if (govSystemReplaceInfos.isEmpty()) {
return Collections.emptyList();
}
Map<Integer, GovSystemReplaceInfoUpgradeContentDTO> upgradeContentMap = new HashMap<>();
if (StrUtil.isNotBlank(upgradeContent)) {
List<GovSystemReplaceInfoUpgradeContentDTO> upgradeContents = JSONUtil.toList(upgradeContent, GovSystemReplaceInfoUpgradeContentDTO.class);
upgradeContentMap.putAll(CollUtils.listToMap(upgradeContents, GovSystemReplaceInfoUpgradeContentDTO::getBatchNo));
}
Map<Integer, List<ProjectGovSystemReplaceInfos>> replaceInfoGroup = CollUtils.group(govSystemReplaceInfos, ProjectGovSystemReplaceInfos::getBatchNo);
return replaceInfoGroup.entrySet().stream()
.sorted(Comparator.comparingInt(Map.Entry::getKey))
@@ -695,6 +699,10 @@ public class ProjectLibManage {
replaceInfo.setTargetSystemName(firstReplaceInfo.getTargetSystem());
List<String> sourceSystemNames = CollUtils.fieldList(currBatchValues, ProjectGovSystemReplaceInfos::getSourceSystem);
replaceInfo.setSourceSystemNames(sourceSystemNames);
Optional.ofNullable(upgradeContentMap.get(w.getKey())).ifPresent(uc -> {
replaceInfo.setIterativeUpgradeContent(uc.getIterativeUpgradeContent());
replaceInfo.setIsAddIterativeUpgradeContent(uc.getIsAddIterativeUpgradeContent());
});
return replaceInfo;
}).collect(Collectors.toList());
}
@@ -715,7 +723,7 @@ public class ProjectLibManage {
Map<Long, List<ProjectCoreBusinessIndicators>> coreBizMap = CollUtils.group(coreBizs, ProjectCoreBusinessIndicators::getApplicationId);
retProjectDetail.setProjectApplications(CollUtils.convert(applications, app -> ProjectManageUtil.to(app, coreBizMap)));
}
retProjectDetail.setSystemReplaceInfos(getGovSystemReplaceInfos(project.getId()));
retProjectDetail.setSystemReplaceInfos(getGovSystemReplaceInfos(project.getId(), project.getIterativeUpgradeContent()));
//审批信息
if (StrUtils.isNotBlank(project.getInstCode())) {
ProcessDetailReq req = new ProcessDetailReq();


+ 6
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/GovSystemReplaceInfoDTO.java View File

@@ -39,6 +39,12 @@ public class GovSystemReplaceInfoDTO implements Serializable {
@ApiModelProperty("替代前系统id")
private List<String> sourceSystemIds;

@ApiModelProperty("是否新增迭代升级内容")
private Boolean isAddIterativeUpgradeContent;

@ApiModelProperty("迭代升级内容")
private String iterativeUpgradeContent;

@Override
public boolean equals(Object o) {
if (this == o) {


+ 26
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/GovSystemReplaceInfoUpgradeContentDTO.java View File

@@ -0,0 +1,26 @@
package com.hz.pm.api.projectlib.model.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* GOvSystemReplaceInfoUpgradeContent
* </p>
*
* @author WendyYang
* @since 14:03 2024/10/14
*/
@Data
public class GovSystemReplaceInfoUpgradeContentDTO {

@ApiModelProperty("保存时批次号")
private Integer batchNo;

@ApiModelProperty("是否新增迭代升级内容")
private Boolean isAddIterativeUpgradeContent;

@ApiModelProperty("迭代升级内容")
private String iterativeUpgradeContent;

}

+ 0
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java View File

@@ -383,12 +383,6 @@ public class ProjectDTO implements Serializable {
@ApiModelProperty("政务信息系统替代情况")
private List<GovSystemReplaceInfoDTO> systemReplaceInfos;

@ApiModelProperty("是否新增迭代升级内容")
private Boolean isAddIterativeUpgradeContent;

@ApiModelProperty("迭代升级内容")
private String iterativeUpgradeContent;

@ApiModelProperty("信产项目ID")
private Long mhProjectId;



+ 0
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/Project.java View File

@@ -503,9 +503,6 @@ public class Project implements Serializable {
@ApiModelProperty("是否是重大项目")
private Boolean isMajorProject;

@ApiModelProperty("是否新增迭代升级内容")
private Boolean isAddIterativeUpgradeContent;

@ApiModelProperty("迭代升级内容")
private String iterativeUpgradeContent;



+ 8
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectListReq.java View File

@@ -143,4 +143,12 @@ public class ProjectListReq extends PagePo {
return NumberUtil.parseLong(tmpBuildOrgCode, null);
}

public Integer clearStatus() {
Integer tmpStatus = this.getStatus();
if (tmpStatus != null) {
this.setStatus(null);
}
return tmpStatus;
}

}

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

@@ -594,10 +594,4 @@ public class ProjectDetailVO {
@ApiModelProperty("所属领域")
private Integer unitStrip;

@ApiModelProperty("是否新增迭代升级内容")
private Boolean isAddIterativeUpgradeContent;

@ApiModelProperty("迭代升级内容")
private String iterativeUpgradeContent;

}

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

@@ -552,6 +552,9 @@ public class WorkbenchManage {

public PageVo<ProjectLibListItemVO> pageProjectLib(WorkbenchProjectLibReq req) {
LambdaQueryWrapper<Project> query = workbenchProjectLibQuery(req);
if (query == null) {
return PageVo.empty();
}
ProjectManageUtil.projectBaseQuery(query);
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT);
switch (req.getProcessNode()) {
@@ -572,12 +575,33 @@ public class WorkbenchManage {
case FIRST_INSPECTED:
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES);
break;
case ORG_CONFIRM:
case PROJECT_ADAPTION:
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.SUBMIT_PURCHASE_ORG_CONFIRM);
break;
case FINAL_INSPECTED:
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.FINAL_ACCEPTANCE_PASS);
break;
case FINISHED:
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.SUBMIT_PURCHASE_CONTRACT_RECORD);
query.notExists("select 1 from nd_purchase np where np.project_id = nd_project.id and bid_type = {0}",
BidTypeEnum.BUILD_APP.getCode());
break;
case TEST_VALID:
query.apply("(select count(1) from nd_purchase np where np.project_id = nd_project.id and bid_type = {0}) " +
"= (select count(distinct bid_id) from nd_purchase_status_change npsc where npsc.project_code = nd_project.project_code " +
"and event = {1})", BidTypeEnum.BUILD_APP.getCode(), TestValidStateChangeEvent.TEST_VALID_INFO_PASSED);
break;
case SELF_TEST:
query.apply("(select count(1) from nd_purchase np where np.project_id = nd_project.id and bid_type = {0}) " +
"= (select count(distinct bid_id) from nd_purchase_status_change npsc where npsc.project_code = nd_project.project_code " +
"and event = {1})", BidTypeEnum.BUILD_APP.getCode(), SelfTestStateChangeEvent.SELF_TEST_PASSED);
break;
case SUBMIT_START_FILE:
query.apply("(select count(1) from nd_purchase np where np.project_id = nd_project.id and bid_type = {0}) " +
"= (select count(distinct bid_id) from nd_purchase_status_change npsc where npsc.project_code = nd_project.project_code " +
"and event = {1})", BidTypeEnum.BUILD_APP.getCode(), AdaptStateChangeEvent.ADAPT_INFO_PASSED);
break;
default:
return PageVo.empty();
}
@@ -606,9 +630,12 @@ public class WorkbenchManage {
}

public SystemReplaceInfoVO listSystemReplaceInfos(WorkbenchProjectLibReq req) {
LambdaQueryWrapper<Project> query = workbenchProjectLibQuery(req)
.select(Project::getProjectCode, Project::getProjectName,
Project::getBuildOrgCode, Project::getBuildOrgName);
LambdaQueryWrapper<Project> query = workbenchProjectLibQuery(req);
if (query == null) {
return null;
}
query.select(Project::getProjectCode, Project::getProjectName,
Project::getBuildOrgCode, Project::getBuildOrgName);
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT);
switch (req.getProcessNode()) {
case PROJECT_DECLARED:
@@ -643,13 +670,15 @@ public class WorkbenchManage {

private LambdaQueryWrapper<Project> workbenchProjectLibQuery(WorkbenchProjectLibReq req) {
Assert.notNull(req.getProcessNode(), "节点不能为空");
Long unitId = Optional.ofNullable(req.getUnitId()).orElseGet(LoginUserUtil::getMhUnitId);
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(unitId);
return Wrappers.lambdaQuery(Project.class)
Long unitId = req.getUnitId();
UnitQueryState unitQueryState = mhUnitQueryAuthHelper.listCanViewUnitIds(unitId);
if (!unitQueryState.isState()) {
return null;
}
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear())
.like(StrUtil.isNotBlank(req.getBuildOrg()), Project::getBuildOrgName, req.getBuildOrg())
.like(StrUtil.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName())
.in(Project::getBuildOrgCode, CollUtils.convert(viewUnitIds, String::valueOf))
.ge(req.getReviewAmountMin() != null, Project::getReviewAmount, req.getReviewAmountMin())
.le(req.getReviewAmountMax() != null, Project::getReviewAmount, req.getReviewAmountMax())
.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin())
@@ -657,6 +686,11 @@ public class WorkbenchManage {
.eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip())
.eq(Project::getNewest, Boolean.TRUE)
.orderByDesc(Project::getUpdateOn);
List<Long> unitIds = unitQueryState.getUnitIds();
if (CollUtil.isNotEmpty(unitIds)) {
query.in(Project::getBuildOrgCode, CollUtils.convert(unitIds, String::valueOf));
}
return query;
}

private SystemReplaceInfoVO buildSystemReplaceInfos(List<Project> projects) {


+ 6
- 1
hz-pm-api/src/main/java/com/hz/pm/api/workbench/model/WorkbenchProcessNode.java View File

@@ -27,7 +27,12 @@ public enum WorkbenchProcessNode {
PROJECT_PURCHASE("已采购", 5),
PROJECT_ADAPTION("已适配改造", 6),
FIRST_INSPECTED("已初验", 9),
FINAL_INSPECTED("已终验", 12);
FINAL_INSPECTED("已终验", 12),
FINISHED("已完成", 13),
SUBMIT_START_FILE("上传开工文件", 10),
TEST_VALID("监理核实验证", 14),
SELF_TEST("系统自测", 15),
ORG_CONFIRM("单位确认", 16);


private final String name;


Loading…
Cancel
Save