Browse Source

项目状态优化

tags/24080901
WendyYang 7 months ago
parent
commit
51a0a04667
77 changed files with 785 additions and 813 deletions
  1. +5
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/AdaptStateChangeAction.java
  2. +17
    -17
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java
  3. +48
    -48
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectStateChangeAction.java
  4. +5
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/SelfTestStateChangeAction.java
  5. +9
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java
  6. +5
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TestValidStateChangeAction.java
  7. +5
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/XcfhxStateChangeAction.java
  8. +22
    -22
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/AdaptStateMachineBuilderImpl.java
  9. +99
    -98
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/ProjectStateMachineBuilderImpl.java
  10. +22
    -22
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/SelfTestStateMachineBuilderImpl.java
  11. +30
    -30
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/TenderStateMachineBuilderImpl.java
  12. +22
    -22
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/TestValidStateMachineBuilderImpl.java
  13. +22
    -26
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/XcfhxStateMachineBuilderImpl.java
  14. +40
    -40
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/ProjectStateChangeEvent.java
  15. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/factory/ProjectDeclareGuardFactory.java
  16. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/AdaptStateMachineUtil.java
  17. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/ProjectStateMachineUtil.java
  18. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/SelfTestStateMachineUtil.java
  19. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/TenderStateMachineUtil.java
  20. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/TestValidStateMachineUtil.java
  21. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/XcfhxStateMachineUtil.java
  22. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java
  23. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/FundStatisticsManage.java
  24. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/ProjectFileManage.java
  25. +4
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectConvertUtil.java
  26. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/IrsProjectManage.java
  27. +6
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java
  28. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/OrgSelfAppraisalManage.java
  29. +4
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/PerformanceAppraisalPlanManage.java
  30. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/RectifyManage.java
  31. +23
    -23
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java
  32. +8
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java
  33. +5
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java
  34. +10
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DelayedApplyManage.java
  35. +14
    -14
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java
  36. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/OperationManage.java
  37. +18
    -18
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
  38. +8
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java
  39. +26
    -25
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  40. +3
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByDeptJointManage.java
  41. +6
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java
  42. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java
  43. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IPurchaseService.java
  44. +6
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java
  45. +4
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/FinalInspectionHandle.java
  46. +4
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectAdaptionHandle.java
  47. +6
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectApprovalHandle.java
  48. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectPurchaseHandle.java
  49. +1
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectSelfTestHandle.java
  50. +1
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectTestValidHandle.java
  51. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/XcfhxReviewHandle.java
  52. +6
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AnnualPlanLibManage.java
  53. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java
  54. +18
    -18
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java
  55. +16
    -16
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  56. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java
  57. +0
    -52
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderStatusEnum.java
  58. +6
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/WarningFlowTypeEnum.java
  59. +3
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/WarningOperationTypeEnum.java
  60. +21
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/IStatus.java
  61. +15
    -30
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java
  62. +8
    -13
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderAdaptStatus.java
  63. +8
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderSelfTestStatus.java
  64. +49
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderStatus.java
  65. +8
    -13
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderTestValidStatus.java
  66. +8
    -13
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderXcfhxApplyStatus.java
  67. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java
  68. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/safety/model/vo/ProjectMonitorVO.java
  69. +3
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java
  70. +4
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/CheckProvincialReviewResultTask.java
  71. +23
    -23
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/CockpitStatsStatisticsTask.java
  72. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/DeclaredRecordReminderTask.java
  73. +3
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningInstanceNotStartTask.java
  74. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java
  75. +10
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java
  76. +3
    -3
      hz-pm-api/src/test/java/com/hz/pm/api/provincial/Test.java
  77. +3
    -3
      hz-pm-api/src/test/java/com/hz/pm/api/sys/project/ProjectStateTest.java

+ 5
- 5
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/AdaptStateChangeAction.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.builder.impl.AdaptStateMachineBuilderIm
import com.hz.pm.api.common.statemachine.event.AdaptStateChangeEvent;
import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderAdaptStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderAdaptStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.statemachine.annotation.OnTransition;
@@ -32,25 +32,25 @@ public class AdaptStateChangeAction {
@OnTransition(source = "WITHOUT_ADAPT_INFO", target = "ADAPT_INFO_AUDIT")
public void SUBMIT_ADAPT_INFO(Message<AdaptStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setAdaptStatus(TenderAdaptStatusEnum.ADAPT_INFO_AUDIT.getCode());
purchase.setAdaptStatus(TenderAdaptStatus.ADAPT_INFO_AUDIT.getCode());
}

@OnTransition(source = "ADAPT_INFO_AUDIT", target = "ADAPT_INFO_PASSED")
public void ADAPT_INFO_PASSED(Message<AdaptStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setAdaptStatus(TenderAdaptStatusEnum.ADAPT_INFO_PASSED.getCode());
purchase.setAdaptStatus(TenderAdaptStatus.ADAPT_INFO_PASSED.getCode());
}

@OnTransition(source = "ADAPT_INFO_AUDIT", target = "ADAPT_INFO_FAILED")
public void ADAPT_INFO_FAILED(Message<AdaptStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setAdaptStatus(TenderAdaptStatusEnum.ADAPT_INFO_FAILED.getCode());
purchase.setAdaptStatus(TenderAdaptStatus.ADAPT_INFO_FAILED.getCode());
}

@OnTransition(source = "ADAPT_INFO_FAILED", target = "ADAPT_INFO_AUDIT")
public void RESUBMIT_ADAPT_INFO(Message<AdaptStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setAdaptStatus(TenderAdaptStatusEnum.ADAPT_INFO_AUDIT.getCode());
purchase.setAdaptStatus(TenderAdaptStatus.ADAPT_INFO_AUDIT.getCode());
}

}

+ 17
- 17
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java View File

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.hz.pm.api.common.model.constant.StateMachineConst;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import lombok.extern.slf4j.Slf4j;
@@ -24,14 +24,14 @@ import static com.hz.pm.api.common.model.constant.StateMachineConst.APPLICATION_
* @since 2023/02/07 22:31
*/
@Slf4j
public class ProjectDeclareActionChoice implements Action<ProjectStatusEnum, ProjectStateChangeEvent> {
public class ProjectDeclareActionChoice implements Action<ProjectStatus, ProjectStateChangeEvent> {

private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE;

@Override
public void execute(StateContext<ProjectStatusEnum, ProjectStateChangeEvent> stateContext) {
public void execute(StateContext<ProjectStatus, ProjectStateChangeEvent> stateContext) {
log.info(String.valueOf(stateContext.getTarget().getId()));
ProjectStatusEnum projectStatusEnum = stateContext.getTarget().getId();
ProjectStatus projectStatusEnum = stateContext.getTarget().getId();
switch (projectStatusEnum) {
case PENDING_PREQUALIFICATION_CHOICE:
preDeclareChoice(stateContext);
@@ -47,14 +47,14 @@ public class ProjectDeclareActionChoice implements Action<ProjectStatusEnum, Pro
}
}

private void approvedAfterChoice(StateContext<ProjectStatusEnum, ProjectStateChangeEvent> stateContext) {
private void approvedAfterChoice(StateContext<ProjectStatus, ProjectStateChangeEvent> stateContext) {
Project project = getProject(stateContext);
List<ProjectApplication> projectApplications = getProjectApplication(stateContext);
log.info("立项批复之后,项目的状态为:{}", project.getStatus());
// 判断 是否有初次创建的应用
if (CollUtil.isEmpty(projectApplications)) {
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
project.setStage(ProjectStatus.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatus.TO_BE_PURCHASED.getCode());
}
final boolean[] isFirstApp = {Boolean.FALSE};
projectApplications.forEach(app -> {
@@ -64,34 +64,34 @@ public class ProjectDeclareActionChoice implements Action<ProjectStatusEnum, Pro
}
});
if (isFirstApp[0]) {
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.TO_BE_APP_REGISTER.getCode());
project.setStage(ProjectStatus.NOT_APPROVED.getCode());
project.setStatus(ProjectStatus.TO_BE_APP_REGISTER.getCode());
} else {
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
project.setStage(ProjectStatus.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatus.TO_BE_PURCHASED.getCode());
}
}

private void preDeclareChoice(StateContext<ProjectStatusEnum, ProjectStateChangeEvent> stateContext) {
private void preDeclareChoice(StateContext<ProjectStatus, ProjectStateChangeEvent> stateContext) {
Project project = getProject(stateContext);
log.info("预审申报事件之前,项目的状态为:{}", project.getStatus());
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
project.setStatus(ProjectStatus.PRE_APPLYING.getCode());
}

private void preWithDrawChoice(StateContext<ProjectStatusEnum, ProjectStateChangeEvent> stateContext) {
private void preWithDrawChoice(StateContext<ProjectStatus, ProjectStateChangeEvent> stateContext) {
Project project = getProject(stateContext);
log.info("预审中撤回事件之前,项目的状态为:{}", project.getStatus());
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
project.setStatus(ProjectStatus.PENDING_PREQUALIFICATION.getCode());
}

private Project getProject(StateContext<ProjectStatusEnum, ProjectStateChangeEvent> stateContext) {
private Project getProject(StateContext<ProjectStatus, ProjectStateChangeEvent> stateContext) {
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
Assert.notNull(project, "项目信息获取失败%s", JSONUtil.toJsonStr(stateContext.getMessage()));
return project;
}

@SuppressWarnings("unchecked")
private List<ProjectApplication> getProjectApplication(StateContext<ProjectStatusEnum, ProjectStateChangeEvent> stateContext) {
private List<ProjectApplication> getProjectApplication(StateContext<ProjectStatus, ProjectStateChangeEvent> stateContext) {
return stateContext.getMessage().getHeaders().get(APPLICATION_DECLARE, List.class);
}



+ 48
- 48
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectStateChangeAction.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.model.constant.StateMachineConst;
import com.hz.pm.api.common.statemachine.builder.impl.ProjectStateMachineBuilderImpl;
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.statemachine.annotation.OnTransition;
@@ -32,168 +32,168 @@ public class ProjectStateChangeAction {
@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION")
public void UNDER_INTERNAL_PASS(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
project.setStatus(ProjectStatus.PENDING_PREQUALIFICATION.getCode());
}

@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "UNDER_INTERNAL_AUDIT_NOT_PASS")
public void UNDER_INTERNAL_REJECT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode());
project.setStatus(ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode());
}

@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "TO_BE_DECLARED")
public void UNDER_INTERNAL_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode());
project.setStatus(ProjectStatus.TO_BE_DECLARED.getCode());
}

@OnTransition(source = "UNDER_INTERNAL_AUDIT_NOT_PASS", target = "UNDER_INTERNAL_AUDIT")
public void UNDER_INTERNAL_REJECT_RESUBMIT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
project.setStatus(ProjectStatus.UNDER_INTERNAL_AUDIT.getCode());
}


@OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE")
public void PRELIMINARY_REVIEW_DECLARE(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
project.setStatus(ProjectStatus.PENDING_PREQUALIFICATION_CHOICE.getCode());
}

@OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT")
public void PENDING_PREQUALIFICATION_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
project.setStatus(ProjectStatus.UNDER_INTERNAL_AUDIT.getCode());
}


@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS")
public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
project.setStatus(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
}

@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS", target = "PRE_APPLYING")
public void PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
project.setStatus(ProjectStatus.PRE_APPLYING.getCode());
}

@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED")
public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode());
project.setStatus(ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode());
}

@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PENDING_PREQUALIFICATION")
public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
project.setStatus(ProjectStatus.PENDING_PREQUALIFICATION.getCode());
}

@OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW")
public void PRELIMINARY_REVIEW_PASS(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
project.setStatus(ProjectStatus.DEPARTMENT_JOINT_REVIEW.getCode());
}

@OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_FAILED")
public void PRELIMINARY_REVIEW_REJECT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode());
project.setStatus(ProjectStatus.PREQUALIFICATION_FAILED.getCode());
}

@OnTransition(source = "PREQUALIFICATION_FAILED", target = "PENDING_PREQUALIFICATION_CHOICE")
public void PRELIMINARY_REVIEW_REJECT_RESUBMIT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
project.setStatus(ProjectStatus.PENDING_PREQUALIFICATION_CHOICE.getCode());
}

@OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_WITHDRAW_CHOICE")
public void PRE_APPLYING_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE.getCode());
project.setStatus(ProjectStatus.PREQUALIFICATION_WITHDRAW_CHOICE.getCode());
}


@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN")
public void DEPARTMENT_UNITED_REVIEW_PASS(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
project.setStatus(ProjectStatus.IN_THE_ANNUAL_PLAN.getCode());
}

@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED")
public void DEPARTMENT_UNITED_REVIEW_REJECT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode());
project.setStatus(ProjectStatus.DEPARTMENT_JOINT_REVIEW_FAILED.getCode());
}

@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PRE_APPLYING")
public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
project.setStatus(ProjectStatus.PRE_APPLYING.getCode());
}


@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED")
public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
project.setStatus(ProjectStatus.PLAN_TO_BE_DECLARED.getCode());
}

@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED")
public void ANNUAL_PLAN_SUSPEND(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode());
project.setStatus(ProjectStatus.BE_SUSPENDED.getCode());
}

@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "DEPARTMENT_JOINT_REVIEW")
public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
project.setStatus(ProjectStatus.DEPARTMENT_JOINT_REVIEW.getCode());
}


@OnTransition(source = "PLAN_TO_BE_DECLARED", target = "SCHEME_UNDER_REVIEW")
public void DECLARE_PLAN(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode());
}

@OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN")
public void PLAN_TO_DECLARE_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
project.setStatus(ProjectStatus.IN_THE_ANNUAL_PLAN.getCode());
}

@OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW")
public void DECLARE_PLAN_RESUBMIT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode());
}

@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED")
public void PLAN_REVIEW_PASS(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
project.setStatus(ProjectStatus.TO_BE_APPROVED.getCode());
}

@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED")
public void PLAN_REVIEW_REJECT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode());
project.setStatus(ProjectStatus.SCHEME_REVIEW_FAILED.getCode());
}

@OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW")
public void PLAN_REVIEW_REJECT_RESUBMIT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode());
}

@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "PLAN_TO_BE_DECLARED")
public void SCHEME_UNDER_REVIEW_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
project.setStatus(ProjectStatus.PLAN_TO_BE_DECLARED.getCode());
}

//==================================================================================================================
@@ -202,27 +202,27 @@ public class ProjectStateChangeAction {
public void DECLARED_RECORD_SUBMIT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
// 待立项批复批复后,项目一级状态变更为已立项
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.getCode());
project.setStatus(ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING.getCode());
}

@OnTransition(source = "DECLARED_APPROVED_RECORD_FAILED", target = "DECLARED_APPROVED_RECORD_AUDITING")
public void DECLARED_RECORD_RESUBMIT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.getCode());
project.setStatus(ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING.getCode());
}

@OnTransition(source = "DECLARED_APPROVED_RECORD_AUDITING", target = "TO_BE_PURCHASED")
public void DECLARED_RECORD_PASS(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
// 待立项批复批复后,项目一级状态变更为已立项
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
project.setStage(ProjectStatus.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatus.TO_BE_PURCHASED.getCode());
}

@OnTransition(source = "DECLARED_APPROVED_RECORD_AUDITING", target = "DECLARED_APPROVED_RECORD_FAILED")
public void DECLARED_RECORD_FAILED(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode());
project.setStatus(ProjectStatus.DECLARED_APPROVED_RECORD_FAILED.getCode());
}

//==================================================================================================================
@@ -231,78 +231,78 @@ public class ProjectStateChangeAction {
public void PROJECT_APPROVAL(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
// 待立项批复批复后,项目一级状态变更为已立项
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
project.setStage(ProjectStatus.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatus.TO_BE_PURCHASED.getCode());
}

@OnTransition(source = "TO_BE_APPROVED", target = "SCHEME_UNDER_REVIEW")
public void TO_BE_APPROVED_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode());
}

@OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION")
public void START_TO_WORK(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
project.setStatus(ProjectStatus.UNDER_CONSTRUCTION.getCode());
}

@OnTransition(source = "TO_BE_PURCHASED", target = "TO_BE_APPROVED")
public void TO_BE_PURCHASED_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
// 待采购状态撤回后,项目一级状态回退到未立项
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
project.setStage(ProjectStatus.NOT_APPROVED.getCode());
project.setStatus(ProjectStatus.TO_BE_APPROVED.getCode());
}

@OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_PURCHASED")
public void UNDER_CONSTRUCTION_WITHDRAW(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
project.setStatus(ProjectStatus.TO_BE_PURCHASED.getCode());
}

@OnTransition(source = "TO_BE_PURCHASED", target = "ON_PURCHASING")
public void SUBMIT_PURCHASE_NOTICE(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.ON_PURCHASING.getCode());
project.setStatus(ProjectStatus.ON_PURCHASING.getCode());
}

@OnTransition(source = "ON_PURCHASING", target = "TO_BE_FIRST_INSPECTED")
public void SUBMIT_OPERATION_PLAN(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.TO_BE_FIRST_INSPECTED.getCode());
project.setStatus(ProjectStatus.TO_BE_FIRST_INSPECTED.getCode());
}

@OnTransition(source = "TO_BE_FIRST_INSPECTED", target = "ON_PILOT_RUNNING")
public void SUBMIT_FIRST_INSPECTED_FILES(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.ON_PILOT_RUNNING.getCode());
project.setStatus(ProjectStatus.ON_PILOT_RUNNING.getCode());
}

@OnTransition(source = "ON_PILOT_RUNNING", target = "ON_FINALLY_INSPECTED")
public void FINAL_ACCEPTANCE_APPLICATION(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.ON_FINALLY_INSPECTED.getCode());
project.setStatus(ProjectStatus.ON_FINALLY_INSPECTED.getCode());
}

@OnTransition(source = "ON_FINALLY_INSPECTED", target = "ARCHIVED")
public void FINAL_ACCEPTANCE_PASS(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
// 终验审核通过后,项目一级状态变更为已归档
project.setStage(ProjectStatusEnum.ARCHIVED.getCode());
project.setStatus(ProjectStatusEnum.ACCEPTED.getCode());
project.setStage(ProjectStatus.ARCHIVED.getCode());
project.setStatus(ProjectStatus.ACCEPTED.getCode());
}

@OnTransition(source = "ON_FINALLY_INSPECTED", target = "FINALLY_INSPECTED_FAILED")
public void FINAL_ACCEPTANCE_REJECT(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.FINALLY_INSPECTED_FAILED.getCode());
project.setStatus(ProjectStatus.FINALLY_INSPECTED_FAILED.getCode());
}

@OnTransition(source = "FINALLY_INSPECTED_FAILED", target = "ON_FINALLY_INSPECTED")
public void FINAL_RE_ACCEPTANCE_APPLICATION(Message<ProjectStateChangeEvent> message) {
Project project = getProject(message);
project.setStatus(ProjectStatusEnum.ON_FINALLY_INSPECTED.getCode());
project.setStatus(ProjectStatus.ON_FINALLY_INSPECTED.getCode());
}

}

+ 5
- 5
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/SelfTestStateChangeAction.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.builder.impl.SelfTestStateMachineBuilde
import com.hz.pm.api.common.statemachine.event.SelfTestStateChangeEvent;
import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderSelfTestStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderSelfTestStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.statemachine.annotation.OnTransition;
@@ -32,25 +32,25 @@ public class SelfTestStateChangeAction {
@OnTransition(source = "WITHOUT_SELF_TEST_INFO", target = "SELF_TEST_INFO_AUDIT")
public void SUBMIT_SELF_TEST_INFO(Message<SelfTestStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setSelfTestStatus(TenderSelfTestStatusEnum.SELF_TEST_INFO_AUDIT.getCode());
purchase.setSelfTestStatus(TenderSelfTestStatus.SELF_TEST_INFO_AUDIT.getCode());
}

@OnTransition(source = "SELF_TEST_INFO_AUDIT", target = "SELF_TEST_INFO_PASSED")
public void SELF_TEST_INFO_PASSED(Message<SelfTestStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setSelfTestStatus(TenderSelfTestStatusEnum.SELF_TEST_INFO_PASSED.getCode());
purchase.setSelfTestStatus(TenderSelfTestStatus.SELF_TEST_INFO_PASSED.getCode());
}

@OnTransition(source = "SELF_TEST_INFO_AUDIT", target = "SELF_TEST_INFO_FAILED")
public void SELF_TEST_INFO_FAILED(Message<SelfTestStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setSelfTestStatus(TenderSelfTestStatusEnum.SELF_TEST_INFO_FAILED.getCode());
purchase.setSelfTestStatus(TenderSelfTestStatus.SELF_TEST_INFO_FAILED.getCode());
}

@OnTransition(source = "SELF_TEST_INFO_FAILED", target = "SELF_TEST_INFO_AUDIT")
public void RESUBMIT_SELF_TEST_INFO(Message<SelfTestStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setSelfTestStatus(TenderSelfTestStatusEnum.SELF_TEST_INFO_AUDIT.getCode());
purchase.setSelfTestStatus(TenderSelfTestStatus.SELF_TEST_INFO_AUDIT.getCode());
}

}

