Browse Source

状态机重新提交路径添加

master
CMM 1 year ago
parent
commit
9cd10f6188
2 changed files with 41 additions and 1 deletions
  1. +11
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java
  2. +30
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java

+ 11
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java View File

@@ -43,6 +43,12 @@ public class ProjectDeclareAction {
project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode()); project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode());
} }


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



@OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE") @OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE")
public void PRELIMINARY_REVIEW_DECLARE(Message<ProjectStatusChangeEvent> message) { public void PRELIMINARY_REVIEW_DECLARE(Message<ProjectStatusChangeEvent> message) {
@@ -75,7 +81,6 @@ public class ProjectDeclareAction {
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
} }



@OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW") @OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW")
public void PRELIMINARY_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { public void PRELIMINARY_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
@@ -145,6 +150,11 @@ public class ProjectDeclareAction {
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
} }


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


@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED") @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED")
public void PLAN_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { public void PLAN_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) {


+ 30
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java View File

@@ -82,6 +82,11 @@ public class ProjectDeclareStateMachineBuilder {
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT) .source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.target(ProjectStatusEnum.TO_BE_DECLARED) .target(ProjectStatusEnum.TO_BE_DECLARED)
.event(ProjectStatusChangeEvent.UNDER_INTERNAL_WITHDRAW).and() .event(ProjectStatusChangeEvent.UNDER_INTERNAL_WITHDRAW).and()
// 单位内部审核不通过重新提交,从单位内部审核不通过到单位内部审核中
.withExternal()
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS)
.target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.event(ProjectStatusChangeEvent.PROJECT_APPLICATION_SUBMIT).and()
// 待预审预审申报,从待预审到待预审选择 // 待预审预审申报,从待预审到待预审选择
.withExternal() .withExternal()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION) .source(ProjectStatusEnum.PENDING_PREQUALIFICATION)
@@ -107,6 +112,16 @@ public class ProjectDeclareStateMachineBuilder {
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS) .source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION) .target(ProjectStatusEnum.PENDING_PREQUALIFICATION)
.event(ProjectStatusChangeEvent.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW).and() .event(ProjectStatusChangeEvent.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW).and()
// 省级部门联审不通过重新申报,从省级部门联审不通过到待预审选择
.withExternal()
.source(ProjectStatusEnum.PRE_APPLYING)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and()
// 省级部门联审不通过重新申报,从待预审选择->省级部门联审中,待预审,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PRE_APPLYING)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PENDING_PREQUALIFICATION,projectDeclareAction.new ProjectDeclareChoiceAction()).and()
// 预审通过,从预审中到部门联审中 // 预审通过,从预审中到部门联审中
.withExternal() .withExternal()
.source(ProjectStatusEnum.PRE_APPLYING) .source(ProjectStatusEnum.PRE_APPLYING)
@@ -127,6 +142,16 @@ public class ProjectDeclareStateMachineBuilder {
.source(ProjectStatusEnum.PRE_APPLYING) .source(ProjectStatusEnum.PRE_APPLYING)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction()) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PENDING_PREQUALIFICATION,projectDeclareAction.new ProjectDeclareChoiceAction()).and() .last(ProjectStatusEnum.PENDING_PREQUALIFICATION,projectDeclareAction.new ProjectDeclareChoiceAction()).and()
// 预审不通过重新提交,从预审不通过到待预审选择
.withExternal()
.source(ProjectStatusEnum.PREQUALIFICATION_FAILED)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.event(ProjectStatusChangeEvent.PRELIMINARY_REVIEW_DECLARE).and()
// 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),projectDeclareAction.new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PRE_APPLYING,projectDeclareAction.new ProjectDeclareChoiceAction()).and()
// 部门联审通过,从部门联审中到年度计划中 // 部门联审通过,从部门联审中到年度计划中
.withExternal() .withExternal()
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) .source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW)
@@ -172,6 +197,11 @@ public class ProjectDeclareStateMachineBuilder {
.source(ProjectStatusEnum.SCHEME_UNDER_REVIEW) .source(ProjectStatusEnum.SCHEME_UNDER_REVIEW)
.target(ProjectStatusEnum.PLAN_TO_BE_DECLARED) .target(ProjectStatusEnum.PLAN_TO_BE_DECLARED)
.event(ProjectStatusChangeEvent.SCHEME_UNDER_REVIEW_WITHDRAW).and() .event(ProjectStatusChangeEvent.SCHEME_UNDER_REVIEW_WITHDRAW).and()
// 方案评审不通过重新提交,从方案评审不通过到方案评审中
.withExternal()
.source(ProjectStatusEnum.SCHEME_REVIEW_FAILED)
.target(ProjectStatusEnum.SCHEME_UNDER_REVIEW)
.event(ProjectStatusChangeEvent.DECLARE_PLAN).and()
// 待立项批复批复,从待立项批复到待采购 // 待立项批复批复,从待立项批复到待采购
.withExternal() .withExternal()
.source(ProjectStatusEnum.TO_BE_APPROVED) .source(ProjectStatusEnum.TO_BE_APPROVED)


Loading…
Cancel
Save