Browse Source

debug

tags/24080901
PoffyZhang 1 year ago
parent
commit
416d91a7d4
7 changed files with 31 additions and 15 deletions
  1. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java
  2. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java
  3. +5
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java
  4. +11
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java
  5. +7
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java
  6. +2
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java
  7. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java

+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java View File

@@ -8,6 +8,7 @@ import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Lists;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil;
@@ -61,10 +62,10 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
// 根据项目ID查询出建设方案评审流程的流程状态
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getProjectId, projectId)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode())
.orderByDesc(ProjectInst::getCreatOn)
.last("limit 1"));
.last(BizConst.LIMIT_1));
ProcessProgressVo instanceDetail = null;
// 未找到当前版本项目的建设方案审核流程且当前项目版本号大于1(是被驳回重新申报的项目)
if (Objects.isNull(projectInst)) {


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java View File

@@ -56,6 +56,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle {
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) {
ProcessDetailVO processDetailVO = new ProcessDetailVO();
Project project = projectService.getById(projectId);

if (Objects.isNull(project)){
throw new BizException("当前项目不存在!");
}


+ 5
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java View File

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.projectlib.handle;

import java.util.*;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
@@ -68,6 +69,8 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle {
ProcessDetailVO processDetailVO = new ProcessDetailVO();

Project project = projectService.getById(projectId);
//查出历史版本的 所有项目ID
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
Integer status = project.getStatus();
List<Integer> fieldList = CollUtils.fieldList(PROJECT_APPROVAL_LIST_STATUS, ProjectStatusEnum::getCode);

@@ -83,9 +86,9 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle {
if (ProjectStatusEnum.TO_BE_APPROVED.getCode().equals(status)){
// 根据建设方案评审通过的时间获取
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class)
.eq(ProjectStatusChange::getProjectId, projectId)
.in(ProjectStatusChange::getProjectId, allVersionProjectIds)
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PLAN_REVIEW_PASS.name())
.last("limit 1"));
.last(BizConst.LIMIT_1));
processDetailVO.setFinishTime(projectStatusChange.getCreateOn());
processDetailVO.setStepStatus(StepStatusEnum.ON_GOING);



+ 11
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java View File

@@ -8,8 +8,10 @@ import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -36,20 +38,26 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;

private final IProjectService projectService;

private Integer order = 10;
public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){
public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService,
BuildUserUtils buildUserUtils,IProjectService projectService){
this.projectInstService = projectInstService;
this.processInstanceService = processInstanceService;
this.buildUserUtils = buildUserUtils;
this.projectService = projectService;
}

@Override
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) {
ProcessDetailVO processDetailVO = new ProcessDetailVO();

Project project = projectService.getById(projectId);
//查出历史版本的 所有项目ID
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
// 根据项目ID查询出项目终验流程的流程状态
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getProjectId, projectId)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode())
.orderByDesc(ProjectInst::getCreatOn)
.last("limit 1"));


+ 7
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java View File

@@ -4,7 +4,9 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import com.ningdatech.pmapi.common.constant.BizConst;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
@@ -55,7 +57,9 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH
ProcessDetailVO processDetailVO = new ProcessDetailVO();
// 根据项目状态是否在建设中及之后的状态判断项目初验是否开始
List<Integer> fieldList = CollUtils.fieldList(PROJECT_PRELIMINARY_INSPECTION_LIST_STATUS, ProjectStatusEnum::getCode);
Project project = projectService.getById(projectId);
Project project = projectService.getNewProject(projectId);
//查出历史版本的 所有项目ID
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
Integer status = project.getStatus();
// 项目状态不在建设中及之后的状态
if (!fieldList.contains(status)){
@@ -71,9 +75,9 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
// 根据初验备案的时间获取
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class)
.eq(ProjectStatusChange::getProjectId, projectId)
.in(ProjectStatusChange::getProjectId, allVersionProjectIds)
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD.name())
.last("limit 1"));
.last(BizConst.LIMIT_1));
processDetailVO.setFinishTime(projectStatusChange.getCreateOn());
}
processDetailVO.setProcessName(CommonConst.PROJECT_PRELIMINARY_INSPECTION);


+ 2
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java View File

@@ -56,9 +56,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle {
ProcessDetailVO processDetailVO = new ProcessDetailVO();
// 根据项目是否通过立项批复(立项批复时间)来判断招标采购是否开始
Project project = projectService.getNewProject(projectId);
List<Long> projectIds = projectService.list(Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, project.getProjectCode())).stream()
.map(Project::getId).collect(Collectors.toList());
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
Integer status = project.getStatus();
// 未进行立项批复
if (Objects.isNull(project.getApprovalDate())){
@@ -75,7 +73,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle {
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
// 根据采购备案的时间获取
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class)
.in(ProjectStatusChange::getProjectId, projectIds)
.in(ProjectStatusChange::getProjectId, allVersionProjectIds)
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name())
.last(BizConst.LIMIT_1));
processDetailVO.setFinishTime(projectStatusChange.getCreateOn());


+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java View File

@@ -61,9 +61,10 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle {
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) {
ProcessDetailVO processDetailVO = new ProcessDetailVO();
Project project = projectService.getById(projectId);
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
// 根据项目ID查询出单位内部审核流程的流程状态
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getProjectId, projectId)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode())
.orderByDesc(ProjectInst::getCreatOn)
.last("limit 1"));


Loading…
Cancel
Save