+ 9
- 9
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.builder.impl.TenderStateMachineBuilderI
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.statemachine.annotation.OnTransition;
@@ -37,7 +37,7 @@ public class TenderStateChangeAction {
@OnTransition(source = "TO_BE_SUBMIT_PURCHASE_INFO", target = "TO_BE_SUBMIT_CONSTRUCTION_INFO")
public void SUBMIT_PURCHASE_INFO(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setStatus(TenderStatusEnum.TO_BE_SUBMIT_CONSTRUCTION_INFO.getTenderStatus());
purchase.setStatus(TenderStatus.TO_BE_SUBMIT_CONSTRUCTION_INFO.getCode());
}

/**
@@ -48,7 +48,7 @@ public class TenderStateChangeAction {
@OnTransition(source = "TO_BE_SUBMIT_CONSTRUCTION_INFO", target = "TO_BE_SUBMIT_OPERATION_PLAN")
public void SUBMIT_CONSTRUCTION_INFO(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setStatus(TenderStatusEnum.TO_BE_SUBMIT_OPERATION_PLAN.getTenderStatus());
purchase.setStatus(TenderStatus.TO_BE_SUBMIT_OPERATION_PLAN.getCode());
}

/**
@@ -59,7 +59,7 @@ public class TenderStateChangeAction {
@OnTransition(source = "TO_BE_SUBMIT_OPERATION_PLAN", target = "TO_BE_SUBMIT_FIRST_INSPECTED_INFO")
public void SUBMIT_OPERATION_PLAN(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setStatus(TenderStatusEnum.TO_BE_SUBMIT_FIRST_INSPECTED_INFO.getTenderStatus());
purchase.setStatus(TenderStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO.getCode());
}

/**
@@ -70,7 +70,7 @@ public class TenderStateChangeAction {
@OnTransition(source = "TO_BE_SUBMIT_FIRST_INSPECTED_INFO", target = "TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY")
public void SUBMIT_FIRST_INSPECTED_FILES(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setStatus(TenderStatusEnum.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY.getTenderStatus());
purchase.setStatus(TenderStatus.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY.getCode());
}

/**
@@ -81,7 +81,7 @@ public class TenderStateChangeAction {
@OnTransition(source = "TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY", target = "ON_FINALLY_INSPECTED_APPLY")
public void SUBMIT_FINALLY_INSPECTED(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setStatus(TenderStatusEnum.ON_FINALLY_INSPECTED_APPLY.getTenderStatus());
purchase.setStatus(TenderStatus.ON_FINALLY_INSPECTED_APPLY.getCode());
}

/**
@@ -92,7 +92,7 @@ public class TenderStateChangeAction {
@OnTransition(source = "FINALLY_INSPECTED_FAILED", target = "ON_FINALLY_INSPECTED_APPLY")
public void RESUBMIT_FINALLY_INSPECTED(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setStatus(TenderStatusEnum.ON_FINALLY_INSPECTED_APPLY.getTenderStatus());
purchase.setStatus(TenderStatus.ON_FINALLY_INSPECTED_APPLY.getCode());
}

/**
@@ -103,7 +103,7 @@ public class TenderStateChangeAction {
@OnTransition(source = "ON_FINALLY_INSPECTED_APPLY", target = "FINALLY_INSPECTED_PASSED")
public void FINALLY_INSPECTED_PASSED(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setStatus(TenderStatusEnum.FINALLY_INSPECTED_PASSED.getTenderStatus());
purchase.setStatus(TenderStatus.FINALLY_INSPECTED_PASSED.getCode());
}

/**
@@ -114,7 +114,7 @@ public class TenderStateChangeAction {
@OnTransition(source = "ON_FINALLY_INSPECTED_APPLY", target = "FINALLY_INSPECTED_FAILED")
public void FINALLY_INSPECTED_FAILED(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setStatus(TenderStatusEnum.FINALLY_INSPECTED_FAILED.getTenderStatus());
purchase.setStatus(TenderStatus.FINALLY_INSPECTED_FAILED.getCode());
}

}

+ 5
- 5
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TestValidStateChangeAction.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.builder.impl.TestValidStateMachineBuild
import com.hz.pm.api.common.statemachine.event.TestValidStateChangeEvent;
import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderTestValidStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderTestValidStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.statemachine.annotation.OnTransition;
@@ -32,25 +32,25 @@ public class TestValidStateChangeAction {
@OnTransition(source = "WITHOUT_TEST_VALID_INFO", target = "TEST_VALID_INFO_AUDIT")
public void SUBMIT_TEST_VALID_INFO(Message<TestValidStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setTestValidStatus(TenderTestValidStatusEnum.TEST_VALID_INFO_AUDIT.getCode());
purchase.setTestValidStatus(TenderTestValidStatus.TEST_VALID_INFO_AUDIT.getCode());
}

@OnTransition(source = "TEST_VALID_INFO_AUDIT", target = "TEST_VALID_INFO_PASSED")
public void TEST_VALID_INFO_PASSED(Message<TestValidStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setTestValidStatus(TenderTestValidStatusEnum.TEST_VALID_INFO_PASSED.getCode());
purchase.setTestValidStatus(TenderTestValidStatus.TEST_VALID_INFO_PASSED.getCode());
}

@OnTransition(source = "TEST_VALID_INFO_AUDIT", target = "TEST_VALID_INFO_FAILED")
public void TEST_VALID_INFO_FAILED(Message<TestValidStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setTestValidStatus(TenderTestValidStatusEnum.TEST_VALID_INFO_FAILED.getCode());
purchase.setTestValidStatus(TenderTestValidStatus.TEST_VALID_INFO_FAILED.getCode());
}

@OnTransition(source = "TEST_VALID_INFO_FAILED", target = "TEST_VALID_INFO_AUDIT")
public void RESUBMIT_TEST_VALID_INFO(Message<TestValidStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setTestValidStatus(TenderTestValidStatusEnum.TEST_VALID_INFO_AUDIT.getCode());
purchase.setTestValidStatus(TenderTestValidStatus.TEST_VALID_INFO_AUDIT.getCode());
}

}

+ 5
- 5
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/XcfhxStateChangeAction.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.builder.impl.XcfhxStateMachineBuilderIm
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderXcfhxApplyStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderXcfhxApplyStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.statemachine.annotation.OnTransition;
@@ -37,7 +37,7 @@ public class XcfhxStateChangeAction {
@OnTransition(source = "TO_BE_SUBMIT_XCFHX_APPLY", target = "ON_XCFHX_APPLY")
public void SUBMIT_XCFHX_APPLY(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatusEnum.ON_XCFHX_APPLY.getCode());
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatus.ON_XCFHX_APPLY.getCode());
}

/**
@@ -48,7 +48,7 @@ public class XcfhxStateChangeAction {
@OnTransition(source = "ON_XCFHX_APPLY", target = "XCFHX_APPLY_PASSED")
public void XCFHX_APPLY_PASSED(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatusEnum.XCFHX_APPLY_PASSED.getCode());
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode());
}

/**
@@ -59,7 +59,7 @@ public class XcfhxStateChangeAction {
@OnTransition(source = "ON_XCFHX_APPLY", target = "XCFHX_APPLY_FAILED")
public void XCFHX_APPLY_FAILED(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatusEnum.XCFHX_APPLY_FAILED.getCode());
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatus.XCFHX_APPLY_FAILED.getCode());
}

/**
@@ -70,7 +70,7 @@ public class XcfhxStateChangeAction {
@OnTransition(source = "XCFHX_APPLY_FAILED", target = "ON_XCFHX_APPLY")
public void RESUBMIT_XCFHX_APPLY(Message<ProjectStateChangeEvent> message) {
Purchase purchase = getPurchaseInfo(message);
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatusEnum.ON_XCFHX_APPLY.getCode());
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatus.ON_XCFHX_APPLY.getCode());
}

}

+ 22
- 22
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/AdaptStateMachineBuilderImpl.java View File

@@ -3,7 +3,7 @@ package com.hz.pm.api.common.statemachine.builder.impl;
import com.hz.pm.api.common.statemachine.builder.BaseStateMachineBuilder;
import com.hz.pm.api.common.statemachine.event.AdaptStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderAdaptStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderAdaptStatus;
import com.ningdatech.basic.exception.BizException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -34,22 +34,22 @@ import java.util.EnumSet;
@Component
@EnableStateMachine(name = AdaptStateMachineBuilderImpl.MACHINE_ID)
@RequiredArgsConstructor
public class AdaptStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, AdaptStateChangeEvent, TenderAdaptStatusEnum> {
public class AdaptStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, AdaptStateChangeEvent, TenderAdaptStatus> {

public static final String MACHINE_ID = "adaptStateMachine";

private final BeanFactory beanFactory;

@Override
public StateMachine<TenderAdaptStatusEnum, AdaptStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderAdaptStatusEnum, AdaptStateChangeEvent> stateMachine = build(beanFactory);
public StateMachine<TenderAdaptStatus, AdaptStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderAdaptStatus, AdaptStateChangeEvent> stateMachine = build(beanFactory);
log.info("状态机ID:" + stateMachine.getId());
stateMachine.start();
return stateMachine;
}

@Override
public StateMachine<TenderAdaptStatusEnum, AdaptStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
public StateMachine<TenderAdaptStatus, AdaptStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
try {
return buildStateMachine(beanFactory);
} catch (Exception e) {
@@ -57,8 +57,8 @@ public class AdaptStateMachineBuilderImpl implements BaseStateMachineBuilder<Pur
}
}

private StateMachine<TenderAdaptStatusEnum, AdaptStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderAdaptStatusEnum, AdaptStateChangeEvent> builder = StateMachineBuilder.builder();
private StateMachine<TenderAdaptStatus, AdaptStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderAdaptStatus, AdaptStateChangeEvent> builder = StateMachineBuilder.builder();
builder.configureConfiguration()
.withConfiguration()
.machineId(MACHINE_ID)
@@ -66,28 +66,28 @@ public class AdaptStateMachineBuilderImpl implements BaseStateMachineBuilder<Pur

builder.configureStates()
.withStates()
.initial(TenderAdaptStatusEnum.WITHOUT_ADAPT_INFO)
.states(EnumSet.allOf(TenderAdaptStatusEnum.class));
.initial(TenderAdaptStatus.WITHOUT_ADAPT_INFO)
.states(EnumSet.allOf(TenderAdaptStatus.class));

builder.configureTransitions()
.withExternal()
.source(TenderAdaptStatusEnum.WITHOUT_ADAPT_INFO)
.target(TenderAdaptStatusEnum.ADAPT_INFO_AUDIT)
.source(TenderAdaptStatus.WITHOUT_ADAPT_INFO)
.target(TenderAdaptStatus.ADAPT_INFO_AUDIT)
.event(AdaptStateChangeEvent.SUBMIT_ADAPT_INFO)
.and()
.withExternal()
.source(TenderAdaptStatusEnum.ADAPT_INFO_AUDIT)
.target(TenderAdaptStatusEnum.ADAPT_INFO_PASSED)
.source(TenderAdaptStatus.ADAPT_INFO_AUDIT)
.target(TenderAdaptStatus.ADAPT_INFO_PASSED)
.event(AdaptStateChangeEvent.ADAPT_INFO_PASSED)
.and()
.withExternal()
.source(TenderAdaptStatusEnum.ADAPT_INFO_AUDIT)
.target(TenderAdaptStatusEnum.ADAPT_INFO_FAILED)
.source(TenderAdaptStatus.ADAPT_INFO_AUDIT)
.target(TenderAdaptStatus.ADAPT_INFO_FAILED)
.event(AdaptStateChangeEvent.ADAPT_INFO_FAILED)
.and()
.withExternal()
.source(TenderAdaptStatusEnum.ADAPT_INFO_FAILED)
.target(TenderAdaptStatusEnum.ADAPT_INFO_AUDIT)
.source(TenderAdaptStatus.ADAPT_INFO_FAILED)
.target(TenderAdaptStatus.ADAPT_INFO_AUDIT)
.event(AdaptStateChangeEvent.RESUBMIT_ADAPT_INFO)
.and();
return builder.build();
@@ -95,16 +95,16 @@ public class AdaptStateMachineBuilderImpl implements BaseStateMachineBuilder<Pur

@Override
@Bean(name = "adaptStatePersister")
public StateMachinePersister<TenderAdaptStatusEnum, AdaptStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderAdaptStatusEnum, AdaptStateChangeEvent, Purchase>() {
public StateMachinePersister<TenderAdaptStatus, AdaptStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderAdaptStatus, AdaptStateChangeEvent, Purchase>() {
@Override
public void write(StateMachineContext<TenderAdaptStatusEnum, AdaptStateChangeEvent> context, Purchase contextObj) {
public void write(StateMachineContext<TenderAdaptStatus, AdaptStateChangeEvent> context, Purchase contextObj) {
log.info("当前项目为:{}", contextObj);
}

@Override
public StateMachineContext<TenderAdaptStatusEnum, AdaptStateChangeEvent> read(Purchase contextObj) {
TenderAdaptStatusEnum status = TenderAdaptStatusEnum.get(contextObj.getAdaptStatus())
public StateMachineContext<TenderAdaptStatus, AdaptStateChangeEvent> read(Purchase contextObj) {
TenderAdaptStatus status = TenderAdaptStatus.get(contextObj.getAdaptStatus())
.orElseThrow(() -> BizException.wrap("系统自测状态无效"));
return new DefaultStateMachineContext<>(status, null, null, null, null, MACHINE_ID);
}


+ 99
- 98
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/ProjectStateMachineBuilderImpl.java View File

@@ -5,7 +5,8 @@ import com.hz.pm.api.common.statemachine.builder.BaseStateMachineBuilder;
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.common.statemachine.factory.ProjectDeclareGuardFactory.PendingPreQualificationChoiceGuard;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.ningdatech.basic.exception.BizException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.BeanFactory;
@@ -34,15 +35,15 @@ import java.util.EnumSet;
@Component
@EnableStateMachine(name = ProjectStateMachineBuilderImpl.MACHINE_ID)
@RequiredArgsConstructor
public class ProjectStateMachineBuilderImpl implements BaseStateMachineBuilder<Project, ProjectStateChangeEvent, ProjectStatusEnum> {
public class ProjectStateMachineBuilderImpl implements BaseStateMachineBuilder<Project, ProjectStateChangeEvent, ProjectStatus> {

public static final String MACHINE_ID = "projectDeclareStateMachine";

private final BeanFactory beanFactory;

@Override
public StateMachine<ProjectStatusEnum, ProjectStateChangeEvent> build() throws StateMachineException {
StateMachine<ProjectStatusEnum, ProjectStateChangeEvent> stateMachine = build(beanFactory);
public StateMachine<ProjectStatus, ProjectStateChangeEvent> build() throws StateMachineException {
StateMachine<ProjectStatus, ProjectStateChangeEvent> stateMachine = build(beanFactory);
log.info("状态机ID:" + stateMachine.getId());
stateMachine.start();
return stateMachine;
@@ -54,7 +55,7 @@ public class ProjectStateMachineBuilderImpl implements BaseStateMachineBuilder<P
* @param beanFactory \
*/
@Override
public StateMachine<ProjectStatusEnum, ProjectStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
public StateMachine<ProjectStatus, ProjectStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
try {
return buildStateMachine(beanFactory);
} catch (Exception e) {
@@ -62,8 +63,8 @@ public class ProjectStateMachineBuilderImpl implements BaseStateMachineBuilder<P
}
}

