Browse Source

龙泉市 单独的状态机

tags/24080901
PoffyZhang 1 year ago
parent
commit
90f3d949b4
3 changed files with 15 additions and 11 deletions
  1. +6
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java
  2. +5
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java
  3. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/MachineBuilderFounder.java

+ 6
- 6
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java View File

@@ -109,10 +109,10 @@ public class ProjectDeclareLQAction {
}


@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN")
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PLAN_TO_BE_DECLARED")
public void DEPARTMENT_UNITED_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
}

@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED")
@@ -128,10 +128,10 @@ public class ProjectDeclareLQAction {
}


@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED")
@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "TO_BE_APPROVED")
public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
}

@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED")
@@ -165,10 +165,10 @@ public class ProjectDeclareLQAction {
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
}

@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED")
@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "IN_THE_ANNUAL_PLAN")
public void PLAN_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
}

@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED")


+ 5
- 4
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java View File

@@ -159,7 +159,7 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM
// 部门联审通过,从部门联审中到年度计划中
.withExternal()
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW)
.target(ProjectStatusEnum.IN_THE_ANNUAL_PLAN)
.target(ProjectStatusEnum.PLAN_TO_BE_DECLARED)
.event(ProjectStatusChangeEvent.DEPARTMENT_UNITED_REVIEW_PASS).and()
// 部门联审驳回,从部门联审中到部门联审不通过
.withExternal()
@@ -171,10 +171,11 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW)
.target(ProjectStatusEnum.PRE_APPLYING)
.event(ProjectStatusChangeEvent.DEPARTMENT_JOINT_REVIEW_WITHDRAW).and()
// 年度计划中开启方案申报,从年度计划中到方案待申报

// 年度计划中开启方案申报,从年度计划中到立项批复
.withExternal()
.source(ProjectStatusEnum.IN_THE_ANNUAL_PLAN)
.target(ProjectStatusEnum.PLAN_TO_BE_DECLARED)
.target(ProjectStatusEnum.TO_BE_APPROVED)
.event(ProjectStatusChangeEvent.ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE).and()
// 年度计划中暂缓,从年度计划中到被暂缓
.withExternal()
@@ -189,7 +190,7 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM
// 方案评审通过,从方案评审中到待立项批复
.withExternal()
.source(ProjectStatusEnum.SCHEME_UNDER_REVIEW)
.target(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.IN_THE_ANNUAL_PLAN)
.event(ProjectStatusChangeEvent.PLAN_REVIEW_PASS).and()
// 方案评审驳回,从方案评审中到方案评审不通过
.withExternal()


+ 4
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/MachineBuilderFounder.java View File

@@ -6,6 +6,8 @@ import com.ningdatech.pmapi.common.statemachine.contants.RegionContant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Map;

/**
@@ -54,7 +56,8 @@ public class MachineBuilderFounder {
@Autowired
private ProjectDeclareStateMachineKFQBuilder projectDeclareStateMachineKFQBuilder;

public MachineBuilderFounder(){
@PostConstruct
public void MachineBuilderFounder(){
machineBuilderMap.put(RegionContant.LS_SBJ_CODE, projectDeclareStateMachineSBJBuilder);
machineBuilderMap.put(RegionContant.LS_LD_CODE, projectDeclareStateMachineLDBuilder);
machineBuilderMap.put(RegionContant.LS_QT_CODE, projectDeclareStateMachineQTBuilder);


Loading…
Cancel
Save