Browse Source

Merge remote-tracking branch 'origin/master'

tags/24080901
WendyYang 1 year ago
parent
commit
f7d2dd1ef3
12 changed files with 65 additions and 21 deletions
  1. +4
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java
  2. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java
  3. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java
  4. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java
  5. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java
  6. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java
  7. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java
  8. +23
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  9. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java
  10. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  11. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
  12. +18
    -13
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 4
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java View File

@@ -238,7 +238,8 @@ public class FinalAcceptanceManage {

//保存终验项目
//生成新版本 并且进入下一状态
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode());
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId,
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE);

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,
@@ -298,7 +299,8 @@ public class FinalAcceptanceManage {

//保存终验项目
//生成新版本 并且进入下一状态
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode());
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId,
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE);

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,


+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java View File

@@ -102,9 +102,6 @@ public class ReviewByDeptJointManage {

//保存项目信息
projectInfo = projectLibManage.saveProjectWithVersion(projectInfo,instanceId,ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode());
// if(!modifyProject(projectInfo, instanceId)){
// return Boolean.FALSE;
// }

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,


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

@@ -12,6 +12,7 @@ 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;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -64,6 +65,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));
ProcessProgressVo instanceDetail = null;


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java View File

@@ -10,6 +10,7 @@ import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -66,6 +67,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.DEPT_UNITED_REVIEW.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));
if (Objects.isNull(projectInst)){


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

@@ -12,6 +12,7 @@ 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.projectlib.utils.ProjectVersionUtil;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -65,6 +66,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle {
.eq(ProjectInst::getProjectId, projectId)
.eq(ProjectInst::getInstType, InstTypeEnum.PRELIMINARY_PREVIEW.getCode())
.orderByDesc(ProjectInst::getCreatOn)
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.last("limit 1"));
ProcessProgressVo instanceDetail = null;
// 未找到当前版本项目的预审审核流程且当前项目版本号大于1(是被驳回重新申报的项目或者建设方案申报的项目)


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java View File

@@ -13,6 +13,7 @@ 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.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -60,6 +61,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));



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

@@ -20,6 +20,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.process.ProgressNode;
@@ -67,6 +68,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle {
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));
ProcessProgressVo instanceDetail = null;


