Browse Source

实施推送后 调用状态机

tags/24080901
PoffyZhang 1 year ago
parent
commit
78312b528a
1 changed files with 25 additions and 1 deletions
  1. +25
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java

+ 25
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java View File

@@ -175,7 +175,13 @@ public class ConstructionPlanManage {
log.info("建设方案项目申报成功 【{}】", instanceId);

// 保存建设项目相关
Project buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject);
Project buildProject = new Project();
if(dto.getRestart()){
//如果是重新提交 不用生成新版本 前面已经生成过了
buildProject = contructionPlanModifyProject(oldProject, instanceId);
}else{
buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject);
}

//发送给第一个审批人消息
noticeManage.sendFirtUser(buildProject,model.getFormName(),instanceId,
@@ -184,6 +190,24 @@ public class ConstructionPlanManage {
return instanceId;
}

private Project contructionPlanModifyProject(Project project, String instanceId) {
stateMachineUtils.pass(project);
project.setUpdateOn(LocalDateTime.now());
project.setInstCode(instanceId);
projectService.updateById(project);

//保存项目和实例的关系
ProjectInst projectInst = new ProjectInst();
projectInst.setProjectId(project.getId());
projectInst.setInstCode(instanceId);
projectInst.setCreatOn(LocalDateTime.now());
projectInst.setUpdateOn(LocalDateTime.now());
projectInst.setInstType(ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode());
projectInstService.save(projectInst);

return project;
}

/**
* 驳回 重新提交建设方案
*


Loading…
Cancel
Save