private StateMachine<ProjectStatusEnum, ProjectStateChangeEvent> buildStateMachine(BeanFactory beanFactory) throws Exception {
StateMachineBuilder.Builder<ProjectStatusEnum, ProjectStateChangeEvent> builder = StateMachineBuilder.builder();
private StateMachine<ProjectStatus, ProjectStateChangeEvent> buildStateMachine(BeanFactory beanFactory) throws Exception {
StateMachineBuilder.Builder<ProjectStatus, ProjectStateChangeEvent> builder = StateMachineBuilder.builder();
builder.configureConfiguration()
.withConfiguration()
.machineId(MACHINE_ID)
@@ -71,205 +72,205 @@ public class ProjectStateMachineBuilderImpl implements BaseStateMachineBuilder<P

builder.configureStates()
.withStates()
.initial(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.choice(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.choice(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE)
.states(EnumSet.allOf(ProjectStatusEnum.class));
.initial(ProjectStatus.UNDER_INTERNAL_AUDIT)
.choice(ProjectStatus.PENDING_PREQUALIFICATION_CHOICE)
.choice(ProjectStatus.PREQUALIFICATION_WITHDRAW_CHOICE)
.states(EnumSet.allOf(ProjectStatus.class));

builder.configureTransitions()
// 单位内部审核通过,从单位内部审核中到待预审
.withExternal()
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION)
.source(ProjectStatus.UNDER_INTERNAL_AUDIT)
.target(ProjectStatus.PENDING_PREQUALIFICATION)
.event(ProjectStateChangeEvent.UNDER_INTERNAL_PASS).and()
// 单位内部审核驳回,从单位内部审核中到单位内部审核不通过
.withExternal()
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS)
.source(ProjectStatus.UNDER_INTERNAL_AUDIT)
.target(ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS)
.event(ProjectStateChangeEvent.UNDER_INTERNAL_REJECT).and()
// 单位内部审核中撤回,从单位内部审核中到待申报
.withExternal()
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.target(ProjectStatusEnum.TO_BE_DECLARED)
.source(ProjectStatus.UNDER_INTERNAL_AUDIT)
.target(ProjectStatus.TO_BE_DECLARED)
.event(ProjectStateChangeEvent.UNDER_INTERNAL_WITHDRAW).and()
// 单位内部审核不通过重新提交,从单位内部审核不通过到单位内部审核中
.withExternal()
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS)
.target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.source(ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS)
.target(ProjectStatus.UNDER_INTERNAL_AUDIT)
.event(ProjectStateChangeEvent.UNDER_INTERNAL_REJECT_RESUBMIT).and()
// 待预审预审申报,从待预审到待预审选择
.withExternal()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.source(ProjectStatus.PENDING_PREQUALIFICATION)
.target(ProjectStatus.PENDING_PREQUALIFICATION_CHOICE)
.event(ProjectStateChangeEvent.PRELIMINARY_REVIEW_DECLARE).and()
// 待预审申报,从待预审选择->省级部门联审中,预审中,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new PendingPreQualificationChoiceGuard(), new ProjectDeclareActionChoice())
.last(ProjectStatusEnum.PRE_APPLYING, new ProjectDeclareActionChoice()).and()
.source(ProjectStatus.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new PendingPreQualificationChoiceGuard(), new ProjectDeclareActionChoice())
.last(ProjectStatus.PRE_APPLYING, new ProjectDeclareActionChoice()).and()

// 省级部门联审通过,从省级部门联审中到省级部门联审成功
.withExternal()
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS)
.source(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS)
.event(ProjectStateChangeEvent.PROVINCIAL_DEPARTMENT_REVIEW_PASS).and()
// 省级部门联审通过,从省级部门联审成功到预审中
.withExternal()
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS)
.target(ProjectStatusEnum.PRE_APPLYING)
.source(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS)
.target(ProjectStatus.PRE_APPLYING)
.event(ProjectStateChangeEvent.PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW).and()
// 省级部门联审不通过,从省级部门联审中到省级部门联审不通过
.withExternal()
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED)
.source(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED)
.event(ProjectStateChangeEvent.PROVINCIAL_DEPARTMENT_REVIEW_REJECT).and()
// 省级部门联审中撤回,从省级部门联审中到待预审
.withExternal()
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION)
.source(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatus.PENDING_PREQUALIFICATION)
.event(ProjectStateChangeEvent.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW).and()
// 预审通过,从预审中到部门联审中
.withExternal()
.source(ProjectStatusEnum.PRE_APPLYING)
.target(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW)
.source(ProjectStatus.PRE_APPLYING)
.target(ProjectStatus.DEPARTMENT_JOINT_REVIEW)
.event(ProjectStateChangeEvent.PRELIMINARY_REVIEW_PASS).and()
// 预审驳回,从预审中到预审不通过
.withExternal()
.source(ProjectStatusEnum.PRE_APPLYING)
.target(ProjectStatusEnum.PREQUALIFICATION_FAILED)
.source(ProjectStatus.PRE_APPLYING)
.target(ProjectStatus.PREQUALIFICATION_FAILED)
.event(ProjectStateChangeEvent.PRELIMINARY_REVIEW_REJECT).and()
// 预审中撤回,从预审中到预审中撤回选择态
.withExternal()
.source(ProjectStatusEnum.PRE_APPLYING)
.target(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE)
.source(ProjectStatus.PRE_APPLYING)
.target(ProjectStatus.PREQUALIFICATION_WITHDRAW_CHOICE)
.event(ProjectStateChangeEvent.PRE_APPLYING_WITHDRAW).and()
// 预审中撤回,从预审中撤回选择态->省级部门联审成功,待预审,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS, new PendingPreQualificationChoiceGuard()
.source(ProjectStatus.PREQUALIFICATION_WITHDRAW_CHOICE)
.first(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS, new PendingPreQualificationChoiceGuard()
, new ProjectDeclareActionChoice())
.last(ProjectStatusEnum.PENDING_PREQUALIFICATION, new ProjectDeclareActionChoice()).and()
.last(ProjectStatus.PENDING_PREQUALIFICATION, new ProjectDeclareActionChoice()).and()
// 预审不通过重新提交,从预审不通过到待预审选择
.withExternal()
.source(ProjectStatusEnum.PREQUALIFICATION_FAILED)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.source(ProjectStatus.PREQUALIFICATION_FAILED)
.target(ProjectStatus.PENDING_PREQUALIFICATION_CHOICE)
.event(ProjectStateChangeEvent.PRELIMINARY_REVIEW_REJECT_RESUBMIT).and()
// 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new PendingPreQualificationChoiceGuard(), new ProjectDeclareActionChoice())
.last(ProjectStatusEnum.PRE_APPLYING, new ProjectDeclareActionChoice()).and()
.source(ProjectStatus.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new PendingPreQualificationChoiceGuard(), new ProjectDeclareActionChoice())
.last(ProjectStatus.PRE_APPLYING, new ProjectDeclareActionChoice()).and()
// 部门联审通过,从部门联审中到年度计划中
.withExternal()
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW)
.target(ProjectStatusEnum.IN_THE_ANNUAL_PLAN)
.source(ProjectStatus.DEPARTMENT_JOINT_REVIEW)
.target(ProjectStatus.IN_THE_ANNUAL_PLAN)
.event(ProjectStateChangeEvent.DEPARTMENT_UNITED_REVIEW_PASS).and()
// 部门联审驳回,从部门联审中到部门联审不通过
.withExternal()
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW)
.target(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED)
.source(ProjectStatus.DEPARTMENT_JOINT_REVIEW)
.target(ProjectStatus.DEPARTMENT_JOINT_REVIEW_FAILED)
.event(ProjectStateChangeEvent.DEPARTMENT_UNITED_REVIEW_REJECT).and()
// 部门联审中撤回,从部门联审中到预审中
.withExternal()
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW)
.target(ProjectStatusEnum.PRE_APPLYING)
.source(ProjectStatus.DEPARTMENT_JOINT_REVIEW)
.target(ProjectStatus.PRE_APPLYING)
.event(ProjectStateChangeEvent.DEPARTMENT_JOINT_REVIEW_WITHDRAW).and()
// 年度计划中开启方案申报,从年度计划中到方案待申报
.withExternal()
.source(ProjectStatusEnum.IN_THE_ANNUAL_PLAN)
.target(ProjectStatusEnum.PLAN_TO_BE_DECLARED)
.source(ProjectStatus.IN_THE_ANNUAL_PLAN)
.target(ProjectStatus.PLAN_TO_BE_DECLARED)
.event(ProjectStateChangeEvent.ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE).and()
// 年度计划中暂缓,从年度计划中到被暂缓
.withExternal()
.source(ProjectStatusEnum.IN_THE_ANNUAL_PLAN)
.target(ProjectStatusEnum.BE_SUSPENDED)
.source(ProjectStatus.IN_THE_ANNUAL_PLAN)
.target(ProjectStatus.BE_SUSPENDED)
.event(ProjectStateChangeEvent.ANNUAL_PLAN_SUSPEND).and()
// 方案待申报申报方案,从方案待申报到方案评审中
.withExternal()
.source(ProjectStatusEnum.PLAN_TO_BE_DECLARED)
.target(ProjectStatusEnum.SCHEME_UNDER_REVIEW)
.source(ProjectStatus.PLAN_TO_BE_DECLARED)
.target(ProjectStatus.SCHEME_UNDER_REVIEW)
.event(ProjectStateChangeEvent.DECLARE_PLAN).and()
// 方案评审通过,从方案评审中到待立项批复
.withExternal()
.source(ProjectStatusEnum.SCHEME_UNDER_REVIEW)
.target(ProjectStatusEnum.TO_BE_APPROVED)
.source(ProjectStatus.SCHEME_UNDER_REVIEW)
.target(ProjectStatus.TO_BE_APPROVED)
.event(ProjectStateChangeEvent.PLAN_REVIEW_PASS).and()
// 方案评审驳回,从方案评审中到方案评审不通过
.withExternal()
.source(ProjectStatusEnum.SCHEME_UNDER_REVIEW)
.target(ProjectStatusEnum.SCHEME_REVIEW_FAILED)
.source(ProjectStatus.SCHEME_UNDER_REVIEW)
.target(ProjectStatus.SCHEME_REVIEW_FAILED)
.event(ProjectStateChangeEvent.PLAN_REVIEW_REJECT).and()
// 方案评审中撤回,从方案评审中到方案待申报
.withExternal()
.source(ProjectStatusEnum.SCHEME_UNDER_REVIEW)
.target(ProjectStatusEnum.PLAN_TO_BE_DECLARED)
.source(ProjectStatus.SCHEME_UNDER_REVIEW)
.target(ProjectStatus.PLAN_TO_BE_DECLARED)
.event(ProjectStateChangeEvent.SCHEME_UNDER_REVIEW_WITHDRAW).and()
// 方案评审不通过重新提交,从方案评审不通过到方案评审中
.withExternal()
.source(ProjectStatusEnum.SCHEME_REVIEW_FAILED)
.target(ProjectStatusEnum.SCHEME_UNDER_REVIEW)
.source(ProjectStatus.SCHEME_REVIEW_FAILED)
.target(ProjectStatus.SCHEME_UNDER_REVIEW)
.event(ProjectStateChangeEvent.PLAN_REVIEW_REJECT_RESUBMIT).and()
// 立项备案
.withExternal()
.source(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD)
.target(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING)
.source(ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD)
.target(ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING)
.event(ProjectStateChangeEvent.DECLARED_RECORD_SUBMIT).and()
.withExternal()
.source(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED)
.target(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING)
.source(ProjectStatus.DECLARED_APPROVED_RECORD_FAILED)
.target(ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING)
.event(ProjectStateChangeEvent.DECLARED_RECORD_RESUBMIT).and()
.withExternal()
.source(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.source(ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING)
.target(ProjectStatus.TO_BE_PURCHASED)
.event(ProjectStateChangeEvent.DECLARED_RECORD_PASS).and()
.withExternal()
.source(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING)
.target(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED)
.source(ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING)
.target(ProjectStatus.DECLARED_APPROVED_RECORD_FAILED)
.event(ProjectStateChangeEvent.DECLARED_RECORD_FAILED).and()
// 待立项批复批复,从待立项批复到待采购
.withExternal()
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.source(ProjectStatus.TO_BE_APPROVED)
.target(ProjectStatus.TO_BE_PURCHASED)
.event(ProjectStateChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到实施中
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.ON_PURCHASING)
.source(ProjectStatus.TO_BE_PURCHASED)
.target(ProjectStatus.ON_PURCHASING)
.event(ProjectStateChangeEvent.SUBMIT_PURCHASE_NOTICE).and()
// 填写试试计划 -> 待初验
.withExternal()
.source(ProjectStatusEnum.ON_PURCHASING)
.target(ProjectStatusEnum.TO_BE_FIRST_INSPECTED)
.source(ProjectStatus.ON_PURCHASING)
.target(ProjectStatus.TO_BE_FIRST_INSPECTED)
.event(ProjectStateChangeEvent.SUBMIT_OPERATION_PLAN).and()
// 上传初验材料
.withExternal()
.source(ProjectStatusEnum.TO_BE_FIRST_INSPECTED)
.target(ProjectStatusEnum.ON_PILOT_RUNNING)
.source(ProjectStatus.TO_BE_FIRST_INSPECTED)
.target(ProjectStatus.ON_PILOT_RUNNING)
.event(ProjectStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES).and()
// 待终验终验申请,从待终验到终验审核中
.withExternal()
.source(ProjectStatusEnum.ON_PILOT_RUNNING)
.target(ProjectStatusEnum.ON_FINALLY_INSPECTED)
.source(ProjectStatus.ON_PILOT_RUNNING)
.target(ProjectStatus.ON_FINALLY_INSPECTED)
.event(ProjectStateChangeEvent.FINAL_ACCEPTANCE_APPLICATION).and()
// 终审审核通过,从终审审核中到已归档
.withExternal()
.source(ProjectStatusEnum.ON_FINALLY_INSPECTED)
.target(ProjectStatusEnum.ARCHIVED)
.source(ProjectStatus.ON_FINALLY_INSPECTED)
.target(ProjectStatus.ARCHIVED)
.event(ProjectStateChangeEvent.FINAL_ACCEPTANCE_PASS).and()
// 终审审核不通过,从终审审核中到终审审核不通过
.withExternal()
.source(ProjectStatusEnum.ON_FINALLY_INSPECTED)
.target(ProjectStatusEnum.FINALLY_INSPECTED_FAILED)
.source(ProjectStatus.ON_FINALLY_INSPECTED)
.target(ProjectStatus.FINALLY_INSPECTED_FAILED)
.event(ProjectStateChangeEvent.FINAL_ACCEPTANCE_REJECT).and()
// 终审审核中撤回,从终审审核中到待终验
.withExternal()
.source(ProjectStatusEnum.ON_FINALLY_INSPECTED)
.target(ProjectStatusEnum.ON_PILOT_RUNNING)
.source(ProjectStatus.ON_FINALLY_INSPECTED)
.target(ProjectStatus.ON_PILOT_RUNNING)
.event(ProjectStateChangeEvent.FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW).and()
// 终验中 重新提交
.withExternal()
.source(ProjectStatusEnum.FINALLY_INSPECTED_FAILED)
.target(ProjectStatusEnum.ON_FINALLY_INSPECTED)
.source(ProjectStatus.FINALLY_INSPECTED_FAILED)
.target(ProjectStatus.ON_FINALLY_INSPECTED)
.event(ProjectStateChangeEvent.FINAL_RE_ACCEPTANCE_APPLICATION).and();
return builder.build();
}
@@ -282,17 +283,17 @@ public class ProjectStateMachineBuilderImpl implements BaseStateMachineBuilder<P
*/
@Bean(name = "projectDeclareStatePersister")
@Override
public StateMachinePersister<ProjectStatusEnum, ProjectStateChangeEvent, Project> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<ProjectStatusEnum, ProjectStateChangeEvent, Project>() {
public StateMachinePersister<ProjectStatus, ProjectStateChangeEvent, Project> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<ProjectStatus, ProjectStateChangeEvent, Project>() {
@Override
public void write(StateMachineContext<ProjectStatusEnum, ProjectStateChangeEvent> context, Project contextObj) {
public void write(StateMachineContext<ProjectStatus, ProjectStateChangeEvent> context, Project contextObj) {
log.info("当前项目为:{}", contextObj);
}

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStateChangeEvent> read(Project contextObj) {
return new DefaultStateMachineContext<>(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, MACHINE_ID);
public StateMachineContext<ProjectStatus, ProjectStateChangeEvent> read(Project contextObj) {
ProjectStatus status = ProjectStatus.getNoNull(contextObj.getStatus());
return new DefaultStateMachineContext<>(status, null, null, null, null, MACHINE_ID);
}
});
}


+ 22
- 22
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/SelfTestStateMachineBuilderImpl.java View File

@@ -3,7 +3,7 @@ package com.hz.pm.api.common.statemachine.builder.impl;
import com.hz.pm.api.common.statemachine.builder.BaseStateMachineBuilder;
import com.hz.pm.api.common.statemachine.event.SelfTestStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderSelfTestStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderSelfTestStatus;
import com.ningdatech.basic.exception.BizException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -34,22 +34,22 @@ import java.util.EnumSet;
@Component
@EnableStateMachine(name = SelfTestStateMachineBuilderImpl.MACHINE_ID)
@RequiredArgsConstructor
public class SelfTestStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, SelfTestStateChangeEvent, TenderSelfTestStatusEnum> {
public class SelfTestStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, SelfTestStateChangeEvent, TenderSelfTestStatus> {

public static final String MACHINE_ID = "selfTestStateMachine";

private final BeanFactory beanFactory;

@Override
public StateMachine<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> stateMachine = build(beanFactory);
public StateMachine<TenderSelfTestStatus, SelfTestStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderSelfTestStatus, SelfTestStateChangeEvent> stateMachine = build(beanFactory);
log.info("状态机ID:" + stateMachine.getId());
stateMachine.start();
return stateMachine;
}

@Override
public StateMachine<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
public StateMachine<TenderSelfTestStatus, SelfTestStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
try {
return buildStateMachine(beanFactory);
} catch (Exception e) {
@@ -57,8 +57,8 @@ public class SelfTestStateMachineBuilderImpl implements BaseStateMachineBuilder<
}
}

private StateMachine<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> builder = StateMachineBuilder.builder();
private StateMachine<TenderSelfTestStatus, SelfTestStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderSelfTestStatus, SelfTestStateChangeEvent> builder = StateMachineBuilder.builder();
builder.configureConfiguration()
.withConfiguration()
.machineId(MACHINE_ID)
@@ -66,28 +66,28 @@ public class SelfTestStateMachineBuilderImpl implements BaseStateMachineBuilder<

builder.configureStates()
.withStates()
.initial(TenderSelfTestStatusEnum.WITHOUT_SELF_TEST_INFO)
.states(EnumSet.allOf(TenderSelfTestStatusEnum.class));
.initial(TenderSelfTestStatus.WITHOUT_SELF_TEST_INFO)
.states(EnumSet.allOf(TenderSelfTestStatus.class));

builder.configureTransitions()
.withExternal()
.source(TenderSelfTestStatusEnum.WITHOUT_SELF_TEST_INFO)
.target(TenderSelfTestStatusEnum.SELF_TEST_INFO_AUDIT)
.source(TenderSelfTestStatus.WITHOUT_SELF_TEST_INFO)
.target(TenderSelfTestStatus.SELF_TEST_INFO_AUDIT)
.event(SelfTestStateChangeEvent.SUBMIT_SELF_TEST_INFO)
.and()
.withExternal()
.source(TenderSelfTestStatusEnum.SELF_TEST_INFO_AUDIT)
.target(TenderSelfTestStatusEnum.SELF_TEST_INFO_PASSED)
.source(TenderSelfTestStatus.SELF_TEST_INFO_AUDIT)
.target(TenderSelfTestStatus.SELF_TEST_INFO_PASSED)
.event(SelfTestStateChangeEvent.SELF_TEST_PASSED)
.and()
.withExternal()
.source(TenderSelfTestStatusEnum.SELF_TEST_INFO_AUDIT)
.target(TenderSelfTestStatusEnum.SELF_TEST_INFO_FAILED)
.source(TenderSelfTestStatus.SELF_TEST_INFO_AUDIT)
.target(TenderSelfTestStatus.SELF_TEST_INFO_FAILED)
.event(SelfTestStateChangeEvent.SELF_TEST_FAILED)
.and()
.withExternal()
.source(TenderSelfTestStatusEnum.SELF_TEST_INFO_FAILED)
.target(TenderSelfTestStatusEnum.SELF_TEST_INFO_AUDIT)
.source(TenderSelfTestStatus.SELF_TEST_INFO_FAILED)
.target(TenderSelfTestStatus.SELF_TEST_INFO_AUDIT)
.event(SelfTestStateChangeEvent.RESUBMIT_SELF_TEST)
.and();
return builder.build();
@@ -95,16 +95,16 @@ public class SelfTestStateMachineBuilderImpl implements BaseStateMachineBuilder<

@Override
@Bean(name = "selfTestStatePersister")
public StateMachinePersister<TenderSelfTestStatusEnum, SelfTestStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderSelfTestStatusEnum, SelfTestStateChangeEvent, Purchase>() {
public StateMachinePersister<TenderSelfTestStatus, SelfTestStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderSelfTestStatus, SelfTestStateChangeEvent, Purchase>() {
@Override
public void write(StateMachineContext<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> context, Purchase contextObj) {
public void write(StateMachineContext<TenderSelfTestStatus, SelfTestStateChangeEvent> context, Purchase contextObj) {
log.info("当前项目为:{}", contextObj);
}

@Override
public StateMachineContext<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> read(Purchase contextObj) {
TenderSelfTestStatusEnum status = TenderSelfTestStatusEnum.get(contextObj.getSelfTestStatus())
public StateMachineContext<TenderSelfTestStatus, SelfTestStateChangeEvent> read(Purchase contextObj) {
TenderSelfTestStatus status = TenderSelfTestStatus.get(contextObj.getSelfTestStatus())
.orElseThrow(() -> BizException.wrap("系统自测状态无效"));
return new DefaultStateMachineContext<>(status, null, null, null, null, MACHINE_ID);
}


+ 30
- 30
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/TenderStateMachineBuilderImpl.java View File

@@ -3,7 +3,7 @@ package com.hz.pm.api.common.statemachine.builder.impl;
import com.hz.pm.api.common.statemachine.builder.BaseStateMachineBuilder;
import com.hz.pm.api.common.statemachine.event.TenderStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.BeanFactory;
@@ -33,22 +33,22 @@ import java.util.EnumSet;
@Component
@EnableStateMachine(name = TenderStateMachineBuilderImpl.MACHINE_ID)
@RequiredArgsConstructor
public class TenderStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, TenderStateChangeEvent, TenderStatusEnum> {
public class TenderStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, TenderStateChangeEvent, TenderStatus> {

public static final String MACHINE_ID = "tenderStateMachine";

private final BeanFactory beanFactory;

@Override
public StateMachine<TenderStatusEnum, TenderStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderStatusEnum, TenderStateChangeEvent> stateMachine = build(beanFactory);
public StateMachine<TenderStatus, TenderStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderStatus, TenderStateChangeEvent> stateMachine = build(beanFactory);
log.info("状态机ID:" + stateMachine.getId());
stateMachine.start();
return stateMachine;
}

@Override
public StateMachine<TenderStatusEnum, TenderStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
public StateMachine<TenderStatus, TenderStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
try {
return buildStateMachine(beanFactory);
} catch (Exception e) {
@@ -56,8 +56,8 @@ public class TenderStateMachineBuilderImpl implements BaseStateMachineBuilder<Pu
}
}

private StateMachine<TenderStatusEnum, TenderStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderStatusEnum, TenderStateChangeEvent> builder = StateMachineBuilder.builder();
private StateMachine<TenderStatus, TenderStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderStatus, TenderStateChangeEvent> builder = StateMachineBuilder.builder();
builder.configureConfiguration()
.withConfiguration()
.machineId(MACHINE_ID)
@@ -65,56 +65,56 @@ public class TenderStateMachineBuilderImpl implements BaseStateMachineBuilder<Pu

builder.configureStates()
.withStates()
.initial(TenderStatusEnum.TO_BE_SUBMIT_PURCHASE_INFO)
.states(EnumSet.allOf(TenderStatusEnum.class));
.initial(TenderStatus.TO_BE_SUBMIT_PURCHASE_INFO)
.states(EnumSet.allOf(TenderStatus.class));

builder.configureTransitions()
// 填写采购信息
.withExternal()
.source(TenderStatusEnum.TO_BE_SUBMIT_PURCHASE_INFO)
.target(TenderStatusEnum.TO_BE_SUBMIT_CONSTRUCTION_INFO)
.source(TenderStatus.TO_BE_SUBMIT_PURCHASE_INFO)
.target(TenderStatus.TO_BE_SUBMIT_CONSTRUCTION_INFO)
.event(TenderStateChangeEvent.SUBMIT_PURCHASE_INFO)
.and()
// 填写合同信息
.withExternal()
.source(TenderStatusEnum.TO_BE_SUBMIT_CONSTRUCTION_INFO)
.target(TenderStatusEnum.TO_BE_SUBMIT_OPERATION_PLAN)
.source(TenderStatus.TO_BE_SUBMIT_CONSTRUCTION_INFO)
.target(TenderStatus.TO_BE_SUBMIT_OPERATION_PLAN)
.event(TenderStateChangeEvent.SUBMIT_CONSTRUCTION_INFO)
.and()
// 填写实施计划
.withExternal()
.source(TenderStatusEnum.TO_BE_SUBMIT_OPERATION_PLAN)
.target(TenderStatusEnum.TO_BE_SUBMIT_FIRST_INSPECTED_INFO)
.source(TenderStatus.TO_BE_SUBMIT_OPERATION_PLAN)
.target(TenderStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO)
.event(TenderStateChangeEvent.SUBMIT_OPERATION_PLAN)
.and()
// 上传初验材料
.withExternal()
.source(TenderStatusEnum.TO_BE_SUBMIT_FIRST_INSPECTED_INFO)
.target(TenderStatusEnum.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY)
.source(TenderStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO)
.target(TenderStatus.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY)
.event(TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES)
.and()
// 终验申报
.withExternal()
.source(TenderStatusEnum.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY)
.target(TenderStatusEnum.ON_FINALLY_INSPECTED_APPLY)
.source(TenderStatus.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY)
.target(TenderStatus.ON_FINALLY_INSPECTED_APPLY)
.event(TenderStateChangeEvent.SUBMIT_FINALLY_INSPECTED)
.and()
// 终验申报重新提交
.withExternal()
.source(TenderStatusEnum.FINALLY_INSPECTED_FAILED)
.target(TenderStatusEnum.ON_FINALLY_INSPECTED_APPLY)
.source(TenderStatus.FINALLY_INSPECTED_FAILED)
.target(TenderStatus.ON_FINALLY_INSPECTED_APPLY)
.event(TenderStateChangeEvent.RESUBMIT_FINALLY_INSPECTED)
.and()
// 终验申报通过
.withExternal()
.source(TenderStatusEnum.ON_FINALLY_INSPECTED_APPLY)
.target(TenderStatusEnum.FINALLY_INSPECTED_PASSED)
.source(TenderStatus.ON_FINALLY_INSPECTED_APPLY)
.target(TenderStatus.FINALLY_INSPECTED_PASSED)
.event(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED)
.and()
// 终验申报拒绝
.withExternal()
.source(TenderStatusEnum.ON_FINALLY_INSPECTED_APPLY)
.target(TenderStatusEnum.FINALLY_INSPECTED_FAILED)
.source(TenderStatus.ON_FINALLY_INSPECTED_APPLY)
.target(TenderStatus.FINALLY_INSPECTED_FAILED)
.event(TenderStateChangeEvent.FINALLY_INSPECTED_FAILED)
.and();
return builder.build();
@@ -122,16 +122,16 @@ public class TenderStateMachineBuilderImpl implements BaseStateMachineBuilder<Pu

@Override
@Bean(name = "tenderStatePersister")
public StateMachinePersister<TenderStatusEnum, TenderStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderStatusEnum, TenderStateChangeEvent, Purchase>() {
public StateMachinePersister<TenderStatus, TenderStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderStatus, TenderStateChangeEvent, Purchase>() {
@Override
public void write(StateMachineContext<TenderStatusEnum, TenderStateChangeEvent> context, Purchase contextObj) {
public void write(StateMachineContext<TenderStatus, TenderStateChangeEvent> context, Purchase contextObj) {
log.info("当前项目为:{}", contextObj);
}

@Override
public StateMachineContext<TenderStatusEnum, TenderStateChangeEvent> read(Purchase contextObj) {
return new DefaultStateMachineContext<>(TenderStatusEnum.getByStatus(contextObj.getStatus()),
public StateMachineContext<TenderStatus, TenderStateChangeEvent> read(Purchase contextObj) {
return new DefaultStateMachineContext<>(TenderStatus.getByStatus(contextObj.getStatus()),
null, null, null, null, MACHINE_ID);
}
});


+ 22
- 22
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/TestValidStateMachineBuilderImpl.java View File

@@ -3,7 +3,7 @@ package com.hz.pm.api.common.statemachine.builder.impl;
import com.hz.pm.api.common.statemachine.builder.BaseStateMachineBuilder;
import com.hz.pm.api.common.statemachine.event.TestValidStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderTestValidStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderTestValidStatus;
import com.ningdatech.basic.exception.BizException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -34,22 +34,22 @@ import java.util.EnumSet;
@Component
@EnableStateMachine(name = TestValidStateMachineBuilderImpl.MACHINE_ID)
@RequiredArgsConstructor
public class TestValidStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, TestValidStateChangeEvent, TenderTestValidStatusEnum> {
public class TestValidStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, TestValidStateChangeEvent, TenderTestValidStatus> {

public static final String MACHINE_ID = "testValidStateMachine";

private final BeanFactory beanFactory;

@Override
public StateMachine<TenderTestValidStatusEnum, TestValidStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderTestValidStatusEnum, TestValidStateChangeEvent> stateMachine = build(beanFactory);
public StateMachine<TenderTestValidStatus, TestValidStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderTestValidStatus, TestValidStateChangeEvent> stateMachine = build(beanFactory);
log.info("状态机ID:" + stateMachine.getId());
stateMachine.start();
return stateMachine;
}

@Override
public StateMachine<TenderTestValidStatusEnum, TestValidStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
public StateMachine<TenderTestValidStatus, TestValidStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
try {
return buildStateMachine(beanFactory);
} catch (Exception e) {
@@ -57,8 +57,8 @@ public class TestValidStateMachineBuilderImpl implements BaseStateMachineBuilder
}
}

private StateMachine<TenderTestValidStatusEnum, TestValidStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderTestValidStatusEnum, TestValidStateChangeEvent> builder = StateMachineBuilder.builder();
private StateMachine<TenderTestValidStatus, TestValidStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderTestValidStatus, TestValidStateChangeEvent> builder = StateMachineBuilder.builder();
builder.configureConfiguration()
.withConfiguration()
.machineId(MACHINE_ID)
@@ -66,28 +66,28 @@ public class TestValidStateMachineBuilderImpl implements BaseStateMachineBuilder

builder.configureStates()
.withStates()
.initial(TenderTestValidStatusEnum.WITHOUT_TEST_VALID_INFO)
.states(EnumSet.allOf(TenderTestValidStatusEnum.class));
.initial(TenderTestValidStatus.WITHOUT_TEST_VALID_INFO)
.states(EnumSet.allOf(TenderTestValidStatus.class));

builder.configureTransitions()
.withExternal()
.source(TenderTestValidStatusEnum.WITHOUT_TEST_VALID_INFO)
.target(TenderTestValidStatusEnum.TEST_VALID_INFO_AUDIT)
.source(TenderTestValidStatus.WITHOUT_TEST_VALID_INFO)
.target(TenderTestValidStatus.TEST_VALID_INFO_AUDIT)
.event(TestValidStateChangeEvent.SUBMIT_TEST_VALID_INFO)
.and()
.withExternal()
.source(TenderTestValidStatusEnum.TEST_VALID_INFO_AUDIT)
.target(TenderTestValidStatusEnum.TEST_VALID_INFO_PASSED)
.source(TenderTestValidStatus.TEST_VALID_INFO_AUDIT)
.target(TenderTestValidStatus.TEST_VALID_INFO_PASSED)
.event(TestValidStateChangeEvent.TEST_VALID_INFO_PASSED)
.and()
.withExternal()
.source(TenderTestValidStatusEnum.TEST_VALID_INFO_AUDIT)
.target(TenderTestValidStatusEnum.TEST_VALID_INFO_FAILED)
.source(TenderTestValidStatus.TEST_VALID_INFO_AUDIT)
.target(TenderTestValidStatus.TEST_VALID_INFO_FAILED)
.event(TestValidStateChangeEvent.TEST_VALID_INFO_FAILED)
.and()
.withExternal()
.source(TenderTestValidStatusEnum.TEST_VALID_INFO_FAILED)
.target(TenderTestValidStatusEnum.TEST_VALID_INFO_AUDIT)
.source(TenderTestValidStatus.TEST_VALID_INFO_FAILED)
.target(TenderTestValidStatus.TEST_VALID_INFO_AUDIT)
.event(TestValidStateChangeEvent.RESUBMIT_TEST_VALID_INFO)
.and();
return builder.build();
@@ -95,16 +95,16 @@ public class TestValidStateMachineBuilderImpl implements BaseStateMachineBuilder

@Override
@Bean(name = "testValidStatePersister")
public StateMachinePersister<TenderTestValidStatusEnum, TestValidStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderTestValidStatusEnum, TestValidStateChangeEvent, Purchase>() {
public StateMachinePersister<TenderTestValidStatus, TestValidStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderTestValidStatus, TestValidStateChangeEvent, Purchase>() {
@Override
public void write(StateMachineContext<TenderTestValidStatusEnum, TestValidStateChangeEvent> context, Purchase contextObj) {
public void write(StateMachineContext<TenderTestValidStatus, TestValidStateChangeEvent> context, Purchase contextObj) {
log.info("当前项目为:{}", contextObj);
}

@Override
public StateMachineContext<TenderTestValidStatusEnum, TestValidStateChangeEvent> read(Purchase contextObj) {
TenderTestValidStatusEnum testValidStatus = TenderTestValidStatusEnum.get(contextObj.getTestValidStatus())
public StateMachineContext<TenderTestValidStatus, TestValidStateChangeEvent> read(Purchase contextObj) {
TenderTestValidStatus testValidStatus = TenderTestValidStatus.get(contextObj.getTestValidStatus())
.orElseThrow(() -> BizException.wrap("测试验证状态无效"));
return new DefaultStateMachineContext<>(testValidStatus, null, null, null, null, MACHINE_ID);
}


+ 22
- 26
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/XcfhxStateMachineBuilderImpl.java View File

@@ -1,13 +1,9 @@
package com.hz.pm.api.common.statemachine.builder.impl;

import com.hz.pm.api.common.statemachine.builder.BaseStateMachineBuilder;
import com.hz.pm.api.common.statemachine.event.AdaptStateChangeEvent;
import com.hz.pm.api.common.statemachine.event.TenderStateChangeEvent;
import com.hz.pm.api.common.statemachine.event.XcfhxStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderAdaptStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderXcfhxApplyStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderXcfhxApplyStatus;
import com.ningdatech.basic.exception.BizException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -38,22 +34,22 @@ import java.util.EnumSet;
@Component
@EnableStateMachine(name = XcfhxStateMachineBuilderImpl.MACHINE_ID)
@RequiredArgsConstructor
public class XcfhxStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, XcfhxStateChangeEvent, TenderXcfhxApplyStatusEnum> {
public class XcfhxStateMachineBuilderImpl implements BaseStateMachineBuilder<Purchase, XcfhxStateChangeEvent, TenderXcfhxApplyStatus> {

public static final String MACHINE_ID = "xcfhxStateMachine";

private final BeanFactory beanFactory;

@Override
public StateMachine<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent> stateMachine = build(beanFactory);
public StateMachine<TenderXcfhxApplyStatus, XcfhxStateChangeEvent> build() throws StateMachineException {
StateMachine<TenderXcfhxApplyStatus, XcfhxStateChangeEvent> stateMachine = build(beanFactory);
log.info("状态机ID:{}", stateMachine.getId());
stateMachine.start();
return stateMachine;
}

@Override
public StateMachine<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
public StateMachine<TenderXcfhxApplyStatus, XcfhxStateChangeEvent> build(BeanFactory beanFactory) throws StateMachineException {
try {
return buildStateMachine(beanFactory);
} catch (Exception e) {
@@ -61,8 +57,8 @@ public class XcfhxStateMachineBuilderImpl implements BaseStateMachineBuilder<Pur
}
}

private StateMachine<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent> builder = StateMachineBuilder.builder();
private StateMachine<TenderXcfhxApplyStatus, XcfhxStateChangeEvent> buildStateMachine(BeanFactory factory) throws Exception {
StateMachineBuilder.Builder<TenderXcfhxApplyStatus, XcfhxStateChangeEvent> builder = StateMachineBuilder.builder();
builder.configureConfiguration()
.withConfiguration()
.machineId(MACHINE_ID)
@@ -70,31 +66,31 @@ public class XcfhxStateMachineBuilderImpl implements BaseStateMachineBuilder<Pur

builder.configureStates()
.withStates()
.initial(TenderXcfhxApplyStatusEnum.TO_BE_SUBMIT_XCFHX_APPLY)
.states(EnumSet.allOf(TenderXcfhxApplyStatusEnum.class));
.initial(TenderXcfhxApplyStatus.TO_BE_SUBMIT_XCFHX_APPLY)
.states(EnumSet.allOf(TenderXcfhxApplyStatus.class));

builder.configureTransitions()
// 信创符合性申请
.withExternal()
.source(TenderXcfhxApplyStatusEnum.TO_BE_SUBMIT_XCFHX_APPLY)
.target(TenderXcfhxApplyStatusEnum.ON_XCFHX_APPLY)
.source(TenderXcfhxApplyStatus.TO_BE_SUBMIT_XCFHX_APPLY)
.target(TenderXcfhxApplyStatus.ON_XCFHX_APPLY)
.event(XcfhxStateChangeEvent.SUBMIT_XCFHX_APPLY)
.and()// 信创符合性申请
.withExternal()
.source(TenderXcfhxApplyStatusEnum.XCFHX_APPLY_FAILED)
.target(TenderXcfhxApplyStatusEnum.ON_XCFHX_APPLY)
.source(TenderXcfhxApplyStatus.XCFHX_APPLY_FAILED)
.target(TenderXcfhxApplyStatus.ON_XCFHX_APPLY)
.event(XcfhxStateChangeEvent.RESUBMIT_XCFHX_APPLY)
.and()
// 信创符合性申请通过
.withExternal()
.source(TenderXcfhxApplyStatusEnum.ON_XCFHX_APPLY)
.target(TenderXcfhxApplyStatusEnum.XCFHX_APPLY_PASSED)
.source(TenderXcfhxApplyStatus.ON_XCFHX_APPLY)
.target(TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED)
.event(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED)
.and()
// 信创符合性申请失败
.withExternal()
.source(TenderXcfhxApplyStatusEnum.ON_XCFHX_APPLY)
.target(TenderXcfhxApplyStatusEnum.XCFHX_APPLY_FAILED)
.source(TenderXcfhxApplyStatus.ON_XCFHX_APPLY)
.target(TenderXcfhxApplyStatus.XCFHX_APPLY_FAILED)
.event(XcfhxStateChangeEvent.XCFHX_APPLY_FAILED)
.and();
return builder.build();
@@ -102,16 +98,16 @@ public class XcfhxStateMachineBuilderImpl implements BaseStateMachineBuilder<Pur

@Override
@Bean(name = "xcfhxStatePersister")
public StateMachinePersister<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent, Purchase>() {
public StateMachinePersister<TenderXcfhxApplyStatus, XcfhxStateChangeEvent, Purchase> stateMachinePersister() {
return new DefaultStateMachinePersister<>(new StateMachinePersist<TenderXcfhxApplyStatus, XcfhxStateChangeEvent, Purchase>() {
@Override
public void write(StateMachineContext<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent> context, Purchase contextObj) {
public void write(StateMachineContext<TenderXcfhxApplyStatus, XcfhxStateChangeEvent> context, Purchase contextObj) {
log.info("当前项目为:{}", contextObj);
}

@Override
public StateMachineContext<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent> read(Purchase contextObj) {
TenderXcfhxApplyStatusEnum status = TenderXcfhxApplyStatusEnum.get(contextObj.getXcfhxApplyStatus())
public StateMachineContext<TenderXcfhxApplyStatus, XcfhxStateChangeEvent> read(Purchase contextObj) {
TenderXcfhxApplyStatus status = TenderXcfhxApplyStatus.get(contextObj.getXcfhxApplyStatus())
.orElseThrow(() -> BizException.wrap("信创符合性申请状态无效"));
return new DefaultStateMachineContext<>(status, null, null, null, null, MACHINE_ID);
}


+ 40
- 40
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/ProjectStateChangeEvent.java View File

@@ -1,6 +1,6 @@
package com.hz.pm.api.common.statemachine.event;

import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;

@@ -23,175 +23,175 @@ public enum ProjectStateChangeEvent implements AbstractStateChangeEvent {
/**
* 项目申报提交(项目状态进入:单位内部审核中)
*/
PROJECT_APPLICATION_SUBMIT(ProjectStatusEnum.TO_BE_DECLARED.getCode(), null, null),
PROJECT_APPLICATION_SUBMIT(ProjectStatus.TO_BE_DECLARED.getCode(), null, null),
/**
* 单位内部审核驳回(项目状态进入:单位内部审核不通过)
*/
UNDER_INTERNAL_REJECT(null, ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode(), null),
UNDER_INTERNAL_REJECT(null, ProjectStatus.UNDER_INTERNAL_AUDIT.getCode(), null),
/**
* 单位内部审核通过(项目状态进入:待预审)
*/
UNDER_INTERNAL_PASS(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode(), null, null),
UNDER_INTERNAL_PASS(ProjectStatus.UNDER_INTERNAL_AUDIT.getCode(), null, null),
/**
* 单位内部审核不通过重新提交(项目状态进入:单位内部审核中)
*/
UNDER_INTERNAL_REJECT_RESUBMIT(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), null, null),
UNDER_INTERNAL_REJECT_RESUBMIT(ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), null, null),

/**
* 预审申报(项目状态进入:待预审选择,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审中;否则项目状态变为:预审中)
*/
PRELIMINARY_REVIEW_DECLARE(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode(), null, null),
PRELIMINARY_REVIEW_DECLARE(ProjectStatus.PENDING_PREQUALIFICATION.getCode(), null, null),
/**
* 省级部门联审不通过(项目状态变为:省级部门联审不通过)
*/
PROVINCIAL_DEPARTMENT_REVIEW_REJECT(null, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), null),
PROVINCIAL_DEPARTMENT_REVIEW_REJECT(null, ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), null),
/**
* 省级部门联审通过(项目状态变为:省级联审成功)
*/
PROVINCIAL_DEPARTMENT_REVIEW_PASS(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), null, null),
PROVINCIAL_DEPARTMENT_REVIEW_PASS(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), null, null),

/**
* 去到预审(项目状态变为:预审中)
*/
PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode(), null, null),
PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode(), null, null),
/**
* 预审驳回(项目状态变为:预审不通过)
*/
PRELIMINARY_REVIEW_REJECT(null, ProjectStatusEnum.PRE_APPLYING.getCode(), null),
PRELIMINARY_REVIEW_REJECT(null, ProjectStatus.PRE_APPLYING.getCode(), null),
/**
* 预审不通过重新提交(项目状态变为:待预审选择)
*/
PRELIMINARY_REVIEW_REJECT_RESUBMIT(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), null, null),
PRELIMINARY_REVIEW_REJECT_RESUBMIT(ProjectStatus.PREQUALIFICATION_FAILED.getCode(), null, null),
/**
* 预审通过(项目状态变为:部门联审中)
*/
PRELIMINARY_REVIEW_PASS(ProjectStatusEnum.PRE_APPLYING.getCode(), null, null),
PRELIMINARY_REVIEW_PASS(ProjectStatus.PRE_APPLYING.getCode(), null, null),
/**
* 部门联审驳回(项目状态变为:部门联审不通过)
*/
DEPARTMENT_UNITED_REVIEW_REJECT(null, ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode(), null),
DEPARTMENT_UNITED_REVIEW_REJECT(null, ProjectStatus.DEPARTMENT_JOINT_REVIEW.getCode(), null),
/**
* 部门联审通过(项目状态变为:年度计划中)
*/
DEPARTMENT_UNITED_REVIEW_PASS(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode(), null, null),
DEPARTMENT_UNITED_REVIEW_PASS(ProjectStatus.DEPARTMENT_JOINT_REVIEW.getCode(), null, null),
/**
* 年度计划暂缓(项目状态变为:被暂缓)
*/
ANNUAL_PLAN_SUSPEND(null, ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode(), null),
ANNUAL_PLAN_SUSPEND(null, ProjectStatus.IN_THE_ANNUAL_PLAN.getCode(), null),
/**
* 年度计划项目开启方案申报(项目状态变为:方案待申报)
*/
ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode(), null, null),
ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(ProjectStatus.IN_THE_ANNUAL_PLAN.getCode(), null, null),
/**
* 申报方案(项目状态变为:方案评审中)
*/
DECLARE_PLAN(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode(), null, null),
DECLARE_PLAN(ProjectStatus.PLAN_TO_BE_DECLARED.getCode(), null, null),
/**
* 方案评审驳回(项目状态变为:方案评审不通过)
*/
PLAN_REVIEW_REJECT(null, ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode(), null),
PLAN_REVIEW_REJECT(null, ProjectStatus.SCHEME_UNDER_REVIEW.getCode(), null),
/**
* 方案评审不通过重新提交(项目状态变为:方案评审中)
*/
PLAN_REVIEW_REJECT_RESUBMIT(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(), null, null),
PLAN_REVIEW_REJECT_RESUBMIT(ProjectStatus.SCHEME_REVIEW_FAILED.getCode(), null, null),
/**
* 方案评审通过(项目状态变为:待立项批复)
*/
PLAN_REVIEW_PASS(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode(), null, null),
PLAN_REVIEW_PASS(ProjectStatus.SCHEME_UNDER_REVIEW.getCode(), null, null),

//立项备案===========================================================================================================

/**
* 立项备案提交
*/
DECLARED_RECORD_SUBMIT(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode(), null, null),
DECLARED_RECORD_SUBMIT(ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.getCode(), null, null),

/**
* 立项备案重新提交
*/
DECLARED_RECORD_RESUBMIT(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(), null, null),
DECLARED_RECORD_RESUBMIT(ProjectStatus.DECLARED_APPROVED_RECORD_FAILED.getCode(), null, null),

/**
* 立项备案通过
*/
DECLARED_RECORD_PASS(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.getCode(), null, null),
DECLARED_RECORD_PASS(ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING.getCode(), null, null),

/**
* 立项备案不通过
*/
DECLARED_RECORD_FAILED(null, ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.getCode(), null),
DECLARED_RECORD_FAILED(null, ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING.getCode(), null),

//==================================================================================================================

/**
* 立项批复(项目状态变为:已立项-待采购)
*/
PROJECT_APPROVAL(ProjectStatusEnum.TO_BE_APPROVED.getCode(), null, null),
PROJECT_APPROVAL(ProjectStatus.TO_BE_APPROVED.getCode(), null, null),

/**
* 注册应用
*/
REGISTER_APP(ProjectStatusEnum.TO_BE_APP_REGISTER.getCode(), null, null),
REGISTER_APP(ProjectStatus.TO_BE_APP_REGISTER.getCode(), null, null),
/**
* 发布采购公告
*/
SUBMIT_PURCHASE_NOTICE(ProjectStatusEnum.TO_BE_PURCHASED.getCode(), null, null),
SUBMIT_PURCHASE_NOTICE(ProjectStatus.TO_BE_PURCHASED.getCode(), null, null),
/**
* 填写实施计划
*/
SUBMIT_OPERATION_PLAN(ProjectStatusEnum.ON_PURCHASING.getCode(), null, null),
SUBMIT_OPERATION_PLAN(ProjectStatus.ON_PURCHASING.getCode(), null, null),
/**
* 上传初验材料
*/
SUBMIT_FIRST_INSPECTED_FILES(ProjectStatusEnum.TO_BE_FIRST_INSPECTED.getCode(), null, null),
SUBMIT_FIRST_INSPECTED_FILES(ProjectStatus.TO_BE_FIRST_INSPECTED.getCode(), null, null),
/**
* 初验备案(项目状态变为:待终验)
*/
PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode(), null, null),
PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(ProjectStatus.UNDER_CONSTRUCTION.getCode(), null, null),
/**
* 终验申请(项目状态变为:终验审核中)
*/
FINAL_ACCEPTANCE_APPLICATION(ProjectStatusEnum.ON_PILOT_RUNNING.getCode(), null, null),
FINAL_ACCEPTANCE_APPLICATION(ProjectStatus.ON_PILOT_RUNNING.getCode(), null, null),
/**
* 终验审核不通过(项目状态变为:终验审核不通过)
*/
FINAL_ACCEPTANCE_REJECT(null, ProjectStatusEnum.ON_FINALLY_INSPECTED.getCode(), null),
FINAL_ACCEPTANCE_REJECT(null, ProjectStatus.ON_FINALLY_INSPECTED.getCode(), null),
/**
* 终验审核通过(项目状态变为:已归档)
*/
FINAL_ACCEPTANCE_PASS(ProjectStatusEnum.ON_FINALLY_INSPECTED.getCode(), null, null),
FINAL_ACCEPTANCE_PASS(ProjectStatus.ON_FINALLY_INSPECTED.getCode(), null, null),

// 下个节点还未提交审核意见时,流程发起人和前一个审核人可以点击撤回

/**
* 单位内部审核中时被撤回(项目状态进入:待申报)
*/
UNDER_INTERNAL_WITHDRAW(null, null, ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()),
UNDER_INTERNAL_WITHDRAW(null, null, ProjectStatus.UNDER_INTERNAL_AUDIT.getCode()),
/**
* 省级部门联审中时被撤回(项目状态进入:待预审)
*/
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(null, null, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()),
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(null, null, ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()),
/**
* 预审中时被撤回(项目状态进入:待预审选择,,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审通过;否则项目状态变为:待预审)
*/
PRE_APPLYING_WITHDRAW(null, null, ProjectStatusEnum.PRE_APPLYING.getCode()),
PRE_APPLYING_WITHDRAW(null, null, ProjectStatus.PRE_APPLYING.getCode()),
/**
* 部门联审中时被撤回(项目状态进入:预审中)
*/
DEPARTMENT_JOINT_REVIEW_WITHDRAW(null, null, ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()),
DEPARTMENT_JOINT_REVIEW_WITHDRAW(null, null, ProjectStatus.DEPARTMENT_JOINT_REVIEW.getCode()),
/**
* 方案评审中时被撤回(项目状态进入:方案待申报)
*/
SCHEME_UNDER_REVIEW_WITHDRAW(null, null, ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()),
SCHEME_UNDER_REVIEW_WITHDRAW(null, null, ProjectStatus.SCHEME_UNDER_REVIEW.getCode()),
/**
* 终验审核中时被撤回(项目状态进入:待终验)
*/
FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(null, null, ProjectStatusEnum.ON_FINALLY_INSPECTED.getCode()),
FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(null, null, ProjectStatus.ON_FINALLY_INSPECTED.getCode()),

/**
* 重新提交 终验
*/
FINAL_RE_ACCEPTANCE_APPLICATION(ProjectStatusEnum.FINALLY_INSPECTED_FAILED.getCode(), null, null);
FINAL_RE_ACCEPTANCE_APPLICATION(ProjectStatus.FINALLY_INSPECTED_FAILED.getCode(), null, null);


private final Integer passStatusCode;


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/factory/ProjectDeclareGuardFactory.java View File

@@ -1,7 +1,7 @@
package com.hz.pm.api.common.statemachine.factory;

import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.guard.Guard;

@@ -16,9 +16,9 @@ public class ProjectDeclareGuardFactory {
private ProjectDeclareGuardFactory() {
}

public static class PendingPreQualificationChoiceGuard implements Guard<ProjectStatusEnum, ProjectStateChangeEvent> {
public static class PendingPreQualificationChoiceGuard implements Guard<ProjectStatus, ProjectStateChangeEvent> {
@Override
public boolean evaluate(StateContext<ProjectStatusEnum, ProjectStateChangeEvent> context) {
public boolean evaluate(StateContext<ProjectStatus, ProjectStateChangeEvent> context) {
// 判断申报项目是否是市级项目,且申报金额是否大于等于1000万元
return true;
}


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/AdaptStateMachineUtil.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.event.AdaptStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil;
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.TenderAdaptStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderAdaptStatus;
import com.hz.pm.api.projectlib.service.IPurchaseStatusChangeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -54,12 +54,12 @@ public class AdaptStateMachineUtil implements AbstractStateMachineUtil<Purchase,
change.setProjectId(purchase.getProjectId());
change.setProjectCode(ProjectIdCodeCacheUtil.get(purchase.getProjectId()));
change.setCreateOn(LocalDateTime.now());
StateMachine<TenderAdaptStatusEnum, AdaptStateChangeEvent> stateMachine = adaptStateMachineBuilder.build();
StateMachine<TenderAdaptStatus, AdaptStateChangeEvent> stateMachine = adaptStateMachineBuilder.build();
Message<AdaptStateChangeEvent> message = MessageBuilder.withPayload(event)
.setHeader(PURCHASE, purchase)
.build();
//初始化状态机
StateMachinePersister<TenderAdaptStatusEnum, AdaptStateChangeEvent, Purchase> stateMachinePersister = adaptStateMachineBuilder.stateMachinePersister();
StateMachinePersister<TenderAdaptStatus, AdaptStateChangeEvent, Purchase> stateMachinePersister = adaptStateMachineBuilder.stateMachinePersister();
stateMachinePersister.restore(stateMachine, purchase);
stateMachine.sendEvent(message);
change.setAfterStatus(purchase.getAdaptStatus());


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/ProjectStateMachineUtil.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.builder.impl.ProjectStateMachineBuilder
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectStatusChangeService;
import lombok.RequiredArgsConstructor;
@@ -55,13 +55,13 @@ public class ProjectStateMachineUtil implements AbstractStateMachineUtil<Project
projectStatusChange.setBeforeStatus(project.getStatus());

// 获取TO状态机
StateMachine<ProjectStatusEnum, ProjectStateChangeEvent> stateMachine = projectStateMachineBuilder.build();
StateMachine<ProjectStatus, ProjectStateChangeEvent> stateMachine = projectStateMachineBuilder.build();
Message<ProjectStateChangeEvent> message = MessageBuilder.withPayload(event)
.setHeader(PROJECT_DECLARE, project)
.setHeader(APPLICATION_DECLARE, projectApplicationService.getApplicationsByProject(project))
.build();
//初始化状态机
StateMachinePersister<ProjectStatusEnum, ProjectStateChangeEvent, Project> projectDeclareStateMachinePersister = projectStateMachineBuilder.stateMachinePersister();
StateMachinePersister<ProjectStatus, ProjectStateChangeEvent, Project> projectDeclareStateMachinePersister = projectStateMachineBuilder.stateMachinePersister();
projectDeclareStateMachinePersister.restore(stateMachine, project);
stateMachine.sendEvent(message);
projectStatusChange.setProjectId(project.getId());


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/SelfTestStateMachineUtil.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.event.SelfTestStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil;
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.TenderSelfTestStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderSelfTestStatus;
import com.hz.pm.api.projectlib.service.IPurchaseStatusChangeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -54,12 +54,12 @@ public class SelfTestStateMachineUtil implements AbstractStateMachineUtil<Purcha
change.setProjectId(purchase.getProjectId());
change.setProjectCode(ProjectIdCodeCacheUtil.get(purchase.getProjectId()));
change.setCreateOn(LocalDateTime.now());
StateMachine<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> stateMachine = selfTestStateMachineBuilder.build();
StateMachine<TenderSelfTestStatus, SelfTestStateChangeEvent> stateMachine = selfTestStateMachineBuilder.build();
Message<SelfTestStateChangeEvent> message = MessageBuilder.withPayload(event)
.setHeader(PURCHASE, purchase)
.build();
//初始化状态机
StateMachinePersister<TenderSelfTestStatusEnum, SelfTestStateChangeEvent, Purchase> stateMachinePersister = selfTestStateMachineBuilder.stateMachinePersister();
StateMachinePersister<TenderSelfTestStatus, SelfTestStateChangeEvent, Purchase> stateMachinePersister = selfTestStateMachineBuilder.stateMachinePersister();
stateMachinePersister.restore(stateMachine, purchase);
stateMachine.sendEvent(message);
change.setAfterStatus(purchase.getSelfTestStatus());


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/TenderStateMachineUtil.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.event.TenderStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil;
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import com.hz.pm.api.projectlib.service.IPurchaseStatusChangeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -54,12 +54,12 @@ public class TenderStateMachineUtil implements AbstractStateMachineUtil<Purchase
change.setProjectId(purchase.getProjectId());
change.setProjectCode(ProjectIdCodeCacheUtil.get(purchase.getProjectId()));
change.setCreateOn(LocalDateTime.now());
StateMachine<TenderStatusEnum, TenderStateChangeEvent> stateMachine = tenderStateMachineBuilder.build();
StateMachine<TenderStatus, TenderStateChangeEvent> stateMachine = tenderStateMachineBuilder.build();
Message<TenderStateChangeEvent> message = MessageBuilder.withPayload(event)
.setHeader(PURCHASE, purchase)
.build();
//初始化状态机
StateMachinePersister<TenderStatusEnum, TenderStateChangeEvent, Purchase> stateMachinePersister = tenderStateMachineBuilder.stateMachinePersister();
StateMachinePersister<TenderStatus, TenderStateChangeEvent, Purchase> stateMachinePersister = tenderStateMachineBuilder.stateMachinePersister();
stateMachinePersister.restore(stateMachine, purchase);
stateMachine.sendEvent(message);
change.setAfterStatus(purchase.getStatus());


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/TestValidStateMachineUtil.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.event.TestValidStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil;
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.TenderTestValidStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderTestValidStatus;
import com.hz.pm.api.projectlib.service.IPurchaseStatusChangeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -54,12 +54,12 @@ public class TestValidStateMachineUtil implements AbstractStateMachineUtil<Purch
change.setProjectId(purchase.getProjectId());
change.setProjectCode(ProjectIdCodeCacheUtil.get(purchase.getProjectId()));
change.setCreateOn(LocalDateTime.now());
StateMachine<TenderTestValidStatusEnum, TestValidStateChangeEvent> stateMachine = testValidStateMachineBuilder.build();
StateMachine<TenderTestValidStatus, TestValidStateChangeEvent> stateMachine = testValidStateMachineBuilder.build();
Message<TestValidStateChangeEvent> message = MessageBuilder.withPayload(event)
.setHeader(PURCHASE, purchase)
.build();
//初始化状态机
StateMachinePersister<TenderTestValidStatusEnum, TestValidStateChangeEvent, Purchase> stateMachinePersister = testValidStateMachineBuilder.stateMachinePersister();
StateMachinePersister<TenderTestValidStatus, TestValidStateChangeEvent, Purchase> stateMachinePersister = testValidStateMachineBuilder.stateMachinePersister();
stateMachinePersister.restore(stateMachine, purchase);
stateMachine.sendEvent(message);
change.setAfterStatus(purchase.getTestValidStatus());


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/XcfhxStateMachineUtil.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.common.statemachine.event.XcfhxStateChangeEvent;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil;
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.TenderXcfhxApplyStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderXcfhxApplyStatus;
import com.hz.pm.api.projectlib.service.IPurchaseStatusChangeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -54,12 +54,12 @@ public class XcfhxStateMachineUtil implements AbstractStateMachineUtil<Purchase,
change.setProjectId(purchase.getProjectId());
change.setProjectCode(ProjectIdCodeCacheUtil.get(purchase.getProjectId()));
change.setCreateOn(LocalDateTime.now());
StateMachine<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent> stateMachine = xcfhxStateMachineBuilder.build();
StateMachine<TenderXcfhxApplyStatus, XcfhxStateChangeEvent> stateMachine = xcfhxStateMachineBuilder.build();
Message<XcfhxStateChangeEvent> message = MessageBuilder.withPayload(event)
.setHeader(PURCHASE, purchase)
.build();
//初始化状态机
StateMachinePersister<TenderXcfhxApplyStatusEnum, XcfhxStateChangeEvent, Purchase> stateMachinePersister = xcfhxStateMachineBuilder.stateMachinePersister();
StateMachinePersister<TenderXcfhxApplyStatus, XcfhxStateChangeEvent, Purchase> stateMachinePersister = xcfhxStateMachineBuilder.stateMachinePersister();
stateMachinePersister.restore(stateMachine, purchase);
stateMachine.sendEvent(message);
change.setAfterStatus(purchase.getXcfhxApplyStatus());


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java View File

@@ -12,7 +12,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectStatusChangeService;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
@@ -92,7 +92,7 @@ public class ProjectStatusHandler {
* @return \
*/
public ProtraitProjectStatusSituationVO genStatus(Project project, String statusName,
ProjectStatusEnum currStatus, ProjectStatusEnum nextStatus) {
ProjectStatus currStatus, ProjectStatus nextStatus) {
ProtraitProjectStatusSituationVO vo = new ProtraitProjectStatusSituationVO();
if (Objects.isNull(project)) {
return vo;


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/FundStatisticsManage.java View File

@@ -12,7 +12,7 @@ import com.hz.pm.api.gov.service.IGovBizProjectApplyService;
import com.hz.pm.api.gov.service.IGovBizProjectApproveService;
import com.hz.pm.api.gov.service.IGovBizProjectBaseinfoService;
import com.hz.pm.api.gov.service.IGovBizProjectProcureService;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.service.IProjectService;
import lombok.RequiredArgsConstructor;
@@ -141,7 +141,7 @@ public class FundStatisticsManage {
//首先完成年度计划 并且未注销的项目
List<Project> normalProjects = projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().compareTo(ProjectStatusEnum.BE_SUSPENDED.getCode()) > 0) {
p.getStatus().compareTo(ProjectStatus.BE_SUSPENDED.getCode()) > 0) {
return Boolean.TRUE;
}
return Boolean.FALSE;


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/ProjectFileManage.java View File

@@ -44,7 +44,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectInstService;
@@ -128,7 +128,7 @@ public class ProjectFileManage {
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.like(StrUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName())
.like(StrUtils.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName())
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode())
.eq(Project::getStatus, ProjectStatus.ACCEPTED.getCode())
.orderByDesc(Project::getUpdateOn);
Page<Project> page = projectService.page(req.page(), query);
if (CollUtil.isEmpty(page.getRecords())) {
@@ -249,7 +249,7 @@ public class ProjectFileManage {
Assert.notNull(project, "提交失败 此项目不存在!");

// 首先要判断 项目当前状态 是不是 已归档
if (!ProjectStatusEnum.ACCEPTED.eq(project.getStatus())) {
if (!ProjectStatus.ACCEPTED.eq(project.getStatus())) {
throw BizException.wrap("提交失败 该项目不是 已归档");
}



+ 4
- 7
hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectConvertUtil.java View File

@@ -13,10 +13,8 @@ import com.hz.pm.api.common.model.constant.RegionConst;
import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.gov.enumeration.GovProjectClassifiedEnum;
import com.hz.pm.api.gov.model.vo.*;
import com.hz.pm.api.projectdeclared.model.vo.ContractVO;
import com.hz.pm.api.projectdeclared.model.vo.PaymentPlanVO;
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO;
import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO;
@@ -100,9 +98,9 @@ public class ProjectConvertUtil {
baseinfo.setBaseProvManDeprt(project.getHigherSuperOrg());
baseinfo.setBaseProvManDepartDing(project.getHigherSuperOrgCode());
baseinfo.setBaseProvManDeprtType(project.getBaseProvManDeprtType());
ProjectStatusEnum match = ProjectStatusEnum.match(project.getStatus());
if (Objects.nonNull(match) && (Objects.nonNull(match.getCollectionStatus()))) {
baseinfo.setBaseProjSetProg(match.getCollectionStatus().getCode());
ProjectStatus projectStatus = ProjectStatus.getNoNull(project.getStatus());
if (projectStatus.getCollectStatus() != null) {
baseinfo.setBaseProjSetProg(projectStatus.getCollectStatus().getCode());
}
baseinfo.setBaseProjType(project.getProjectType());
baseinfo.setDeleted(Boolean.FALSE);
@@ -112,7 +110,6 @@ public class ProjectConvertUtil {
//转化申报信息
private static GovBizProjectApplyVO buildApply(ProjectDetailVO project) {
GovBizProjectApplyVO apply = new GovBizProjectApplyVO();
// apply.setBaseProjId(project.getProjectCode());
apply.setBaseProjName(project.getProjectName());
apply.setAreaCode(RegionConst.RC_HZ);
apply.setBaseHistorProjId(project.getBaseHistorProjId());


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/IrsProjectManage.java View File

@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.model.PageVo;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
@@ -56,7 +56,7 @@ public class IrsProjectManage {
.le(Objects.nonNull(req.getCreateOnMax()), Project::getCreateOn, req.getCreateOnMax())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName())
.gt(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode())
.gt(Project::getStatus, ProjectStatus.UNDER_CONSTRUCTION.getCode())
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getIncludeApplication, CommonEnum.YES.getCode())
.orderByDesc(Project::getUpdateOn);


+ 6
- 6
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java View File

@@ -36,7 +36,7 @@ import com.hz.pm.api.meta.helper.DictionaryCache;
import com.hz.pm.api.meta.helper.TagCache;
import com.hz.pm.api.organization.service.IDingOrganizationService;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.model.dto.RegionDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
@@ -862,16 +862,16 @@ public class MeetingManage {
.eq(Project::getNewest, Boolean.TRUE);
switch (MeetingReviewTypeEnum.getByCode(meetingType)) {
case PRELIMINARY_SCHEME_REVIEW:
buildOptionProjectQuery(query, meetingType, ProjectStatusEnum.PRE_APPLYING);
buildOptionProjectQuery(query, meetingType, ProjectStatus.PRE_APPLYING);
break;
case CONSTRUCTION_SCHEME_REVIEW:
buildOptionProjectQuery(query, meetingType, ProjectStatusEnum.SCHEME_UNDER_REVIEW);
buildOptionProjectQuery(query, meetingType, ProjectStatus.SCHEME_UNDER_REVIEW);
break;
case ACCEPTANCE_SCHEME_REVIEW:
buildOptionProjectQuery(query, meetingType, ProjectStatusEnum.ON_FINALLY_INSPECTED);
buildOptionProjectQuery(query, meetingType, ProjectStatus.ON_FINALLY_INSPECTED);
break;
case DEPT_JOIN_REVIEW:
buildOptionProjectQuery(query, meetingType, ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW);
buildOptionProjectQuery(query, meetingType, ProjectStatus.DEPARTMENT_JOINT_REVIEW);
break;
case FAIRNESS_REVIEW:
break;
@@ -903,7 +903,7 @@ public class MeetingManage {
return Collections.emptyList();
}

private void buildOptionProjectQuery(LambdaQueryWrapper<Project> query, String meetingType, ProjectStatusEnum status) {
private void buildOptionProjectQuery(LambdaQueryWrapper<Project> query, String meetingType, ProjectStatus status) {
query.eq(Project::getStatus, status.getCode());
String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" +
" m.is_inner_project = 1 and m.id = mip.meeting_id and nd_project.id = mip.project_id" +


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/OrgSelfAppraisalManage.java View File

@@ -30,7 +30,7 @@ import com.hz.pm.api.performance.util.MultiColumnMergeStrategy;
import com.hz.pm.api.portrait.model.entity.ProjectTag;
import com.hz.pm.api.portrait.service.IProjectTagService;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.model.entity.Role;
@@ -106,7 +106,7 @@ public class OrgSelfAppraisalManage {

// 获取登录用户所在单位的所有已终验项目信息
List<Project> projectLists = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode())
.eq(Project::getStatus, ProjectStatus.ACCEPTED.getCode())
.eq(Project::getBuildOrgCode, mhUnitId));

if (CollUtil.isEmpty(projectLists)) {


+ 4
- 4
hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/PerformanceAppraisalPlanManage.java View File

@@ -31,7 +31,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO;
@@ -904,7 +904,7 @@ public class PerformanceAppraisalPlanManage {
Page<ProjectApplication> page = req.page();
// 获取登录用户所在区域已验收项目
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode())
.eq(Project::getStatus, ProjectStatus.ACCEPTED.getCode())
.eq(Project::getNewest, Boolean.TRUE));
// 获取已验收项目关联的应用信息
List<Integer> projectVersions = projects.stream().map(Project::getVersion).collect(Collectors.toList());
@@ -1071,7 +1071,7 @@ public class PerformanceAppraisalPlanManage {
param.setBuildOrgName(buildOrgName);
param.setProjectType(projectType);
param.setProjectYear(projectYear);
param.setStatus(ProjectStatusEnum.ACCEPTED.getCode());
param.setStatus(ProjectStatus.ACCEPTED.getCode());
// 获取已添加到评价计划中的项目
List<String> projectCodes = performanceAppraisalProjectService.list().stream()
.map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList());
@@ -1102,7 +1102,7 @@ public class PerformanceAppraisalPlanManage {
// 获取本区域已验收的项目关联的应用
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()));
.eq(Project::getStatus, ProjectStatus.ACCEPTED.getCode()));
if (CollUtil.isEmpty(projectList)) {
return PageVo.empty();
}


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/RectifyManage.java View File

@@ -19,7 +19,7 @@ import com.hz.pm.api.performance.model.vo.PerformanceAppraisalVO;
import com.hz.pm.api.performance.model.vo.RectifyDetailVO;
import com.hz.pm.api.performance.service.IPerformanceAppraisalProjectService;
import com.hz.pm.api.performance.service.IPerformanceAppraisalService;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.service.IProjectService;
@@ -90,7 +90,7 @@ public class RectifyManage {

// 获取登录用户所在单位的所有已终验项目信息
List<Project> projectLists = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()).eq(Project::getBuildOrgCode, mhUnitId));
.eq(Project::getStatus, ProjectStatus.ACCEPTED.getCode()).eq(Project::getBuildOrgCode, mhUnitId));

if (CollUtil.isEmpty(projectLists)) {
return PageVo.empty();


+ 23
- 23
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java View File

@@ -32,10 +32,10 @@ import com.hz.pm.api.projectlib.helper.ProjectHelper;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderXcfhxApplyStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderXcfhxApplyStatus;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.hz.pm.api.projectlib.model.vo.TenderListInfoVO;
@@ -106,9 +106,9 @@ public class ConstructionManage {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
//建设中状态
query.eq(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
query.eq(Project::getStatus, ProjectStatus.UNDER_CONSTRUCTION.getCode());
query.isNull(Project::getContractAmount);
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
@@ -152,8 +152,8 @@ public class ConstructionManage {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
//建设中状态以后的 都是
query.and(q1 -> q1.gt(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode())
.or(q2 -> q2.eq(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode())
query.and(q1 -> q1.gt(Project::getStatus, ProjectStatus.UNDER_CONSTRUCTION.getCode())
.or(q2 -> q2.eq(Project::getStatus, ProjectStatus.UNDER_CONSTRUCTION.getCode())
.isNotNull(Project::getContractAmount)));
query.eq(Project::getNewest, Boolean.TRUE);
//只能看自己单位的
@@ -208,9 +208,9 @@ public class ConstructionManage {
public void exportList(HttpServletResponse response, ProjectListReq param) {
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param);
//待采购状态
query.eq(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
query.eq(Project::getStatus, ProjectStatus.UNDER_CONSTRUCTION.getCode());
query.isNull(Project::getContractAmount);
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
query.orderByAsc(Project::getTransactionTime);
List<Project> records = projectService.list(query);
@@ -227,7 +227,7 @@ public class ConstructionManage {
DeclaredProjectExportDTO exportData = new DeclaredProjectExportDTO();
BeanUtils.copyProperties(r, exportData);
exportData.setProjectTypeName(ProjectTypeNewEnum.getDesc(r.getProjectType()));
exportData.setStatusName(ProjectStatusEnum.getDesc(r.getStatus()));
exportData.setStatusName(ProjectStatus.getDesc(r.getStatus()));
String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm");
exportData.setCreateOn(createOnStr);
exportData.setSerialNumber(serialNumber.incrementAndGet());
@@ -291,13 +291,13 @@ public class ConstructionManage {
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 采购结果备案
VUtils.isTrue(!ProjectStatusEnum.ON_PURCHASING.getCode().equals(project.getStatus()) ||
!ProjectStatusEnum.PROJECT_APPROVED.getCode().equals(project.getStage()))
VUtils.isTrue(!ProjectStatus.ON_PURCHASING.getCode().equals(project.getStatus()) ||
!ProjectStatus.PROJECT_APPROVED.getCode().equals(project.getStage()))
.throwMessage("提交失败 该项目不是 建设中或者已立项阶段");

Purchase purchase = purchaseService.getById(req.getBidId());

if (!TenderStatusEnum.TO_BE_SUBMIT_CONSTRUCTION_INFO.eq(purchase.getStatus())) {
if (!TenderStatus.TO_BE_SUBMIT_CONSTRUCTION_INFO.eq(purchase.getStatus())) {
throw BizException.wrap("该标段不支持填写合同信息");
}
tenderStateMachineUtil.pass(purchase);
@@ -331,11 +331,11 @@ public class ConstructionManage {
return "填写成功";
}

private static final List<TenderStatusEnum> PRE_INSPECTED_PURCHASE_STATUS;
private static final List<TenderStatus> PRE_INSPECTED_PURCHASE_STATUS;

static {
PRE_INSPECTED_PURCHASE_STATUS = new ArrayList<>();
PRE_INSPECTED_PURCHASE_STATUS.add(TenderStatusEnum.TO_BE_SUBMIT_FIRST_INSPECTED_INFO);
PRE_INSPECTED_PURCHASE_STATUS.add(TenderStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO);
}

/**
@@ -352,7 +352,7 @@ public class ConstructionManage {
}
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
query.in(Project::getId, projectIds);
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
@@ -401,7 +401,7 @@ public class ConstructionManage {
tender.setBidName(x.getBidName());
tender.setBidId(x.getId());
tender.setBidStatus(x.getStatus());
tender.setBidStatusName(TenderStatusEnum.getDescByStatus(x.getStatus()));
tender.setBidStatusName(TenderStatus.getDescByStatus(x.getStatus()));
Contract contract = contractMap.get(x.getId());
if (contract != null) {
tender.setConstructionAmount(contract.getTotalAmount());
@@ -422,8 +422,8 @@ public class ConstructionManage {
//待采购状态
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStatus, ProjectStatus.UNDER_CONSTRUCTION.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
//交货时间 排序
query.isNotNull(Project::getDeliveryTime);
@@ -444,7 +444,7 @@ public class ConstructionManage {
DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO();
BeanUtils.copyProperties(r, exportDTO);
exportDTO.setProjectTypeName(ProjectTypeNewEnum.getDesc(r.getProjectType()));
exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus()));
exportDTO.setStatusName(ProjectStatus.getDesc(r.getStatus()));
String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm");
exportDTO.setCreateOn(createOnStr);
exportDTO.setSerialNumber(serialNumber.incrementAndGet());
@@ -519,7 +519,7 @@ public class ConstructionManage {
public synchronized void submitFirstInspectedFiles(PreInsSaveDTO req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
Purchase purchase = purchaseService.getById(req.getBidId());
if (!TenderStatusEnum.TO_BE_SUBMIT_FIRST_INSPECTED_INFO.eq(purchase.getStatus())) {
if (!TenderStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO.eq(purchase.getStatus())) {
throw BizException.wrap("该标段无法上传初验材料");
}
LocalDateTime now = LocalDateTime.now();
@@ -563,8 +563,8 @@ public class ConstructionManage {
@Transactional(rollbackFor = Exception.class)
public synchronized void submitXcfhxApply(XcfhxApplyReq req) {
Purchase purchase = purchaseService.getById(req.getBidId());
if (!TenderXcfhxApplyStatusEnum.TO_BE_SUBMIT_XCFHX_APPLY.eq(purchase.getXcfhxApplyStatus())
&& !TenderXcfhxApplyStatusEnum.XCFHX_APPLY_FAILED.eq(purchase.getXcfhxApplyStatus())) {
if (!TenderXcfhxApplyStatus.TO_BE_SUBMIT_XCFHX_APPLY.eq(purchase.getXcfhxApplyStatus())
&& !TenderXcfhxApplyStatus.XCFHX_APPLY_FAILED.eq(purchase.getXcfhxApplyStatus())) {
throw BizException.wrap("该标段不支持提交信创符合性申请");
}



+ 8
- 8
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java View File

@@ -24,7 +24,7 @@ import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
@@ -100,8 +100,8 @@ public class ConstructionPlanManage {
VUtils.isTrue(StringUtils.isBlank(projectInfo.getConstructionPlanFile())).throwMessage("提交失败,请提交建设方案!");

// 判断 项目当前状态 是不是 方案待申报
VUtils.isTrue(!ProjectStatusEnum.PLAN_TO_BE_DECLARED.eq(oldProject.getStatus()) ||
!ProjectStatusEnum.NOT_APPROVED.eq(oldProject.getStage()))
VUtils.isTrue(!ProjectStatus.PLAN_TO_BE_DECLARED.eq(oldProject.getStatus()) ||
!ProjectStatus.NOT_APPROVED.eq(oldProject.getStage()))
.throwMessage("提交失败 该项目不是 方案待申报状态或者未立项阶段");

projectInfo.setBuildOrgCode(user.getMhUnitIdStr());
@@ -201,7 +201,7 @@ public class ConstructionPlanManage {
VUtils.isTrue(StringUtils.isBlank(projectDto.getConstructionPlanFile())).throwMessage("提交失败 请提交建设方案!");
//直接先到待方案审批
Project project = projectLibManage.saveProjectWithVersionAndStatus(projectDto, null,
ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode(), Boolean.TRUE);
ProjectStatus.PLAN_TO_BE_DECLARED.getCode(), Boolean.TRUE);
dto.getProjectInfo().setId(project.getId());
dto.setRestart(Boolean.TRUE);
return startTheProcess(dto);
@@ -246,8 +246,8 @@ public class ConstructionPlanManage {
ProjectListReq req = new ProjectListReq();
BeanUtils.copyProperties(planReq, req);
//项目阶段 状态 已定 方案待申报
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
req.setStage(ProjectStatus.NOT_APPROVED.getCode());
req.setStatus(ProjectStatus.PLAN_TO_BE_DECLARED.getCode());
UserInfoDetails user = LoginUserUtil.loginUserDetail();
// 放入用户的单位
req.setBuildOrgCode(user.getMhUnitIdStr());
@@ -259,8 +259,8 @@ public class ConstructionPlanManage {
ProjectListReq req = new ProjectListReq();
BeanUtils.copyProperties(planReq, req);
//项目阶段 状态 已定 方案待申报
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
req.setStage(ProjectStatus.NOT_APPROVED.getCode());
req.setStatus(ProjectStatus.PLAN_TO_BE_DECLARED.getCode());
UserInfoDetails user = LoginUserUtil.loginUserDetail();
//放入用户的单位
req.setBuildOrgCode(user.getMhUnitIdStr());


+ 5
- 5
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java View File

@@ -29,7 +29,7 @@ import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
@@ -218,8 +218,8 @@ public class DeclaredProjectManage {
}

//首先要判断 项目当前状态 是不是 单位内部拒绝
VUtils.isTrue(!ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
VUtils.isTrue(!ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatus.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
.throwMessage("提交失败 该项目不是 单位内部拒绝审核状态或者未立项阶段");

ProcessStartParamsVo params = new ProcessStartParamsVo();
@@ -370,7 +370,7 @@ public class DeclaredProjectManage {
//如果当前登录是单位管理员
String mhUnitId = user.getMhUnitIdStr();
if (user.getIsOrgAdmin()) {
query.and(s1 -> s1.eq(Project::getStatus, ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode())
query.and(s1 -> s1.eq(Project::getStatus, ProjectStatus.PREQUALIFICATION_FAILED.getCode())
.eq(Project::getSuperOrgCode, mhUnitId)
.or(q2 -> q2.eq(Project::getBuildOrgCode, mhUnitId)));
} else {
@@ -392,7 +392,7 @@ public class DeclaredProjectManage {
DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO();
BeanUtils.copyProperties(r, exportDTO);
exportDTO.setProjectTypeName(ProjectTypeNewEnum.getDesc(r.getProjectType()));
exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus()));
exportDTO.setStatusName(ProjectStatus.getDesc(r.getStatus()));
String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm");
exportDTO.setCreateOn(createOnStr);
exportDTO.setSerialNumber(serialNumber.incrementAndGet());


+ 10
- 11
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DelayedApplyManage.java View File

@@ -22,7 +22,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectDelayApply;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
@@ -47,7 +47,6 @@ import com.wflow.exception.BusinessException;
import com.wflow.workflow.bean.dto.OrgInfoDTO;
import com.wflow.workflow.bean.vo.ProcessStartParamsVo;
import com.wflow.workflow.service.ProcessInstanceService;
import com.wflow.workflow.service.ProcessModelService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -102,8 +101,8 @@ public class DelayedApplyManage {
// 待终验 并且已经过期
// 只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
query.eq(Project::getStatus, ProjectStatusEnum.ON_PILOT_RUNNING.getCode());
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStatus, ProjectStatus.ON_PILOT_RUNNING.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.lt(Project::getPlanAcceptanceTime, LocalDateTime.now());
query.eq(Project::getNewest, Boolean.TRUE);
query.isNotNull(Project::getApprovalDate);
@@ -172,8 +171,8 @@ public class DelayedApplyManage {
// 待终验
// 只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getStatus, ProjectStatusEnum.ON_PILOT_RUNNING.getCode());
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStatus, ProjectStatus.ON_PILOT_RUNNING.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
query.isNotNull(Project::getApprovalDate);
query.isNotNull(Project::getBuildCycle);
@@ -187,7 +186,7 @@ public class DelayedApplyManage {
DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO();
BeanUtils.copyProperties(r, exportDTO);
exportDTO.setProjectTypeName(ProjectTypeNewEnum.getDesc(r.getProjectType()));
exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus()));
exportDTO.setStatusName(ProjectStatus.getDesc(r.getStatus()));
String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm");
exportDTO.setCreateOn(createOnStr);
exportDTO.setSerialNumber(rowNo.incrementAndGet());
@@ -224,8 +223,8 @@ public class DelayedApplyManage {
Assert.notNull(project, "提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 以终验
VUtils.isTrue(!ProjectStatusEnum.ON_PILOT_RUNNING.eq(project.getStatus()) ||
!ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage()))
VUtils.isTrue(!ProjectStatus.ON_PILOT_RUNNING.eq(project.getStatus()) ||
!ProjectStatus.PROJECT_APPROVED.eq(project.getStage()))
.throwMessage("提交失败 该项目不是 已立项|待终验");

VUtils.isTrue(Objects.isNull(project.getPlanAcceptanceTime())
@@ -249,8 +248,8 @@ public class DelayedApplyManage {
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 以终验
VUtils.isTrue(!ProjectStatusEnum.ON_PILOT_RUNNING.eq(project.getStatus()) ||
!ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage()))
VUtils.isTrue(!ProjectStatus.ON_PILOT_RUNNING.eq(project.getStatus()) ||
!ProjectStatus.PROJECT_APPROVED.eq(project.getStage()))
.throwMessage("提交失败 该项目不是 已立项|待终验");

VUtils.isTrue(Objects.isNull(project.getPlanAcceptanceTime())


+ 14
- 14
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java View File

@@ -26,9 +26,9 @@ import com.hz.pm.api.projectlib.helper.ProjectHelper;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.hz.pm.api.projectlib.model.vo.TenderListInfoVO;
@@ -87,13 +87,13 @@ public class FinalAcceptanceManage {
private final IProjectInstService projectInstService;
private final HandlerManage handlerManage;

private static final List<TenderStatusEnum> FINAL_INSPECTED_TENDER_STATUS;
private static final List<TenderStatus> FINAL_INSPECTED_TENDER_STATUS;

static {
FINAL_INSPECTED_TENDER_STATUS = new ArrayList<>();
FINAL_INSPECTED_TENDER_STATUS.add(TenderStatusEnum.FINALLY_INSPECTED_FAILED);
FINAL_INSPECTED_TENDER_STATUS.add(TenderStatusEnum.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY);
FINAL_INSPECTED_TENDER_STATUS.add(TenderStatusEnum.ON_FINALLY_INSPECTED_APPLY);
FINAL_INSPECTED_TENDER_STATUS.add(TenderStatus.FINALLY_INSPECTED_FAILED);
FINAL_INSPECTED_TENDER_STATUS.add(TenderStatus.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY);
FINAL_INSPECTED_TENDER_STATUS.add(TenderStatus.ON_FINALLY_INSPECTED_APPLY);
}


@@ -115,7 +115,7 @@ public class FinalAcceptanceManage {
}
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
query.in(Project::getId, projectIds);
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
query.orderByAsc(Project::getApprovalDate);
Page<Project> page = projectService.page(req.page(), query);
@@ -161,7 +161,7 @@ public class FinalAcceptanceManage {
tender.setBidName(x.getBidName());
tender.setBidId(x.getId());
tender.setBidStatus(x.getStatus());
tender.setBidStatusName(TenderStatusEnum.getDescByStatus(x.getStatus()));
tender.setBidStatusName(TenderStatus.getDescByStatus(x.getStatus()));
Contract contract = contractMap.get(x.getId());
if (contract != null) {
tender.setConstructionAmount(contract.getTotalAmount());
@@ -181,8 +181,8 @@ public class FinalAcceptanceManage {
//待终验
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getStatus, ProjectStatusEnum.ON_PILOT_RUNNING.getCode());
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStatus, ProjectStatus.ON_PILOT_RUNNING.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
query.isNotNull(Project::getApprovalDate);
query.isNotNull(Project::getBuildCycle);
@@ -196,7 +196,7 @@ public class FinalAcceptanceManage {
DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO();
BeanUtils.copyProperties(r, exportDTO);
exportDTO.setProjectTypeName(ProjectTypeNewEnum.getDesc(r.getProjectType()));
exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus()));
exportDTO.setStatusName(ProjectStatus.getDesc(r.getStatus()));
String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm");
exportDTO.setCreateOn(createOnStr);
exportDTO.setSerialNumber(serialNumber.incrementAndGet());
@@ -259,8 +259,8 @@ public class FinalAcceptanceManage {
Map<Long, Purchase> purchaseMap = CollUtils.listToMap(purchases, Purchase::getId);
Purchase purchase = purchaseMap.get(req.getBidId());
Assert.notNull(purchase, "当前标段不存在");
if (!TenderStatusEnum.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY.eq(purchase.getStatus())
&& !TenderStatusEnum.FINALLY_INSPECTED_FAILED.eq(purchase.getStatus())) {
if (!TenderStatus.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY.eq(purchase.getStatus())
&& !TenderStatus.FINALLY_INSPECTED_FAILED.eq(purchase.getStatus())) {
throw BizException.wrap("该标段不支持终验申报");
}
Project project = projectService.getNewProject(req.getProjectId());
@@ -288,7 +288,7 @@ public class FinalAcceptanceManage {
projectInst.setProjectId(req.getProjectId());
projectInstService.save(projectInst);

if (ProjectStatusEnum.ON_PILOT_RUNNING.eq(project.getStatus())) {
if (ProjectStatus.ON_PILOT_RUNNING.eq(project.getStatus())) {
// 判断是否所有标段已经进行过终验申报 无论是否通过
LambdaQueryWrapper<PurchaseInst> purchaseInstQuery = Wrappers.lambdaQuery(PurchaseInst.class)
.select(PurchaseInst::getBidId)


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/OperationManage.java View File

@@ -14,7 +14,7 @@ import com.hz.pm.api.projectdeclared.model.vo.OperationVO;
import com.hz.pm.api.projectdeclared.service.IOperationService;
import com.hz.pm.api.projectdeclared.service.IPurchaseService;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
@@ -78,7 +78,7 @@ public class OperationManage {
List<Purchase> purchases = purchaseService.listByProjectId(req.getProjectId());
Map<Long, Purchase> purchaseMap = CollUtils.listToMap(purchases, Purchase::getId);
Purchase purchase = purchaseMap.get(req.getBidId());
if (!TenderStatusEnum.TO_BE_SUBMIT_OPERATION_PLAN.eq(purchase.getStatus())) {
if (!TenderStatus.TO_BE_SUBMIT_OPERATION_PLAN.eq(purchase.getStatus())) {
throw BizException.wrap("该标段不支持填写实施计划");
}
Operation operation = operationService.getByBidId(req.getBidId());


+ 18
- 18
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PrequalificationDeclaredProjectManage.java View File

@@ -17,7 +17,7 @@ import com.hz.pm.api.projectlib.manage.ProjectLibManage;
import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
@@ -110,9 +110,9 @@ public class PrequalificationDeclaredProjectManage {
.throwMessage(String.format("只有主管单位 【%s】的人 才能够提交", projectInfo.getSuperOrg()));

//首先要判断 项目当前状态 是不是 待预审
VUtils.isTrue((!ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(projectInfo.getStatus()) &&
!ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode().equals(projectInfo.getStatus())) ||
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
VUtils.isTrue((!ProjectStatus.PENDING_PREQUALIFICATION.getCode().equals(projectInfo.getStatus()) &&
!ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode().equals(projectInfo.getStatus())) ||
!ProjectStatus.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
.throwMessage("提交失败 该项目不是 待预审状态(省级部门联审成功)或者未立项阶段");

//使用状态机 进入下一步 看看需不需要走省级审批 放入文件
@@ -122,7 +122,7 @@ public class PrequalificationDeclaredProjectManage {
projectStateMachineUtil.pass(projectInfo);
String instanceId;
//如果是省级部门 需要联审的(申报金额大于1000万 并且是市级项目)
if (ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS
if (ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS
.getCode().equals(projectInfo.getStatus())) {
//入库暂存表 后续处理 对接外部接口
projectInfo.setUpdateOn(LocalDateTime.now());
@@ -135,7 +135,7 @@ public class PrequalificationDeclaredProjectManage {
return "提交省级部门联审成功";
}
return "提交省级部门联审失败";
} else if (ProjectStatusEnum.PRE_APPLYING
} else if (ProjectStatus.PRE_APPLYING
.getCode().equals(projectInfo.getStatus())) {
//如果是非省级联审的项目 直接提交 预审
instanceId = directStartProcess(projectInfo, user, dto.getRestart());
@@ -160,7 +160,7 @@ public class PrequalificationDeclaredProjectManage {
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");
//重新提交 生成新版本号 回到 待预审状态
Project project = projectLibManage.saveProjectWithVersionAndStatus(projectDto, null,
ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode(), Boolean.FALSE);
ProjectStatus.PENDING_PREQUALIFICATION.getCode(), Boolean.FALSE);
dto.getProjectInfo().setId(project.getId());
dto.setRestart(Boolean.TRUE);
return startTheProcess(dto);
@@ -240,9 +240,9 @@ public class PrequalificationDeclaredProjectManage {
ProjectListReq req = new ProjectListReq();
BeanUtils.copyProperties(preReq, req);
//项目阶段 状态 已定 待预审和省级部门联审成功
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
req.setStatusList(Lists.newArrayList(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode(),
ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()));
req.setStage(ProjectStatus.NOT_APPROVED.getCode());
req.setStatusList(Lists.newArrayList(ProjectStatus.PENDING_PREQUALIFICATION.getCode(),
ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()));
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
buildPermission(query, user);
query.eq(Project::getNewest, Boolean.TRUE);
@@ -267,8 +267,8 @@ public class PrequalificationDeclaredProjectManage {
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
if (user.getIsOrgAdmin() &&
(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus()) ||
ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode().equals(item.getStatus()))
(ProjectStatus.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus()) ||
ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode().equals(item.getStatus()))
&& StringUtils.isNotBlank(w.getSuperOrgCode())
&& w.getSuperOrgCode().equals(user.getMhUnitIdStr())) {
item.setCanPreDeclared(Boolean.TRUE);
@@ -287,9 +287,9 @@ public class PrequalificationDeclaredProjectManage {
if (user.getIsOrgAdmin()) {
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目
query.and(q1 -> q1.eq(Project::getBuildOrgCode, user.getMhUnitIdStr())
.or(q2 -> q2.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode())
.and(s1 -> s1.eq(Project::getStatus, ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode())
.or(s2 -> s2.eq(Project::getStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode())))
.or(q2 -> q2.eq(Project::getStage, ProjectStatus.NOT_APPROVED.getCode())
.and(s1 -> s1.eq(Project::getStatus, ProjectStatus.PENDING_PREQUALIFICATION.getCode())
.or(s2 -> s2.eq(Project::getStatus, ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode())))
.eq(Project::getSuperOrgCode, user.getMhUnitIdStr())));
} else {
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
@@ -300,9 +300,9 @@ public class PrequalificationDeclaredProjectManage {
ProjectListReq req = new ProjectListReq();
BeanUtils.copyProperties(preReq, req);
//项目阶段 状态 已定 待预审
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
req.setStatusList(Lists.newArrayList(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode(),
ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()));
req.setStage(ProjectStatus.NOT_APPROVED.getCode());
req.setStatusList(Lists.newArrayList(ProjectStatus.PENDING_PREQUALIFICATION.getCode(),
ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()));
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
//角色权限


+ 8
- 8
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java View File

@@ -16,7 +16,7 @@ import com.hz.pm.api.projectlib.manage.ProjectLibManage;
import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
@@ -130,10 +130,10 @@ public class ProjectAdjustmentManage {
}

private static final List<Integer> PROJECT_STATUS = Arrays.asList(
ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(),
ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(),
ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(),
ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode());
ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(),
ProjectStatus.PREQUALIFICATION_FAILED.getCode(),
ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(),
ProjectStatus.SCHEME_REVIEW_FAILED.getCode());

/**
* 项目库
@@ -146,7 +146,7 @@ public class ProjectAdjustmentManage {
ProjectListReq req = new ProjectListReq();
BeanUtils.copyProperties(preReq, req);
//项目阶段 状态 已定 方案待申报
req.setStageList(Collections.singletonList(ProjectStatusEnum.NOT_APPROVED.getCode()));
req.setStageList(Collections.singletonList(ProjectStatus.NOT_APPROVED.getCode()));
//只有 单位内部审核不通过 省级联审不通过 预审不通过 建设方案不通过 4种状态
req.setStatusList(PROJECT_STATUS);
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
@@ -161,7 +161,7 @@ public class ProjectAdjustmentManage {
ProjectListReq req = new ProjectListReq();
BeanUtils.copyProperties(preReq, req);
//项目阶段 状态 已定 方案待申报
req.setStageList(Collections.singletonList(ProjectStatusEnum.NOT_APPROVED.getCode()));
req.setStageList(Collections.singletonList(ProjectStatus.NOT_APPROVED.getCode()));
//只有 单位内部审核不通过 省级联审不通过 预审不通过 建设方案不通过 4种状态
req.setStatusList(PROJECT_STATUS);
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
@@ -177,7 +177,7 @@ public class ProjectAdjustmentManage {
ProjectAdjustmentExportDTO exportDTO = new ProjectAdjustmentExportDTO();
BeanUtils.copyProperties(r, exportDTO);
exportDTO.setProjectTypeName(ProjectTypeNewEnum.getDesc(r.getProjectType()));
exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus()));
exportDTO.setStatusName(ProjectStatus.getDesc(r.getStatus()));
String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm");
exportDTO.setCreateOn(createOnStr);
exportDTO.setSerialNumber(serialNumber.incrementAndGet());


+ 26
- 25
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java View File

@@ -55,6 +55,7 @@ import com.hz.pm.api.projectlib.helper.ProjectHelper;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.*;
import com.hz.pm.api.projectlib.model.enumeration.status.*;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.hz.pm.api.projectlib.model.vo.TenderListInfoVO;
@@ -179,9 +180,9 @@ public class PurchaseManage {
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
//待采购状态
query.in(Project::getStatus, Lists.newArrayList(ProjectStatusEnum.TO_BE_PURCHASED.getCode(),
ProjectStatusEnum.ON_PURCHASING.getCode()));
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.in(Project::getStatus, Lists.newArrayList(ProjectStatus.TO_BE_PURCHASED.getCode(),
ProjectStatus.ON_PURCHASING.getCode()));
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
query.orderByAsc(Project::getApprovalDate);
Page<Project> page = projectService.page(req.page(), query);
@@ -217,7 +218,7 @@ public class PurchaseManage {
tender.setBidName(x.getBidName());
tender.setBidId(x.getId());
tender.setBidStatus(x.getStatus());
tender.setBidStatusName(TenderStatusEnum.getDescByStatus(x.getStatus()));
tender.setBidStatusName(TenderStatus.getDescByStatus(x.getStatus()));
Contract contract = contractMap.get(x.getId());
if (contract != null) {
tender.setConstructionAmount(contract.getTotalAmount());
@@ -238,8 +239,8 @@ public class PurchaseManage {
//待采购状态
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getStatus, ProjectStatusEnum.TO_BE_PURCHASED.getCode());
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getStatus, ProjectStatus.TO_BE_PURCHASED.getCode());
query.eq(Project::getStage, ProjectStatus.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
query.orderByAsc(Project::getApprovalDate);
List<Project> records = projectService.list(query);
@@ -251,7 +252,7 @@ public class PurchaseManage {
DeclaredProjectExportDTO dpe = new DeclaredProjectExportDTO();
BeanUtils.copyProperties(r, dpe);
dpe.setProjectTypeName(ProjectTypeNewEnum.getDesc(r.getProjectType()));
dpe.setStatusName(ProjectStatusEnum.getDesc(r.getStatus()));
dpe.setStatusName(ProjectStatus.getDesc(r.getStatus()));
String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm");
dpe.setCreateOn(createOnStr);
dpe.setSerialNumber(serialNumber.incrementAndGet());
@@ -300,8 +301,8 @@ public class PurchaseManage {
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 采购结果备案
VUtils.isTrue(!ProjectStatusEnum.TO_BE_PURCHASED.eq(project.getStatus())
|| !ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage()))
VUtils.isTrue(!ProjectStatus.TO_BE_PURCHASED.eq(project.getStatus())
|| !ProjectStatus.PROJECT_APPROVED.eq(project.getStage()))
.throwMessage("提交失败 该项目不是 待采购备案状态或者已立项阶段");

List<Purchase> purchases = purchaseService.listByProjectId(projectId);
@@ -350,8 +351,8 @@ public class PurchaseManage {
Assert.notNull(project, "提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 采购结果备案
VUtils.isTrue(!ProjectStatusEnum.TO_BE_PURCHASED.eq(project.getStatus())
|| !ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage()))
VUtils.isTrue(!ProjectStatus.TO_BE_PURCHASED.eq(project.getStatus())
|| !ProjectStatus.PROJECT_APPROVED.eq(project.getStage()))
.throwMessage("提交失败,该项目不是待采购备案状态或者已立项阶段");
List<MhPurchaseNoticeDTO> notices = new ArrayList<>();
List<Purchase> purchases = req.getTenders().stream().map(w -> {
@@ -376,11 +377,11 @@ public class PurchaseManage {
if (purchase.getId() == null) {
purchase.setCreateBy(user.getUserIdStr());
}
purchase.setSelfTestStatus(TenderSelfTestStatusEnum.WITHOUT_SELF_TEST_INFO.getCode());
purchase.setTestValidStatus(TenderTestValidStatusEnum.WITHOUT_TEST_VALID_INFO.getCode());
purchase.setAdaptStatus(TenderAdaptStatusEnum.WITHOUT_ADAPT_INFO.getCode());
purchase.setStatus(TenderStatusEnum.TO_BE_SUBMIT_PURCHASE_INFO.getTenderStatus());
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatusEnum.TO_BE_SUBMIT_XCFHX_APPLY.getCode());
purchase.setSelfTestStatus(TenderSelfTestStatus.WITHOUT_SELF_TEST_INFO.getCode());
purchase.setTestValidStatus(TenderTestValidStatus.WITHOUT_TEST_VALID_INFO.getCode());
purchase.setAdaptStatus(TenderAdaptStatus.WITHOUT_ADAPT_INFO.getCode());
purchase.setStatus(TenderStatus.TO_BE_SUBMIT_PURCHASE_INFO.getCode());
purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatus.TO_BE_SUBMIT_XCFHX_APPLY.getCode());
if (Boolean.TRUE.equals(mhPurchaseNoticeOpen)) {
notices.add(buildPurchaseNotice(w, user));
}
@@ -441,7 +442,7 @@ public class PurchaseManage {
@Transactional(rollbackFor = Exception.class)
public synchronized void submitPurchaseRecord(SubmitPurchaseRecordReq req) {
Purchase purchase = purchaseService.getById(req.getBidId());
if (!TenderStatusEnum.TO_BE_SUBMIT_PURCHASE_INFO.eq(purchase.getStatus())) {
if (!TenderStatus.TO_BE_SUBMIT_PURCHASE_INFO.eq(purchase.getStatus())) {
throw BizException.wrap("该标段无法进行采购信息备案");
}
purchase.setId(req.getBidId());
@@ -556,8 +557,8 @@ public class PurchaseManage {
public synchronized void submitTestValidInfo(TestValidInfoReq req) {
List<Purchase> purchases = purchaseService.listByIds(req.getBidIds());
purchases.forEach(purchase -> {
if (!TenderTestValidStatusEnum.WITHOUT_TEST_VALID_INFO.eq(purchase.getTestValidStatus())
&& !TenderTestValidStatusEnum.TEST_VALID_INFO_FAILED.eq(purchase.getTestValidStatus())) {
if (!TenderTestValidStatus.WITHOUT_TEST_VALID_INFO.eq(purchase.getTestValidStatus())
&& !TenderTestValidStatus.TEST_VALID_INFO_FAILED.eq(purchase.getTestValidStatus())) {
throw BizException.wrap("该状态下不支持提交测试验证信息");
}
});
@@ -622,8 +623,8 @@ public class PurchaseManage {
public synchronized void submitSelfTestInfo(TestValidInfoReq req) {
List<Purchase> purchases = purchaseService.listByIds(req.getBidIds());
for (Purchase purchase : purchases) {
if (!TenderSelfTestStatusEnum.WITHOUT_SELF_TEST_INFO.eq(purchase.getSelfTestStatus())
&& !TenderSelfTestStatusEnum.SELF_TEST_INFO_FAILED.eq(purchase.getSelfTestStatus())) {
if (!TenderSelfTestStatus.WITHOUT_SELF_TEST_INFO.eq(purchase.getSelfTestStatus())
&& !TenderSelfTestStatus.SELF_TEST_INFO_FAILED.eq(purchase.getSelfTestStatus())) {
throw BizException.wrap("该状态下不支持提交系统自测信息");
}
}
@@ -669,8 +670,8 @@ public class PurchaseManage {
public synchronized void submitAdaptionInfo(TestValidInfoReq req) {
List<Purchase> purchases = purchaseService.listByIds(req.getBidIds());
for (Purchase purchase : purchases) {
if (!TenderAdaptStatusEnum.WITHOUT_ADAPT_INFO.eq(purchase.getAdaptStatus())
&& !TenderAdaptStatusEnum.ADAPT_INFO_FAILED.eq(purchase.getAdaptStatus())) {
if (!TenderAdaptStatus.WITHOUT_ADAPT_INFO.eq(purchase.getAdaptStatus())
&& !TenderAdaptStatus.ADAPT_INFO_FAILED.eq(purchase.getAdaptStatus())) {
throw BizException.wrap("该状态下不支持提交适配改造信息");
}
}
@@ -720,9 +721,9 @@ public class PurchaseManage {
.eq(req.getStatus() != null, Purchase::getXcfhxApplyStatus, req.getStatus())
.orderByDesc(Purchase::getCreateOn);
if (Boolean.TRUE.equals(req.getFinished())) {
query.eq(Purchase::getXcfhxApplyStatus, TenderXcfhxApplyStatusEnum.XCFHX_APPLY_PASSED.getCode());
query.eq(Purchase::getXcfhxApplyStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode());
} else {
query.ne(Purchase::getXcfhxApplyStatus, TenderXcfhxApplyStatusEnum.XCFHX_APPLY_PASSED.getCode());
query.ne(Purchase::getXcfhxApplyStatus, TenderXcfhxApplyStatus.XCFHX_APPLY_PASSED.getCode());
}
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
if (!buildPurchaseQueryPermission(query, user)) {


+ 3
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByDeptJointManage.java View File

@@ -1,12 +1,10 @@
package com.hz.pm.api.projectdeclared.manage;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.projectlib.manage.ProjectLibManage;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.staging.enums.MsgTypeEnum;
import com.hz.pm.api.sys.manage.NoticeManage;
@@ -19,7 +17,6 @@ import com.wflow.exception.BusinessException;
import com.wflow.workflow.bean.dto.OrgInfoDTO;
import com.wflow.workflow.bean.vo.ProcessStartParamsVo;
import com.wflow.workflow.service.ProcessInstanceService;
import com.wflow.workflow.service.ProcessModelService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@@ -70,8 +67,8 @@ public class ReviewByDeptJointManage {
throw new BusinessException("找不到部门联审申报流程配置");
}
//要判断 项目当前状态 是不是 部门联审
VUtils.isTrue(!ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
VUtils.isTrue(!ProjectStatus.DEPARTMENT_JOINT_REVIEW.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatus.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
.throwMessage("提交失败 该项目不是 省级部门联审状态状态或者未立项阶段");

// 再判断 该项目是否 真实走完 预审审批 并且提取出 提交人


+ 6
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java View File

@@ -3,7 +3,7 @@ package com.hz.pm.api.projectdeclared.manage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.projectdeclared.converter.ApplicationConverter;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.manage.ProjectLibManage;
import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
@@ -62,8 +62,8 @@ public class ReviewByProvincialDeptManage {
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 省级部门联审
VUtils.isTrue(!ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
VUtils.isTrue(!ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatus.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
.throwMessage("提交失败 该项目不是 省级部门联审状态状态或者未立项阶段");

// 对接省级联审的接口
@@ -89,13 +89,13 @@ public class ReviewByProvincialDeptManage {
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 省级部门联审不通过
VUtils.isTrue(!ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
VUtils.isTrue(!ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatus.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
.throwMessage("提交失败 该项目不是 省级部门联审不通过状态或者未立项阶段");

// 对接省级联审的接口
Project p = projectLibManage.saveProjectWithVersionAndStatus(project, null,
ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), Boolean.FALSE);
ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), Boolean.FALSE);

List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, p.getId()));


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java View File

@@ -20,7 +20,7 @@ import com.hz.pm.api.projectdeclared.model.entity.ReviewChecklistApprove;
import com.hz.pm.api.projectdeclared.service.IReviewChecklistApproveService;
import com.hz.pm.api.projectlib.helper.ProjectHelper;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectReviewCheckListItemVO;
import com.hz.pm.api.projectlib.service.IProjectService;
@@ -69,8 +69,8 @@ public class ReviewChecklistManage {
//项目查最新
query.eq(Project::getNewest, Boolean.TRUE);
//建设方案提交后的状态
query.ge(Project::getStatus, ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode())
.ne(Project::getStatus, ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
query.ge(Project::getStatus, ProjectStatus.SCHEME_UNDER_REVIEW.getCode())
.ne(Project::getStatus, ProjectStatus.PLAN_TO_BE_DECLARED.getCode());
UserInfoDetails user = LoginUserUtil.loginUserDetail();
buildReviewCheckPermission(query, user);



+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IPurchaseService.java View File

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import com.ningdatech.basic.util.CollUtils;

import java.util.Collection;
@@ -36,12 +36,12 @@ public interface IPurchaseService extends IService<Purchase> {
.orderByAsc(Purchase::getId));
}

default Set<Long> listProjectIdByStatus(Collection<TenderStatusEnum> status) {
default Set<Long> listProjectIdByStatus(Collection<TenderStatus> status) {
if (CollUtil.isEmpty(status)) {
return Collections.emptySet();
}
List<Integer> statusCodes = status.stream()
.map(TenderStatusEnum::getTenderStatus)
.map(TenderStatus::getCode)
.collect(Collectors.toList());
LambdaQueryWrapper<Purchase> query = Wrappers.lambdaQuery(Purchase.class)
.select(Purchase::getProjectId)


+ 6
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java View File

@@ -4,7 +4,7 @@ import com.google.common.collect.Maps;
import com.hz.pm.api.projectdeclared.manage.*;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectlib.manage.DeclaredRecordManage;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import org.springframework.stereotype.Component;

import java.util.Map;
@@ -29,19 +29,19 @@ public class RestartProcessMapUtil {
ReviewByProvincialDeptManage provincialDeptManage,
DeclaredRecordManage declaredRecordManage) {
//重新项目申报
RESTART_PROCESS_MAP.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(),
RESTART_PROCESS_MAP.put(ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(),
declaredProjectManage::reStartTheProcess);
//建设方案
RESTART_PROCESS_MAP.put(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(),
RESTART_PROCESS_MAP.put(ProjectStatus.SCHEME_REVIEW_FAILED.getCode(),
constructionPlanManage::restartTheProcess);
//预审方案
RESTART_PROCESS_MAP.put(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(),
RESTART_PROCESS_MAP.put(ProjectStatus.PREQUALIFICATION_FAILED.getCode(),
prequalificationDeclaredProjectManage::restartTheProcess);
//省级联审
RESTART_PROCESS_MAP.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(),
RESTART_PROCESS_MAP.put(ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(),
provincialDeptManage::restartTheProcess);
// 立项备案重新提交
RESTART_PROCESS_MAP.put(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(),
RESTART_PROCESS_MAP.put(ProjectStatus.DECLARED_APPROVED_RECORD_FAILED.getCode(),
declaredRecordManage::restartDeclaredRecord);
}



+ 4
- 5
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/FinalInspectionHandle.java View File

@@ -6,9 +6,8 @@ import com.hz.pm.api.projectdeclared.service.IPurchaseInstService;
import com.hz.pm.api.projectlib.handle.AbstractProcessHandle;
import com.hz.pm.api.projectlib.handle.HandleParamContext;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import com.hz.pm.api.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessInfoVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
@@ -53,9 +52,9 @@ public class FinalInspectionHandle extends AbstractProcessHandle {
} else {
List<Purchase> purchases = ctx.getPurchases();
Map<Long, Purchase> purchaseMap = purchases.stream()
.filter(w -> TenderStatusEnum.FINALLY_INSPECTED_FAILED.eq(w.getStatus())
|| TenderStatusEnum.FINALLY_INSPECTED_PASSED.eq(w.getStatus())
|| TenderStatusEnum.ON_FINALLY_INSPECTED_APPLY.eq(w.getStatus()))
.filter(w -> TenderStatus.FINALLY_INSPECTED_FAILED.eq(w.getStatus())
|| TenderStatus.FINALLY_INSPECTED_PASSED.eq(w.getStatus())
|| TenderStatus.ON_FINALLY_INSPECTED_APPLY.eq(w.getStatus()))
.collect(Collectors.toMap(Purchase::getId, Function.identity()));
StepStatusEnum stepStatus;
if (purchaseMap.isEmpty()) {


+ 4
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectAdaptionHandle.java View File

@@ -5,7 +5,7 @@ import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst;
import com.hz.pm.api.projectlib.handle.AbstractProcessHandle;
import com.hz.pm.api.projectlib.handle.HandleParamContext;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderAdaptStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderAdaptStatus;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessInfoVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
@@ -41,9 +41,9 @@ public class ProjectAdaptionHandle extends AbstractProcessHandle {
}
List<Purchase> purchases = ctx.getPurchases();
Map<Long, Purchase> purchaseMap = purchases.stream()
.filter(w -> TenderAdaptStatusEnum.ADAPT_INFO_PASSED.eq(w.getAdaptStatus())
|| TenderAdaptStatusEnum.ADAPT_INFO_FAILED.eq(w.getAdaptStatus())
|| TenderAdaptStatusEnum.ADAPT_INFO_AUDIT.eq(w.getAdaptStatus()))
.filter(w -> TenderAdaptStatus.ADAPT_INFO_PASSED.eq(w.getAdaptStatus())
|| TenderAdaptStatus.ADAPT_INFO_FAILED.eq(w.getAdaptStatus())
|| TenderAdaptStatus.ADAPT_INFO_AUDIT.eq(w.getAdaptStatus()))
.collect(Collectors.toMap(Purchase::getId, Function.identity()));
if (purchaseMap.isEmpty()) {
return;


+ 6
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectApprovalHandle.java View File

@@ -9,7 +9,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.projectlib.service.IProjectStatusChangeService;
@@ -53,15 +53,15 @@ public class ProjectApprovalHandle extends AbstractProcessHandle {
Project project = ctx.getProject();
Integer status = project.getStatus();
// 项目状态为待立项批复之前的状态
if (status == null || (status < ProjectStatusEnum.TO_BE_APPROVED.getCode()
&& status < ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode())) {
if (status == null || (status < ProjectStatus.TO_BE_APPROVED.getCode()
&& status < ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.getCode())) {
detail.setStepStatus(StepStatusEnum.NOT_START);
} else {
List<Long> projectIds = projectService.allVersionProjectIds(project.getProjectCode());
// 当前项目状态为待立项批复
if (ProjectStatusEnum.TO_BE_APPROVED.eq(status)
|| ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.eq(status)
|| ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.eq(status)) {
if (ProjectStatus.TO_BE_APPROVED.eq(status)
|| ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.eq(status)
|| ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING.eq(status)) {
// 根据建设方案评审通过的时间获取
final List<ProjectStateChangeEvent> events = Arrays.asList(ProjectStateChangeEvent.PLAN_REVIEW_PASS,
ProjectStateChangeEvent.DECLARED_RECORD_SUBMIT,


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectPurchaseHandle.java View File

@@ -19,8 +19,8 @@ import org.springframework.stereotype.Component;

import java.util.List;

import static com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum.ON_PURCHASING;
import static com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum.TO_BE_PURCHASED;
import static com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus.ON_PURCHASING;
import static com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus.TO_BE_PURCHASED;

/**
* 招标采购处理


+ 1
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectSelfTestHandle.java View File

@@ -2,12 +2,9 @@ package com.hz.pm.api.projectlib.handle.stage;

import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst;
import com.hz.pm.api.projectdeclared.service.IPurchaseInstService;
import com.hz.pm.api.projectlib.handle.AbstractProcessHandle;
import com.hz.pm.api.projectlib.handle.HandleParamContext;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessInfoVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
@@ -22,7 +19,7 @@ import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

import static com.hz.pm.api.projectlib.model.enumeration.TenderSelfTestStatusEnum.*;
import static com.hz.pm.api.projectlib.model.enumeration.status.TenderSelfTestStatus.*;

/**
* <p>


+ 1
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectTestValidHandle.java View File

@@ -2,12 +2,9 @@ package com.hz.pm.api.projectlib.handle.stage;

import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst;
import com.hz.pm.api.projectdeclared.service.IPurchaseInstService;
import com.hz.pm.api.projectlib.handle.AbstractProcessHandle;
import com.hz.pm.api.projectlib.handle.HandleParamContext;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessInfoVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
@@ -22,7 +19,7 @@ import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

import static com.hz.pm.api.projectlib.model.enumeration.TenderTestValidStatusEnum.*;
import static com.hz.pm.api.projectlib.model.enumeration.status.TenderTestValidStatus.*;

/**
* <p>


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/XcfhxReviewHandle.java View File

@@ -19,7 +19,7 @@ import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

import static com.hz.pm.api.projectlib.model.enumeration.TenderXcfhxApplyStatusEnum.*;
import static com.hz.pm.api.projectlib.model.enumeration.status.TenderXcfhxApplyStatus.*;

/**
* <p>


+ 6
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AnnualPlanLibManage.java View File

@@ -30,7 +30,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.hz.pm.api.projectlib.model.enumeration.ProjectLibFlagEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectRenewalApprovalStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.req.ProjectApprovedReq;
import com.hz.pm.api.projectlib.model.req.ProjectIdReq;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
@@ -64,7 +64,7 @@ import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

import static com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum.*;
import static com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus.*;

/**
* <p>
@@ -89,7 +89,7 @@ public class AnnualPlanLibManage {
/**
* 年度计划查询状态
*/
private static final List<ProjectStatusEnum> ANNUAL_PLAN_LIST_STATUS =
private static final List<ProjectStatus> ANNUAL_PLAN_LIST_STATUS =
Arrays.asList(IN_THE_ANNUAL_PLAN, SCHEME_UNDER_REVIEW, SCHEME_REVIEW_FAILED, TO_BE_APPROVED, TO_BE_DECLARED,
PLAN_TO_BE_DECLARED, PENDING_PREQUALIFICATION_CHOICE, PROJECT_APPROVED, TO_BE_PURCHASED, UNDER_CONSTRUCTION,
ON_PILOT_RUNNING, ARCHIVED);
@@ -103,7 +103,7 @@ public class AnnualPlanLibManage {
query.eq(Project::getIsTemporaryAugment, isTemporaryAugment);
query.eq(Project::getNewest, Boolean.TRUE);
query.orderByDesc(Project::getAnnualPlanAddTime);
query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatusEnum::getCode));
query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatus::getCode));
// 数据权限
if (!buildProjectLibPermission(query)) {
return PageVo.empty();
@@ -211,7 +211,7 @@ public class AnnualPlanLibManage {
throw new BizException("请传入是否临时增补标志!");
}
param.setIsTemporaryAugment(isTemporaryAugment);
param.setStatusList(CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatusEnum::getCode));
param.setStatusList(CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatus::getCode));
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param);
query.eq(Project::getNewest, Boolean.TRUE);
query.orderByDesc(Project::getAnnualPlanAddTime);
@@ -388,7 +388,7 @@ public class AnnualPlanLibManage {
query.eq(Project::getNewest, Boolean.TRUE);
query.eq(Project::getIsTemporaryAugment, isTemporaryAugment);
query.orderByDesc(Project::getAnnualPlanAddTime);
query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatusEnum::getCode));
query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatus::getCode));
// 数据权限
if (!buildProjectLibPermission(query)) {
throw BizException.wrap("暂无年度计划导出权限");


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java View File

@@ -13,7 +13,7 @@ import com.hz.pm.api.common.util.HmacAuthUtil;
import com.hz.pm.api.projectlib.model.dto.ApplicationAppCodeSaveDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO;
import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO;
@@ -144,8 +144,8 @@ public class ApplicationManage {
//建设单位 就是当前人的单位
Page<Project> page = req.page();
projectService.page(page, Wrappers.lambdaQuery(Project.class)
.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatusEnum.TO_BE_APP_REGISTER.getCode())
.eq(Project::getStage, ProjectStatus.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatus.TO_BE_APP_REGISTER.getCode())
.eq(Project::getBuildOrgCode, user.getMhUnitIdStr()));
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();


+ 18
- 18
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java View File

@@ -37,7 +37,7 @@ import com.hz.pm.api.projectlib.model.entity.MhProjectSchemaTargetData;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.GovSystemReplaceTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.req.DeclaredProjectListReq;
import com.hz.pm.api.projectlib.model.vo.DeclaredProjectListVO;
import com.hz.pm.api.projectlib.model.vo.MhProjectBaseInfoVO;
@@ -206,9 +206,9 @@ public class DeclaredRecordManage {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
// 查询审核中、失败、待立项备案的项目信息
LambdaQueryWrapper<Project> pQuery = Wrappers.lambdaQuery(Project.class)
.in(Project::getStatus, ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(),
ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode(),
ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.getCode())
.in(Project::getStatus, ProjectStatus.DECLARED_APPROVED_RECORD_FAILED.getCode(),
ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.getCode(),
ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING.getCode())
.select(Project::getId, Project::getProjectCode, Project::getStage, Project::getStatus, Project::getCreateOn);
if (!buildProjectLibPermission(pQuery, user)) {
return PageVo.empty();
@@ -231,8 +231,8 @@ public class DeclaredRecordManage {
item.setMhProjectId(w.getId());
Project project = projectMap.get(w.getProjectCode());
if (project == null) {
item.setStatus(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode());
item.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
item.setStatus(ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.getCode());
item.setStage(ProjectStatus.NOT_APPROVED.getCode());
} else {
item.setStatus(project.getStatus());
item.setStage(project.getStage());
@@ -325,10 +325,10 @@ public class DeclaredRecordManage {
// 如果是重新提交的话 判断下 项目是否存在
// 保存项目相关
Project newProj = projectLibManage.saveProjectInDeclared(projectInfo, instanceId, user.getUserId(),
ProjectStatusEnum.NOT_APPROVED, ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING,
ProjectStatus.NOT_APPROVED, ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING,
ProjectProcessStageEnum.PROJECT_RECORD_APPROVAL_PROCESS);
// 保存状态变更
saveProjectStatusChangeLog(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD,
saveProjectStatusChangeLog(ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD,
newProj, ProjectStateChangeEvent.DECLARED_RECORD_SUBMIT);
if (Objects.nonNull(projectInfo.getDraftId())) {
//如果是草稿箱提交 删除对应的草稿箱
@@ -387,8 +387,8 @@ public class DeclaredRecordManage {
}

//首先要判断 项目当前状态 是不是 单位内部拒绝
VUtils.isTrue(!ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.eq(oldProj.getStatus()) ||
!ProjectStatusEnum.NOT_APPROVED.eq(oldProj.getStage()))
VUtils.isTrue(!ProjectStatus.DECLARED_APPROVED_RECORD_FAILED.eq(oldProj.getStatus()) ||
!ProjectStatus.NOT_APPROVED.eq(oldProj.getStage()))
.throwMessage("提交失败,该项目不是立项备案审核不通过状态或者未立项阶段");

ProcessStartParamsVo params = new ProcessStartParamsVo();
@@ -407,11 +407,11 @@ public class DeclaredRecordManage {

//保存项目相关
Project newProj = projectLibManage.saveProjectInDeclared(reqProj, instId, user.getUserId(),
ProjectStatusEnum.NOT_APPROVED,
ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING,
ProjectStatus.NOT_APPROVED,
ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING,
instType);
// 保存状态变更
saveProjectStatusChangeLog(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED,
saveProjectStatusChangeLog(ProjectStatus.DECLARED_APPROVED_RECORD_FAILED,
newProj, ProjectStateChangeEvent.DECLARED_RECORD_RESUBMIT);
//发送给第一个审批人消息
noticeManage.sendFirstUser(newProj, model.getFormName(), instId,
@@ -420,7 +420,7 @@ public class DeclaredRecordManage {
return instId;
}

private void saveProjectStatusChangeLog(ProjectStatusEnum beforeStatus, Project project, ProjectStateChangeEvent event) {
private void saveProjectStatusChangeLog(ProjectStatus beforeStatus, Project project, ProjectStateChangeEvent event) {
ProjectStatusChange change = new ProjectStatusChange();
change.setAfterStatus(project.getStatus());
change.setProjectId(project.getId());
@@ -451,8 +451,8 @@ public class DeclaredRecordManage {
project.setUnitStrip(mhProject.getUnitStrip());
project.setVersion(0);
project.setNewest(Boolean.TRUE);
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode());
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.getCode());
project.setStage(ProjectStatus.NOT_APPROVED.getCode());
ProjectDTO tmpProject = BeanUtil.copyProperties(project, ProjectDTO.class);
String projectCode = projectCodeGenUtil.generateProjectCode(tmpProject);
project.setProjectCode(projectCode);
@@ -510,8 +510,8 @@ public class DeclaredRecordManage {
project.setProjectCode(mhProject.getProjectCode());
project.setNewest(Boolean.TRUE);
project.setVersion(1);
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode());
project.setStage(ProjectStatus.NOT_APPROVED.getCode());
project.setStatus(ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.getCode());
project.setCreateOn(now);
project.setUpdateOn(now);
project.setUnitStrip(mhProject.getUnitStrip());


+ 16
- 16
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java View File

@@ -62,8 +62,8 @@ import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO;
import com.hz.pm.api.projectlib.model.entity.*;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectRenewalApprovalStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderStatus;
import com.hz.pm.api.projectlib.model.po.ProjectPO;
import com.hz.pm.api.projectlib.model.req.ProjectApplicationListReq;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
@@ -244,7 +244,7 @@ public class ProjectLibManage {
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
if (finalUser.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.eq(item.getStatus())
if (finalUser.getIsOrgAdmin() && ProjectStatus.PENDING_PREQUALIFICATION.eq(item.getStatus())
&& StringUtils.isNotBlank(w.getSuperOrgCode())
&& w.getSuperOrgCode().equals(finalUser.getMhUnitIdStr())) {
item.setCanPreDeclared(Boolean.TRUE);
@@ -323,7 +323,7 @@ public class ProjectLibManage {
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
item.setApproveUsers(buildApproveUsers(w.getInstCode(), map, userMap));
if (user.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.eq(item.getStatus())
if (user.getIsOrgAdmin() && ProjectStatus.PENDING_PREQUALIFICATION.eq(item.getStatus())
&& StringUtils.isNotBlank(w.getSuperOrgCode())
&& w.getSuperOrgCode().equals(user.getMhUnitIdStr())) {
item.setCanPreDeclared(Boolean.TRUE);
@@ -426,7 +426,7 @@ public class ProjectLibManage {
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
if (user.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.eq(item.getStatus())
if (user.getIsOrgAdmin() && ProjectStatus.PENDING_PREQUALIFICATION.eq(item.getStatus())
&& StringUtils.isNotBlank(w.getSuperOrgCode())
&& w.getSuperOrgCode().equals(user.getMhUnitIdStr())) {
item.setCanPreDeclared(Boolean.TRUE);
@@ -482,7 +482,7 @@ public class ProjectLibManage {
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
if (user.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.eq(item.getStatus())
if (user.getIsOrgAdmin() && ProjectStatus.PENDING_PREQUALIFICATION.eq(item.getStatus())
&& StringUtils.isNotBlank(w.getSuperOrgCode())
&& w.getSuperOrgCode().equals(user.getMhUnitIdStr())) {
item.setCanPreDeclared(Boolean.TRUE);
@@ -575,7 +575,7 @@ public class ProjectLibManage {
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
item.setApproveUsers(buildApproveUsers(w.getInstCode(), map, userMap));
if (user.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.eq(item.getStatus())
if (user.getIsOrgAdmin() && ProjectStatus.PENDING_PREQUALIFICATION.eq(item.getStatus())
&& StringUtils.isNotBlank(w.getSuperOrgCode())
&& w.getSuperOrgCode().equals(user.getMhUnitIdStr())) {
item.setCanPreDeclared(Boolean.TRUE);
@@ -734,7 +734,7 @@ public class ProjectLibManage {
if (!purchases.isEmpty()) {
Map<Long, PurchaseVO> purchaseMap = CollUtils.listToMap(purchases, Purchase::getId, w -> {
PurchaseVO purchase = BeanUtil.copyProperties(w, PurchaseVO.class);
purchase.setStatusName(TenderStatusEnum.getDescByStatus(w.getStatus()));
purchase.setStatusName(TenderStatus.getDescByStatus(w.getStatus()));
return purchase;
});
//查询合同备案
@@ -840,7 +840,7 @@ public class ProjectLibManage {
* @return \
*/
public Project saveProjectInDeclared(ProjectDTO projectDto, String instanceId, Long userId,
ProjectStatusEnum stage, ProjectStatusEnum status,
ProjectStatus stage, ProjectStatus status,
ProjectProcessStageEnum processStage) {
Project project = saveProjectNewVersion(projectDto, instanceId, userId, Boolean.FALSE, stage, status);
//保存项目和实例的关系
@@ -891,13 +891,13 @@ public class ProjectLibManage {
public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId,
Long userId, Boolean isContruct) {
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示
return saveProjectNewVersion(projectDto, instanceId, userId, isContruct, ProjectStatusEnum.NOT_APPROVED, ProjectStatusEnum.UNDER_INTERNAL_AUDIT);
return saveProjectNewVersion(projectDto, instanceId, userId, isContruct, ProjectStatus.NOT_APPROVED, ProjectStatus.UNDER_INTERNAL_AUDIT);
}

public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId,
Long userId, Boolean isConstruct,
ProjectStatusEnum stage,
ProjectStatusEnum status) {
ProjectStatus stage,
ProjectStatus status) {
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示
try {
Project project;
@@ -971,8 +971,8 @@ public class ProjectLibManage {
project.setId(null);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
project.setStage(ProjectStatus.NOT_APPROVED.getCode());
project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode());
project.setInstCode(instanceId);
project.setSponsor(String.valueOf(userId));
// 项目编号不变,版本号加1
@@ -1328,8 +1328,8 @@ public class ProjectLibManage {
List<String> viewUnitIdList = CollUtils.convert(childUnitIds, String::valueOf);
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目
query.and(q1 -> q1.in(Project::getBuildOrgCode, viewUnitIdList)
.or(q2 -> q2.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode())
.or(q2 -> q2.eq(Project::getStage, ProjectStatus.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatus.PENDING_PREQUALIFICATION.getCode())
.in(Project::getSuperOrgCode, viewUnitIdList)));
break;
case SUPER_ADMIN:


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java View File

@@ -32,7 +32,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.hz.pm.api.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.hz.pm.api.projectlib.model.enumeration.ProjectRenewalApprovalStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.po.ProjectRenewalFundDeclarationPO;
import com.hz.pm.api.projectlib.model.req.ProjectRenewalAuditReq;
@@ -127,7 +127,7 @@ public class ProjectRenewalFundManage {
//自己单位
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
//立项批复后 都可以
query.gt(Project::getStatus, ProjectStatusEnum.APPROVED_AFTER_CHOICE.getCode());
query.gt(Project::getStatus, ProjectStatus.APPROVED_AFTER_CHOICE.getCode());
Page<Project> page = projectService.page(req.page(), query);
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
@@ -175,7 +175,7 @@ public class ProjectRenewalFundManage {
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
if (user.getIsOrgAdmin() &&
ProjectStatusEnum.PENDING_PREQUALIFICATION.eq(item.getStatus())
ProjectStatus.PENDING_PREQUALIFICATION.eq(item.getStatus())
&& StringUtils.isNotBlank(w.getSuperOrgCode())
&& w.getSuperOrgCode().equals(user.getMhUnitIdStr())) {
item.setCanPreDeclared(Boolean.TRUE);


+ 0
- 52
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderStatusEnum.java View File

@@ -1,52 +0,0 @@
package com.hz.pm.api.projectlib.model.enumeration;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
* <p>
* 标段状态
* </p>
*
* @author WendyYang
* @since 15:49 2024/2/23
*/
@Getter
@AllArgsConstructor
public enum TenderStatusEnum {

TO_BE_SUBMIT_PURCHASE_INFO(ProjectStatusEnum.ON_PURCHASING, 101, "待填写采购信息"),
TO_BE_SUBMIT_CONSTRUCTION_INFO(ProjectStatusEnum.ON_PURCHASING, 102, "待填写合同信息"),
TO_BE_SUBMIT_OPERATION_PLAN(ProjectStatusEnum.ON_PURCHASING, 103, "待填写实施计划"),
TO_BE_SUBMIT_FIRST_INSPECTED_INFO(ProjectStatusEnum.TO_BE_FIRST_INSPECTED, 201, "待上传初验材料"),
TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY(ProjectStatusEnum.ON_PILOT_RUNNING, 401, "待终验申报"),
ON_FINALLY_INSPECTED_APPLY(ProjectStatusEnum.ON_FINALLY_INSPECTED, 501, "终验申报中"),
FINALLY_INSPECTED_FAILED(ProjectStatusEnum.ON_FINALLY_INSPECTED, 502, "终验申报不通过"),
FINALLY_INSPECTED_PASSED(ProjectStatusEnum.ACCEPTED, 601, "终验完成");

private final ProjectStatusEnum projectStatus;
private final Integer tenderStatus;
private final String desc;

public boolean eq(Integer tenderStatus) {
return this.getTenderStatus().equals(tenderStatus);
}

public static TenderStatusEnum getByStatus(Integer tenderStatus) {
return Arrays.stream(values())
.filter(w -> w.eq(tenderStatus))
.findFirst()
.orElse(null);
}

public static String getDescByStatus(Integer tenderStatus) {
return Optional.ofNullable(getByStatus(tenderStatus))
.flatMap(w -> Optional.of(w.getDesc()))
.orElse(StrUtil.EMPTY);
}

}

+ 6
- 5
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/WarningFlowTypeEnum.java View File

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectlib.model.enumeration;

import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -20,11 +21,11 @@ public enum WarningFlowTypeEnum {
/**
* 预警填报类型枚举
*/
UNIT_INNER_AUDIT(1, "预审申报",ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode(),"declareManage/planDeclaration/preExaminationDeclare"),
PRELIMINARY_PREVIEW(2, "建设方案申报",ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode(),"declareManage/constructionPlanDeclare"),
DEPT_UNITED_REVIEW(3,"采购结果备案",ProjectStatusEnum.TO_BE_PURCHASED.getCode(),"declareManage/procurementRecord/purchaseResults"),
CONSTRUCTION_PLAN_REVIEW(4,"初验备案",ProjectStatusEnum.UNDER_CONSTRUCTION.getCode(),"declareManage/acceptanceApply/initialInspectionRecord"),
PROJECT_FINAL_INSPECTION(5,"验收申报",ProjectStatusEnum.ON_PILOT_RUNNING.getCode(),"declareManage/acceptanceApply/finalInspectionDeclare");
UNIT_INNER_AUDIT(1, "预审申报", ProjectStatus.PENDING_PREQUALIFICATION.getCode(),"declareManage/planDeclaration/preExaminationDeclare"),
PRELIMINARY_PREVIEW(2, "建设方案申报", ProjectStatus.PLAN_TO_BE_DECLARED.getCode(),"declareManage/constructionPlanDeclare"),
DEPT_UNITED_REVIEW(3,"采购结果备案", ProjectStatus.TO_BE_PURCHASED.getCode(),"declareManage/procurementRecord/purchaseResults"),
CONSTRUCTION_PLAN_REVIEW(4,"初验备案", ProjectStatus.UNDER_CONSTRUCTION.getCode(),"declareManage/acceptanceApply/initialInspectionRecord"),
PROJECT_FINAL_INSPECTION(5,"验收申报", ProjectStatus.ON_PILOT_RUNNING.getCode(),"declareManage/acceptanceApply/finalInspectionDeclare");

private Integer code;
private String desc;


+ 3
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/WarningOperationTypeEnum.java View File

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectlib.model.enumeration;

import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -20,8 +21,8 @@ public enum WarningOperationTypeEnum {
/**
* 预警实施类型枚举
*/
CHUYAN(1, "项目初验", ProjectStatusEnum.UNDER_CONSTRUCTION.getCode(), "declareManage/acceptanceApply/initialInspectionRecord"),
ZHONGYAN(2, "项目终验", ProjectStatusEnum.ON_PILOT_RUNNING.getCode(), "declareManage/acceptanceApply/finalInspectionDeclare");
CHUYAN(1, "项目初验", ProjectStatus.UNDER_CONSTRUCTION.getCode(), "declareManage/acceptanceApply/initialInspectionRecord"),
ZHONGYAN(2, "项目终验", ProjectStatus.ON_PILOT_RUNNING.getCode(), "declareManage/acceptanceApply/finalInspectionDeclare");

private Integer code;
private String desc;


+ 21
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/IStatus.java View File

@@ -0,0 +1,21 @@
package com.hz.pm.api.projectlib.model.enumeration.status;

/**
* <p>
* IStatus
* </p>
*
* @author WendyYang
* @since 10:25 2024/4/12
*/
public interface IStatus<C, D> {

C getCode();

D getDesc();

default boolean eq(C code) {
return this.getCode().equals(code);
}

}

hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/ProjectStatusEnum.java → hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java View File

@@ -1,12 +1,15 @@
package com.hz.pm.api.projectlib.model.enumeration;
package com.hz.pm.api.projectlib.model.enumeration.status;

import cn.hutool.core.util.StrUtil;
import com.hz.pm.api.gov.enumeration.GovProjectStatusEnum;
import com.ningdatech.basic.exception.BizException;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;

/**
* <p>
@@ -18,8 +21,7 @@ import java.util.Objects;
*/
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ProjectStatusEnum {
public enum ProjectStatus implements IStatus<Integer, String> {
/**
* 项目阶段:未立项
*/
@@ -59,7 +61,7 @@ public enum ProjectStatusEnum {
TO_BE_PURCHASED(20001, "待采购", GovProjectStatusEnum.APPROVED),
ON_PURCHASING(20007, "采购中", GovProjectStatusEnum.APPROVED),
UNDER_CONSTRUCTION(20002, "建设中", null),
TO_BE_FIRST_INSPECTED(20008, "待初验", null),
TO_BE_FIRST_INSPECTED(20008, "待上传初验材料", null),
ON_PILOT_RUNNING(20009, "试运行中", null),
ON_FINALLY_INSPECTED(20004, "终验审核中", null),
FINALLY_INSPECTED_FAILED(20005, "终验审核不通过", null),
@@ -69,37 +71,20 @@ public enum ProjectStatusEnum {
ARCHIVED(30000, "已归档", null),
ACCEPTED(30001, "已验收", GovProjectStatusEnum.HAS_FINAL_INS);

private Integer code;
private String desc;

private GovProjectStatusEnum collectionStatus;
private final Integer code;
private final String desc;
private final GovProjectStatusEnum collectStatus;

public static String getDesc(Integer code) {
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
}
for (ProjectStatusEnum t : ProjectStatusEnum.values()) {
if (code.equals(t.getCode())) {
return t.desc;
}
}
return StringUtils.EMPTY;
return get(code).flatMap(w -> Optional.of(w.getDesc())).orElse(StrUtil.EMPTY);
}

public static ProjectStatusEnum match(Integer code) {
if (Objects.isNull(code)) {
return null;
}
for (ProjectStatusEnum t : ProjectStatusEnum.values()) {
if (code.equals(t.getCode())) {
return t;
}
}
return null;
public static Optional<ProjectStatus> get(Integer code) {
return Arrays.stream(values()).filter(w -> w.getCode().equals(code)).findFirst();
}

public boolean eq(Integer code) {
return this.getCode().equals(code);
public static ProjectStatus getNoNull(Integer code) {
return get(code).orElseThrow(() -> BizException.wrap("项目状态无效:%s", code));
}

}

hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderAdaptStatusEnum.java → hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderAdaptStatus.java View File

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectlib.model.enumeration;
package com.hz.pm.api.projectlib.model.enumeration.status;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

@@ -16,7 +17,7 @@ import java.util.Optional;
*/
@Getter
@AllArgsConstructor
public enum TenderAdaptStatusEnum {
public enum TenderAdaptStatus implements IStatus<Integer, String> {

WITHOUT_ADAPT_INFO(2100, "待填写适配改造信息"),
ADAPT_INFO_AUDIT(2101, "适配改造信息审核中"),
@@ -24,20 +25,14 @@ public enum TenderAdaptStatusEnum {
ADAPT_INFO_PASSED(2103, "适配改造信息审核通过");

private final Integer code;
private final String val;
private final String desc;

public boolean eq(Integer code) {
return this.code.equals(code);
public static Optional<TenderAdaptStatus> get(Integer code) {
return Arrays.stream(values()).filter(w -> w.eq(code)).findFirst();
}

public static Optional<TenderAdaptStatusEnum> get(Integer code) {
return Arrays.stream(values())
.filter(w -> w.getCode().equals(code))
.findFirst();
}

public static String getVal(Integer code) {
return get(code).flatMap(w -> Optional.of(w.getVal())).orElse("");
public static String getDesc(Integer code) {
return get(code).flatMap(w -> Optional.of(w.getDesc())).orElse(StrUtil.EMPTY);
}

}

hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderSelfTestStatusEnum.java → hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderSelfTestStatus.java View File

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectlib.model.enumeration;
package com.hz.pm.api.projectlib.model.enumeration.status;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

@@ -16,7 +17,7 @@ import java.util.Optional;
*/
@Getter
@AllArgsConstructor
public enum TenderSelfTestStatusEnum {
public enum TenderSelfTestStatus implements IStatus<Integer, String> {

WITHOUT_SELF_TEST_INFO(1100, "待填写系统自测信息"),
SELF_TEST_INFO_AUDIT(1101, "系统自测信息审核中"),
@@ -24,20 +25,16 @@ public enum TenderSelfTestStatusEnum {
SELF_TEST_INFO_PASSED(1103, "系统自测信息审核通过");

private final Integer code;
private final String val;
private final String desc;

public boolean eq(Integer code) {
return this.code.equals(code);
}

public static Optional<TenderSelfTestStatusEnum> get(Integer code) {
public static Optional<TenderSelfTestStatus> get(Integer code) {
return Arrays.stream(values())
.filter(w -> w.getCode().equals(code))
.filter(w -> w.eq(code))
.findFirst();
}

public static String getVal(Integer code) {
return get(code).flatMap(w -> Optional.of(w.getVal())).orElse("");
public static String getDesc(Integer code) {
return get(code).flatMap(w -> Optional.of(w.getDesc())).orElse(StrUtil.EMPTY);
}

}

+ 49
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderStatus.java View File

@@ -0,0 +1,49 @@
package com.hz.pm.api.projectlib.model.enumeration.status;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
* <p>
* 标段状态
* </p>
*
* @author WendyYang
* @since 15:49 2024/2/23
*/
@Getter
@AllArgsConstructor
public enum TenderStatus implements IStatus<Integer, String> {

TO_BE_SUBMIT_PURCHASE_INFO(ProjectStatus.ON_PURCHASING, 101, "待填写采购信息"),
TO_BE_SUBMIT_CONSTRUCTION_INFO(ProjectStatus.ON_PURCHASING, 102, "待填写合同信息"),
TO_BE_SUBMIT_OPERATION_PLAN(ProjectStatus.ON_PURCHASING, 103, "待填写实施计划"),
TO_BE_SUBMIT_FIRST_INSPECTED_INFO(ProjectStatus.TO_BE_FIRST_INSPECTED, 201, "待上传初验材料"),
TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY(ProjectStatus.ON_PILOT_RUNNING, 401, "待终验申报"),
ON_FINALLY_INSPECTED_APPLY(ProjectStatus.ON_FINALLY_INSPECTED, 501, "终验申报中"),
FINALLY_INSPECTED_FAILED(ProjectStatus.ON_FINALLY_INSPECTED, 502, "终验申报不通过"),
FINALLY_INSPECTED_PASSED(ProjectStatus.ACCEPTED, 601, "终验完成");

private final ProjectStatus projectStatus;
private final Integer code;
private final String desc;


public static TenderStatus getByStatus(Integer tenderStatus) {
return Arrays.stream(values())
.filter(w -> w.eq(tenderStatus))
.findFirst()
.orElse(null);
}

public static String getDescByStatus(Integer tenderStatus) {
return Optional.ofNullable(getByStatus(tenderStatus))
.flatMap(w -> Optional.of(w.getDesc()))
.orElse(StrUtil.EMPTY);
}

}

hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderTestValidStatusEnum.java → hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderTestValidStatus.java View File

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectlib.model.enumeration;
package com.hz.pm.api.projectlib.model.enumeration.status;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

@@ -16,7 +17,7 @@ import java.util.Optional;
*/
@Getter
@AllArgsConstructor
public enum TenderTestValidStatusEnum {
public enum TenderTestValidStatus implements IStatus<Integer, String> {

WITHOUT_TEST_VALID_INFO(3100, "待填写测试验证信息"),
TEST_VALID_INFO_AUDIT(3101, "测试验证信息审核中"),
@@ -24,20 +25,14 @@ public enum TenderTestValidStatusEnum {
TEST_VALID_INFO_PASSED(3103, "测试验证信息审核通过");

private final Integer code;
private final String val;
private final String desc;

public boolean eq(Integer code) {
return this.code.equals(code);
public static Optional<TenderTestValidStatus> get(Integer code) {
return Arrays.stream(values()).filter(w -> w.eq(code)).findFirst();
}

public static Optional<TenderTestValidStatusEnum> get(Integer code) {
return Arrays.stream(values())
.filter(w -> w.getCode().equals(code))
.findFirst();
}

public static String getVal(Integer code) {
return get(code).flatMap(w -> Optional.of(w.getVal())).orElse("");
public static String getDesc(Integer code) {
return get(code).flatMap(w -> Optional.of(w.getDesc())).orElse(StrUtil.EMPTY);
}

}

hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/TenderXcfhxApplyStatusEnum.java → hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderXcfhxApplyStatus.java View File

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectlib.model.enumeration;
package com.hz.pm.api.projectlib.model.enumeration.status;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

@@ -16,7 +17,7 @@ import java.util.Optional;
*/
@Getter
@AllArgsConstructor
public enum TenderXcfhxApplyStatusEnum {
public enum TenderXcfhxApplyStatus implements IStatus<Integer, String> {

TO_BE_SUBMIT_XCFHX_APPLY(301, "待信创符合性申请"),
ON_XCFHX_APPLY(302, "信创符合性申请中"),
@@ -24,20 +25,14 @@ public enum TenderXcfhxApplyStatusEnum {
XCFHX_APPLY_PASSED(304, "信创符合性申请不通过");

private final Integer code;
private final String val;
private final String desc;

public boolean eq(Integer code) {
return this.code.equals(code);
public static Optional<TenderXcfhxApplyStatus> get(Integer code) {
return Arrays.stream(values()).filter(w -> w.eq(code)).findFirst();
}

public static Optional<TenderXcfhxApplyStatusEnum> get(Integer code) {
return Arrays.stream(values())
.filter(w -> w.getCode().equals(code))
.findFirst();
}

public static String getVal(Integer code) {
return get(code).flatMap(w -> Optional.of(w.getVal())).orElse("");
public static String getDesc(Integer code) {
return get(code).flatMap(w -> Optional.of(w.getDesc())).orElse(StrUtil.EMPTY);
}



+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java View File

@@ -9,7 +9,7 @@ import com.hz.pm.api.portrait.model.vo.TagVO;
import com.hz.pm.api.projectdeclared.model.vo.PurchaseFullInfoVO;
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO;
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.safety.model.vo.SafetyMonitorVO;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVO;
@@ -470,7 +470,7 @@ public class ProjectDetailVO {

public String getStageName() {
if (Objects.nonNull(this.stage)) {
return ProjectStatusEnum.getDesc(this.stage);
return ProjectStatus.getDesc(this.stage);
}
return StringUtils.EMPTY;
}
@@ -480,7 +480,7 @@ public class ProjectDetailVO {

public String getStatusName() {
if (Objects.nonNull(this.status)) {
return ProjectStatusEnum.getDesc(this.status);
return ProjectStatus.getDesc(this.status);
}
return StringUtils.EMPTY;
}


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/safety/model/vo/ProjectMonitorVO.java View File

@@ -1,6 +1,6 @@
package com.hz.pm.api.safety.model.vo;

import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -62,7 +62,7 @@ public class ProjectMonitorVO {
private String stageName;
public String getStageName(){
if(Objects.nonNull(this.stage)){
return ProjectStatusEnum.getDesc(this.stage);
return ProjectStatus.getDesc(this.stage);
}
return StringUtils.EMPTY;
}
@@ -71,7 +71,7 @@ public class ProjectMonitorVO {
private String statusName;
public String getStatusName(){
if(Objects.nonNull(this.status)){
return ProjectStatusEnum.getDesc(this.status);
return ProjectStatus.getDesc(this.status);
}
return StringUtils.EMPTY;
}


+ 3
- 2
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java View File

@@ -6,7 +6,7 @@ import com.google.common.collect.Sets;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.staging.enums.MsgTypeEnum;
@@ -37,6 +37,7 @@ import java.util.List;
import java.util.Objects;
import java.util.Set;

import static com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus.PRE_APPLYING;
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE;
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE2;

@@ -172,7 +173,7 @@ public class ProcessEndListener {
throw BizException.wrap("传入实例类型错误:%s ", instTypeEnum);
}
} else {
switch (Objects.requireNonNull(ProjectStatusEnum.match(project.getStatus()))) {
switch (ProjectStatus.getNoNull(project.getStatus())) {
// 当前项目状态是预审中
case PRE_APPLYING:
//先修改项目状态


+ 4
- 4
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/CheckProvincialReviewResultTask.java View File

@@ -8,7 +8,7 @@ import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.model.constant.ProjectDeclareConst;
import com.hz.pm.api.common.model.constant.RegionConst;
import com.hz.pm.api.common.statemachine.util.ProjectStateMachineUtil;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.provincial.model.res.ProcessCommentRes;
@@ -60,8 +60,8 @@ public class CheckProvincialReviewResultTask {
if (HOST_NAME.equals(InetAddress.getLocalHost().getHostName())) {
//1. 定时取 省级部门联审中的项目 去取项目
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode())
.eq(Project::getStage, ProjectStatus.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode())
.ge(Project::getDeclareAmount, ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)
.eq(Project::getAreaCode, RegionConst.RC_HZ)
.eq(Project::getNewest,Boolean.TRUE)
@@ -94,7 +94,7 @@ public class CheckProvincialReviewResultTask {
if(StringUtils.isNotBlank(lastProcessComment.getStepName()) &&
TaskContant.ProvinceReview.END_STEP.equals(lastProcessComment.getStepName())){
//在省级联审 才调状态机 否则 只改变 联审结果
if(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(
if(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(
project.getStatus())){
projectStateMachineUtil.pass(project);
}


+ 23
- 23
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/CockpitStatsStatisticsTask.java View File

@@ -30,7 +30,7 @@ import com.hz.pm.api.performance.service.IPerformanceAppraisalProjectService;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.model.dto.RegionDTO;
@@ -228,7 +228,7 @@ public class CockpitStatsStatisticsTask {
Integer overdueConstructionProjectsNum = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getPlanAcceptanceTime()) &&
p.getPlanAcceptanceTime().compareTo(LocalDateTime.now()) < 0 &&
Objects.nonNull(p.getStatus()) && p.getStatus().compareTo(ProjectStatusEnum.ACCEPTED.getCode()) < 0) {
Objects.nonNull(p.getStatus()) && p.getStatus().compareTo(ProjectStatus.ACCEPTED.getCode()) < 0) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -240,7 +240,7 @@ public class CockpitStatsStatisticsTask {
//1.3预审驳回项目
Integer preFailed = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().equals(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode())) {
p.getStatus().equals(ProjectStatus.PREQUALIFICATION_FAILED.getCode())) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -249,7 +249,7 @@ public class CockpitStatsStatisticsTask {

//1.4 建设方案评审失败
Integer constructionFailed = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) && p.getStatus().equals(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode())) {
if (Objects.nonNull(p.getStatus()) && p.getStatus().equals(ProjectStatus.SCHEME_REVIEW_FAILED.getCode())) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -434,7 +434,7 @@ public class CockpitStatsStatisticsTask {
// 项目归集:评审中、待立项、已立项、已采购、已初验、已终验项目总和)
Integer planProjectNum = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().compareTo(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()) >= 0) {
p.getStatus().compareTo(ProjectStatus.PENDING_PREQUALIFICATION.getCode()) >= 0) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -495,8 +495,8 @@ public class CockpitStatsStatisticsTask {
//3.4 在建项目数 采购备案后的项目
Integer constructionNum = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().compareTo(ProjectStatusEnum.TO_BE_PURCHASED.getCode()) >= 0
&& p.getStatus().compareTo(ProjectStatusEnum.ACCEPTED.getCode()) < 0) {
p.getStatus().compareTo(ProjectStatus.TO_BE_PURCHASED.getCode()) >= 0
&& p.getStatus().compareTo(ProjectStatus.ACCEPTED.getCode()) < 0) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -517,8 +517,8 @@ public class CockpitStatsStatisticsTask {
//5.1 计划(申报项目:项目预审完成到年度计划未完成 项目归集:评审中)
Integer inPlanNum = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().compareTo(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()) > 0 &&
p.getStatus().compareTo(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()) <= 0) {
p.getStatus().compareTo(ProjectStatus.PREQUALIFICATION_FAILED.getCode()) > 0 &&
p.getStatus().compareTo(ProjectStatus.IN_THE_ANNUAL_PLAN.getCode()) <= 0) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -535,8 +535,8 @@ public class CockpitStatsStatisticsTask {
//5.2 处于申报(申报项目:年度计划完成到建设方案审批第一个节点审批未通过前 项目归集:待立项)
Integer inApplyNum = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode().equals(p.getStatus()) ||
(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode().equals(p.getStatus()) &&
(ProjectStatus.PLAN_TO_BE_DECLARED.getCode().equals(p.getStatus()) ||
(ProjectStatus.SCHEME_UNDER_REVIEW.getCode().equals(p.getStatus()) &&
searchSchemaReviewFlow(p.getProjectCode())))) {
return Boolean.TRUE;
}
@@ -554,9 +554,9 @@ public class CockpitStatsStatisticsTask {
//5.3 处于审批 (申报项目:建设方案审批第一个节点审批通过到立项批复未完成 项目归集:已立项)
Integer inApproveNum = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
(ProjectStatusEnum.TO_BE_APPROVED.getCode().equals(p.getStatus()) ||
p.getStatus().compareTo(ProjectStatusEnum.APPROVED_AFTER_CHOICE.getCode()) > 0 ||
(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode().equals(p.getStatus()) &&
(ProjectStatus.TO_BE_APPROVED.getCode().equals(p.getStatus()) ||
p.getStatus().compareTo(ProjectStatus.APPROVED_AFTER_CHOICE.getCode()) > 0 ||
(ProjectStatus.SCHEME_UNDER_REVIEW.getCode().equals(p.getStatus()) &&
searchSchemaReviewedFlow(p.getProjectCode())))) {
return Boolean.TRUE;
}
@@ -574,10 +574,10 @@ public class CockpitStatsStatisticsTask {
//5.4 建设 (申报项目:立项批复完成到项目初验未完成 项目归集:已采购)
Integer inConstructionNum = (int) projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
(p.getStatus().compareTo(ProjectStatusEnum.APPROVED_AFTER_CHOICE.getCode()) > 0 &&
p.getStatus().compareTo(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) < 0) ||
(p.getStatus().compareTo(ProjectStatus.APPROVED_AFTER_CHOICE.getCode()) > 0 &&
p.getStatus().compareTo(ProjectStatus.UNDER_CONSTRUCTION.getCode()) < 0) ||
//如果在建设中 那么初验材料为空代表 初验未完成
(p.getStatus().equals(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) /*&&
(p.getStatus().equals(ProjectStatus.UNDER_CONSTRUCTION.getCode()) /*&&
StringUtils.isBlank(p.getPreliminaryInspectionMaterials())*/)) {
return Boolean.TRUE;
}
@@ -595,10 +595,10 @@ public class CockpitStatsStatisticsTask {
//5.5 验收 (申报项目:项目初验完成到项目终验未完成 项目归集:已初验)
List<Project> inAcceptProjects = projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().compareTo(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) > 0 &&
p.getStatus().compareTo(ProjectStatusEnum.ACCEPTED.getCode()) < 0 ||
p.getStatus().compareTo(ProjectStatus.UNDER_CONSTRUCTION.getCode()) > 0 &&
p.getStatus().compareTo(ProjectStatus.ACCEPTED.getCode()) < 0 ||
//如果在建设中 那么初验材料不为空代表 初验完成
(p.getStatus().equals(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) /*&&
(p.getStatus().equals(ProjectStatus.UNDER_CONSTRUCTION.getCode()) /*&&
StringUtils.isNotBlank(p.getPreliminaryInspectionMaterials())*/)) {
return Boolean.TRUE;
}
@@ -616,7 +616,7 @@ public class CockpitStatsStatisticsTask {
//5.6 运维(申报项目:项目验收完成后且项目未注销 项目归集:已终验)
List<Project> inOperationProjects = projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().equals(ProjectStatusEnum.ACCEPTED.getCode())) {
p.getStatus().equals(ProjectStatus.ACCEPTED.getCode())) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -650,7 +650,7 @@ public class CockpitStatsStatisticsTask {
//7.2驳回节约资金
List<Project> rejectPreProjects = projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().equals(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode())) {
p.getStatus().equals(ProjectStatus.PREQUALIFICATION_FAILED.getCode())) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -669,7 +669,7 @@ public class CockpitStatsStatisticsTask {
//首先完成年度计划 并且未注销的项目
List<Project> normalProjects = projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
p.getStatus().compareTo(ProjectStatusEnum.BE_SUSPENDED.getCode()) > 0) {
p.getStatus().compareTo(ProjectStatus.BE_SUSPENDED.getCode()) > 0) {
return Boolean.TRUE;
}
return Boolean.FALSE;


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/DeclaredRecordReminderTask.java View File

@@ -11,7 +11,7 @@ import com.hz.pm.api.external.model.dto.MhZwddWorkNoticeDTO;
import com.hz.pm.api.external.todo.MHTodoClient;
import com.hz.pm.api.external.todo.dto.MhTodoExtraParamDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IMhProjectService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.model.entity.MhTodoRecord;
@@ -83,7 +83,7 @@ public class DeclaredRecordReminderTask extends ReminderTask {
private void declaredRecordReminder() {
Wrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getStatus, ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode());
.eq(Project::getStatus, ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.getCode());
List<Project> projects = projectService.list(query);
if (projects.isEmpty()) {
return;


+ 3
- 4
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningInstanceNotStartTask.java View File

@@ -10,14 +10,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.util.StrUtils;
import com.hz.pm.api.projectdeclared.model.entity.Operation;
import com.hz.pm.api.projectdeclared.service.IContractService;
import com.hz.pm.api.projectdeclared.service.IOperationService;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.hz.pm.api.projectlib.model.enumeration.*;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectRenewalFundDeclarationService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.manage.EarlyWarningManage;
@@ -147,7 +146,7 @@ public class EarlyWarningInstanceNotStartTask {
List<Project> needToWaringProjects = needNextProjects.stream()
.filter(p -> {
//判断 当状态在 建设中的时候 是不是要初验了
if (ProjectStatusEnum.UNDER_CONSTRUCTION.eq(projectStatus)) {
if (ProjectStatus.UNDER_CONSTRUCTION.eq(projectStatus)) {
// List<Long> allVersionProjectId = projectService.allVersionProjectIds(p.getProjectCode());
//如果合同信息提交过了 才是 待初验状态
// TODO 初验提醒
@@ -319,7 +318,7 @@ public class EarlyWarningInstanceNotStartTask {
List<Project> needToWaringProjects = needNextProjects.stream()
.filter(p -> {
//判断 当状态在 建设中的时候 是不是要初验了
if (ProjectStatusEnum.UNDER_CONSTRUCTION.eq(projectStatus)) {
if (ProjectStatus.UNDER_CONSTRUCTION.eq(projectStatus)) {
// List<Long> allVersionProjectId = projectService.allVersionProjectIds(p.getProjectCode());
//如果合同信息提交过了 才是 待初验状态
// 初验提醒


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java View File

@@ -4,7 +4,7 @@ import com.google.common.collect.Maps;
import com.hz.pm.api.projectdeclared.manage.ReviewByDeptJointManage;
import com.hz.pm.api.projectdeclared.manage.ReviewByProvincialDeptManage;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import org.springframework.stereotype.Component;

import java.util.Map;
@@ -34,10 +34,10 @@ public class ProjectStatusFlowMapUtil {
public ProjectStatusFlowMapUtil(ReviewByProvincialDeptManage provincialDeptManage,
ReviewByDeptJointManage reviewByDeptJointManage) {
//省级部门联审
STATUS_FLOW_FUNCTION_MAP.put(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(),
STATUS_FLOW_FUNCTION_MAP.put(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(),
provincialDeptManage::startTheProcess);
//部门联审
STATUS_FLOW_FUNCTION_MAP.put(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode(),
STATUS_FLOW_FUNCTION_MAP.put(ProjectStatus.DEPARTMENT_JOINT_REVIEW.getCode(),
reviewByDeptJointManage::startTheProcess);
}



+ 10
- 9
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java View File

@@ -33,7 +33,7 @@ import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.entity.ProjectDelayApply;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.INdProjectDelayApplyService;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectInstService;
@@ -188,7 +188,8 @@ public class HandlerManage {
throw BizException.wrap("传入实例类型错误: %s", instTypeEnum);
}
} else {
switch (Objects.requireNonNull(ProjectStatusEnum.match(project.getStatus()))) {
ProjectStatus projectStatus = ProjectStatus.getNoNull(project.getStatus());
switch (projectStatus) {
// 当前项目状态是预审中
case PRE_APPLYING:
//先修改项目状态
@@ -425,18 +426,18 @@ public class HandlerManage {
/**
* 发起人 撤回逻辑
*/
public void rootWithDraw(Project declaredProject) {
public void rootWithDraw(Project project) {
Long userId = LoginUserUtil.getUserId();
// 若是流程发起人点击撤回,项目回到上一个状态,需调用状态机更新项目状态,流程状态更新为审核通过
switch (Objects.requireNonNull(ProjectStatusEnum.match(declaredProject.getStatus()))) {
switch (ProjectStatus.getNoNull(project.getStatus())) {
// 当前项目状态是单位内部审核中
case UNDER_INTERNAL_AUDIT:
// 更新项目状态为待申报
updateWithdrawProjectStatus(userId, declaredProject);
updateWithdrawProjectStatus(userId, project);
// 保存到草稿箱中
saveToDraft(declaredProject);
saveToDraft(project);
//删除所有项目相关的信息
deleteProjectRelated(declaredProject);
deleteProjectRelated(project);
break;
// 当前项目状态是预审中
case PRE_APPLYING:
@@ -444,10 +445,10 @@ public class HandlerManage {
case DEPARTMENT_JOINT_REVIEW:
// 当前项目状态是方案评审中
case SCHEME_UNDER_REVIEW:
updateWithdrawProjectStatus(userId, declaredProject);
updateWithdrawProjectStatus(userId, project);
break;
default:
throw new IllegalStateException("Unexpected value: " + declaredProject.getStatus());
throw new IllegalStateException("Unexpected value: " + project.getStatus());
}
}



+ 3
- 3
hz-pm-api/src/test/java/com/hz/pm/api/provincial/Test.java View File

@@ -10,7 +10,7 @@ import com.hz.pm.api.projectdeclared.converter.ApplicationConverter;
import com.hz.pm.api.projectdeclared.manage.PrequalificationDeclaredProjectManage;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService;
@@ -112,8 +112,8 @@ public class Test extends AppTests {//
@org.junit.Test
public void test6() {
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode())
.eq(Project::getStage, ProjectStatus.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode())
.ge(Project::getDeclareAmount, ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)
.eq(Project::getAreaCode, RegionConst.RC_HZ)
.orderByAsc(Project::getCreateOn));


+ 3
- 3
hz-pm-api/src/test/java/com/hz/pm/api/sys/project/ProjectStateTest.java View File

@@ -4,7 +4,7 @@ import cn.hutool.core.date.StopWatch;
import com.alibaba.fastjson.JSON;
import com.hz.pm.api.AppTests;
import com.hz.pm.api.common.statemachine.util.ProjectStateMachineUtil;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.service.IProjectService;
import org.junit.Test;
@@ -34,8 +34,8 @@ public class ProjectStateTest extends AppTests {
Project project = new Project();
project.setInstCode("1");
project.setId(1L);
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
project.setStage(ProjectStatus.NOT_APPROVED.getCode());
project.setStatus(ProjectStatus.PENDING_PREQUALIFICATION.getCode());
//调用状态机 进入下一个通过状态
projectStateMachineUtil.pass(project);



Loading…
Cancel
Save