+ 23
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -317,6 +317,7 @@ public class ProjectLibManage {
project.setVersion(oldProject.getVersion() + 1);
// 标记为建设方案申报
project.setIsConstruct(Boolean.TRUE);
project.setIsBackReject(Boolean.FALSE);
// 保存初步方案项目ID
if (Boolean.TRUE.equals(oldProject.getIsConstruct())) {
// 重新提交
@@ -384,9 +385,13 @@ public class ProjectLibManage {
project.setId(null);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
project.setIsBackReject(Boolean.FALSE);
stateMachineUtils.pass(project);
projectService.save(project);

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

projectService.update(Wrappers.lambdaUpdate(Project.class)
.set(Project::getNewest, Boolean.FALSE)
.ne(Project::getId, project.getId())
@@ -410,6 +415,8 @@ public class ProjectLibManage {
project.setId(null);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
//都是在驳回 重新提交时用的
project.setIsBackReject(Boolean.FALSE);
if (Objects.nonNull(stageCode)) {
project.setStage(stageCode);
}
@@ -417,6 +424,9 @@ public class ProjectLibManage {
project.setStatus(statusCode);
}

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

if (projectService.save(project)) {
projectService.update(Wrappers.lambdaUpdate(Project.class)
.set(Project::getNewest, Boolean.FALSE)
@@ -500,7 +510,7 @@ public class ProjectLibManage {
return project;
}

public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType) {
public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType,Boolean isBackReject) {
Project project = new Project();
VUtils.isTrue(Objects.isNull(oldProject))
.throwMessage("项目不存在!");
@@ -512,9 +522,13 @@ public class ProjectLibManage {
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
// 标识保存的项目信息是否为建设方案申报项目
project.setIsConstruct(Boolean.TRUE);
project.setIsConstruct(Boolean.FALSE);
project.setIsBackReject(isBackReject);
stateMachineUtils.pass(project);

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

if (projectService.save(project)) {
//保存项目和实例的关系
ProjectInst projectInst = new ProjectInst();
@@ -549,9 +563,12 @@ public class ProjectLibManage {
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
// 标识保存的项目信息是否为建设方案申报项目
project.setIsConstruct(Boolean.TRUE);
project.setIsConstruct(Boolean.FALSE);
stateMachineUtils.pass(project);

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

if (projectService.save(project)) {
//保存项目和实例的关系
ProjectInst projectInst = new ProjectInst();
@@ -1020,8 +1037,11 @@ public class ProjectLibManage {
return res;
}

//只查 当前版本 和历史被驳回|退回的版本
List<Project> historyProjects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectCode, project.getProjectCode())
.and(q1->q1.eq(Project::getNewest, Boolean.TRUE)
.or(q2->q2.eq(Project::getIsBackReject,Boolean.TRUE)))
.orderByDesc(Project::getCreateOn));

if (CollUtil.isEmpty(historyProjects)) {


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java View File

@@ -317,4 +317,7 @@ public class ProjectDTO implements Serializable {

@ApiModelProperty("项目类型 01首次建设;02迭代升级;03结转建设;04新运维;05续运维")
private String baseProjType;

@ApiModelProperty("是否退回|驳回的项目版本")
private Boolean isBackReject = Boolean.FALSE;
}

+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java View File

@@ -483,4 +483,8 @@ public class Project implements Serializable {

@ApiModelProperty("区县预审本级主管单位盖章审核日期")
private String countrySealAuditDate;

@ApiModelProperty("是否退回|驳回的项目版本")
private Boolean isBackReject;

}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java View File

@@ -395,6 +395,9 @@ public class ProjectDetailVO {
@ApiModelProperty("审批详情")
private ProcessProgressDetailVo process;

@ApiModelProperty("是否退回|驳回的项目版本")
private Boolean isBackReject;

public String getVersionStr() {
if (Objects.nonNull(this.newest) && this.newest) {
this.versionStr = "当前版本";


+ 18
- 13
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -653,10 +653,7 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
Map<String, Project> projectInfoMap = projectInstList.stream()
.filter(p -> Objects.nonNull(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -796,10 +793,7 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
Map<String, Project> projectInfoMap = projectInstList.stream()
.filter(p -> Objects.nonNull(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -1113,7 +1107,7 @@ public class TodoCenterManage {
.eq(ProjectInst::getInstCode, oldProject.getInstCode()));

String instCode = oldProject.getInstCode();
oldInst.setInstCode("EMPTY");
oldInst.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
projectInstService.updateById(oldInst);

ProjectInst newPi = new ProjectInst();
@@ -1142,6 +1136,9 @@ public class TodoCenterManage {
.eq(ProjectApplication::getIsConstruct, Boolean.TRUE));
if (CollUtil.isNotEmpty(applicationList)) {
projectApplicationService.removeBatchByIds(applicationList);
List<Long> applicationIds = applicationList.stream().map(ProjectApplication::getId).collect(Collectors.toList());
// projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class)
// .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds));
}

List<ProjectApplicationDTO> applications = projectDto.getApplicationList();
@@ -1159,11 +1156,19 @@ public class TodoCenterManage {
!InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) {
projectApplication.setIsConstruct(Boolean.TRUE);
}
if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){
projectApplication.setApplicationName(null);
}
projectApplication.setProjectVersion(project.getVersion());
projectApplicationService.save(projectApplication);
boolean result = projectApplicationService.save(projectApplication);
// // 保存应用关联的核心业务
// List<ProjectCoreBusinessDTO> coreBusinessList = application.getCoreBusinessList();
// Boolean hasCoreBusiness = CollUtil.isNotEmpty(coreBusinessList) ? Boolean.TRUE : Boolean.FALSE;
// if (Boolean.TRUE.equals(result) && Boolean.TRUE.equals(hasCoreBusiness)){
// for (ProjectCoreBusinessDTO coreBusiness : coreBusinessList) {
// ProjectCoreBusinessIndicators projectCoreBusinessIndicators = new ProjectCoreBusinessIndicators();
// BeanUtils.copyProperties(coreBusiness, projectCoreBusinessIndicators);
// projectCoreBusinessIndicators.setApplicationId(application.getId());
// projectCoreBusinessIndicatorsService.save(projectCoreBusinessIndicators);
// }
// }
}
}
return Boolean.TRUE;


Loading…
Cancel
Save