Browse Source

修改部门联审

tags/24080901
WendyYang 9 months ago
parent
commit
8f47042dab
40 changed files with 222 additions and 586 deletions
  1. +0
    -273
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java
  2. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareChoiceAction.java
  3. +4
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/ProjectDeclareStateMachineBuilderImpl.java
  4. +5
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/factory/ProjectDeclareGuardFactory.java
  5. +2
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/StateMachineUtil.java
  6. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/ProjectFileManage.java
  7. +2
    -14
      hz-pm-api/src/main/java/com/hz/pm/api/gov/manage/GovProjectCollectionManage.java
  8. +1
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/IrsProjectManage.java
  9. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/OrgSelfAppraisalManage.java
  10. +8
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/VerifyManage.java
  11. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ConstructionController.java
  12. +6
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java
  13. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java
  14. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java
  15. +8
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DefaultDeclaredProjectManage.java
  16. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DelayedApplyManage.java
  17. +10
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java
  18. +6
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
  19. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  20. +5
    -13
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByDeptJointManage.java
  21. +1
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProcessExecuteChainHandle.java
  22. +1
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectHelper.java
  23. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java
  24. +5
    -13
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectCollectionManage.java
  25. +15
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  26. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java
  27. +1
    -42
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml
  28. +11
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/InstTypeEnum.java
  29. +0
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectListReq.java
  30. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/safety/manage/SafetyRiskManage.java
  31. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/CcTaskListener.java
  32. +3
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java
  33. +6
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/NoticeManage.java
  34. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/UserGuidanceManage.java
  35. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/sys/utils/EarlyWarningUtil.java
  36. +87
    -89
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java
  37. +2
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java
  38. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/impl/TodoServiceImpl.java
  39. +1
    -1
      hz-pm-api/src/main/resources/application-dev.yml
  40. +11
    -11
      hz-pm-api/src/test/java/com/hz/pm/api/sys/service/IMenuServiceTest.java

+ 0
- 273
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java View File

@@ -1,273 +0,0 @@
package com.hz.pm.api.common.statemachine.action;

import com.hz.pm.api.common.model.constant.StateMachineConst;
import com.hz.pm.api.common.statemachine.builder.ProjectDeclareStateMachineBuilderImpl;
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.statemachine.annotation.OnTransition;
import org.springframework.statemachine.annotation.WithStateMachine;

/**
* 项目申报状态机action集合类
*
* @author CMM
* @since 2023/02/08 13:48
*/
@Slf4j
@WithStateMachine(id = ProjectDeclareStateMachineBuilderImpl.MACHINE_ID)
public class ProjectDeclareAction {

private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE;

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

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

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

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


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

@OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT")
public void PENDING_PREQUALIFICATION_WITHDRAW(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.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<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.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<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.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<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.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<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
}

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

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

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

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


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

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

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


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

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

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


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

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

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

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

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

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

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


@OnTransition(source = "TO_BE_APPROVED", target = "TO_BE_PURCHASED")
public void PROJECT_APPROVAL(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
// 待立项批复批复后,项目一级状态变更为已立项
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
}

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


@OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION")
public void PURCHASE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.OPERATION.getCode());
}
@OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION")
public void START_TO_WORK(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
}

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


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

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


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

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


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

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

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

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

@@ -77,7 +77,7 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro
private void preDeclareChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) {
Project project = getProject(stateContext);
log.info("预审申报事件之前,项目的状态为:{}", project.getStatus());
if (StateMachineUtil.isCityProject(project) && StateMachineUtil.judgeDeclareAmount(project,
if (StateMachineUtil.isCityProject() && StateMachineUtil.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)) {
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode());
} else {
@@ -88,7 +88,7 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro
private void preWithDrawChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) {
Project project = getProject(stateContext);
log.info("预审中撤回事件之前,项目的状态为:{}", project.getStatus());
if (StateMachineUtil.isCityProject(project) && StateMachineUtil.judgeDeclareAmount(project,
if (StateMachineUtil.isCityProject() && StateMachineUtil.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)) {
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
} else {


+ 4
- 5
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/ProjectDeclareStateMachineBuilderImpl.java View File

@@ -36,7 +36,6 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat

public static final String MACHINE_ID = "projectDeclareStateMachine";

private static final ProjectDeclareGuardFactory PROJECT_DECLARE_GUARD_FACTORY = new ProjectDeclareGuardFactory();
private final BeanFactory beanFactory;

@Override
@@ -99,7 +98,7 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat
// 待预审申报,从待预审选择->省级部门联审中,预审中,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, PROJECT_DECLARE_GUARD_FACTORY.new PendingPreQualificationChoiceGuard(), new ProjectDeclareChoiceAction())
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new ProjectDeclareGuardFactory.PendingPreQualificationChoiceGuard(), new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PRE_APPLYING, new ProjectDeclareChoiceAction()).and()

// 省级部门联审通过,从省级部门联审中到省级部门联审成功
@@ -141,7 +140,7 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat
// 预审中撤回,从预审中撤回选择态->省级部门联审成功,待预审,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS, PROJECT_DECLARE_GUARD_FACTORY.new PendingPreQualificationChoiceGuard()
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS, new ProjectDeclareGuardFactory.PendingPreQualificationChoiceGuard()
, new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PENDING_PREQUALIFICATION, new ProjectDeclareChoiceAction()).and()
// 预审不通过重新提交,从预审不通过到待预审选择
@@ -152,7 +151,7 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat
// 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, PROJECT_DECLARE_GUARD_FACTORY.new PendingPreQualificationChoiceGuard(), new ProjectDeclareChoiceAction())
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new ProjectDeclareGuardFactory.PendingPreQualificationChoiceGuard(), new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PRE_APPLYING, new ProjectDeclareChoiceAction()).and()
// 部门联审通过,从部门联审中到年度计划中
.withExternal()
@@ -271,7 +270,7 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat
@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
return new DefaultStateMachineContext<>(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null);
null, null, null, null, MACHINE_ID);
}
});
}


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

@@ -26,20 +26,17 @@ import static com.hz.pm.api.common.model.constant.StateMachineConst.APPLICATION_
public class ProjectDeclareGuardFactory {
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE;

public class PendingPreQualificationChoiceGuard implements Guard<ProjectStatusEnum, ProjectStatusChangeEvent> {
public static class PendingPreQualificationChoiceGuard implements Guard<ProjectStatusEnum, ProjectStatusChangeEvent> {
@Override
public boolean evaluate(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> context) {
Project project = context.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
// 判断申报项目是否是市级项目,且申报金额是否大于等于1000万元
if (StateMachineUtil.isCityProject(project) && StateMachineUtil.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){
return true;
}
return false;
return StateMachineUtil.isCityProject() && StateMachineUtil.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT);
}
}

public class ApprovedAfterChoiceGuard implements Guard<ProjectStatusEnum, ProjectStatusChangeEvent> {
public static class ApprovedAfterChoiceGuard implements Guard<ProjectStatusEnum, ProjectStatusChangeEvent> {
@Override
public boolean evaluate(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> context) {
List<ProjectApplication> projectApplications = context.getMessage().getHeaders().get(APPLICATION_DECLARE, List.class);
@@ -48,7 +45,7 @@ public class ProjectDeclareGuardFactory {
if (CollUtil.isEmpty(projectApplications)){
return res[0];
}
projectApplications.stream().forEach(app -> {
projectApplications.forEach(app -> {
Integer isFirst = app.getIsFirst();
if(isFirst.equals(CommonEnum.YES.getCode())){
res[0] = Boolean.TRUE;


+ 2
- 5
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/StateMachineUtil.java View File

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

import com.hz.pm.api.common.model.constant.RegionConst;
import com.hz.pm.api.common.model.constant.StateMachineConst;
import com.hz.pm.api.common.statemachine.builder.ProjectDeclareStateMachineBuilder;
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
@@ -117,13 +116,11 @@ public class StateMachineUtil {
/**
* 判断申报项目是否为市级项目
*
* @param project \
* @return boolean
* @since 2023/02/07 17:05
*/
public static boolean isCityProject(Project project) {
String areaCode = project.getAreaCode();
return areaCode.equals(RegionConst.RC_HZ);
public static boolean isCityProject() {
return Boolean.FALSE;
}

public ProjectStatusChangeEvent getProjectStatusPassEvent(Integer status) {


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

@@ -278,7 +278,7 @@ public class ProjectFileManage {
projectLibManage.saveProjectByApplyBorrow(project, user, instanceId);

// 发送给第一个审批人消息
noticeManage.sendFirtUser(project, model.getFormName(), instanceId, WorkNoticeConstant.PASS_MSG_TEMPLATE,
noticeManage.sendFirstUser(project, model.getFormName(), instanceId, WorkNoticeConstant.PASS_MSG_TEMPLATE,
MsgTypeEnum.PROJECT_REVIEW);

return instanceId;


+ 2
- 14
hz-pm-api/src/main/java/com/hz/pm/api/gov/manage/GovProjectCollectionManage.java View File

@@ -182,8 +182,6 @@ public class GovProjectCollectionManage {
LambdaQueryWrapper<GovBizProjectBaseinfo> wrapper = Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.like(StringUtils.isNotBlank(req.getProjectName()), GovBizProjectBaseinfo::getBaseProjName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrg()), GovBizProjectBaseinfo::getBaseBuildDeprt, req.getBuildOrg())
.eq(StringUtils.isNotBlank(req.getAreaCode()), GovBizProjectBaseinfo::getBaseAreaCode, req.getAreaCode() + BizConst.NINE_AREA_CODE_LAST)
.eq(StringUtils.isNotBlank(req.getRegionCode()), GovBizProjectBaseinfo::getBaseAreaCode, req.getRegionCode() + BizConst.NINE_AREA_CODE_LAST)
.gt(Objects.nonNull(req.getCreateOnMin()), GovBizProjectBaseinfo::getTongTime, req.getCreateOnMin())
.le(Objects.nonNull(req.getCreateOnMax()), GovBizProjectBaseinfo::getTongTime, req.getCreateOnMax())
.eq(StringUtils.isNotBlank(req.getProjectType()), GovBizProjectBaseinfo::getBaseProjType, req.getProjectType())
@@ -208,10 +206,10 @@ public class GovProjectCollectionManage {

Map<String, GovBizProjectApply> applyMap = Maps.newHashMap();
if (CollUtil.isNotEmpty(projIds)) {
List<GovBizProjectApply> applys = projectApplyService.list(Wrappers.lambdaQuery(GovBizProjectApply.class)
List<GovBizProjectApply> applies = projectApplyService.list(Wrappers.lambdaQuery(GovBizProjectApply.class)
.in(GovBizProjectApply::getBaseProjId, projIds)
.eq(GovBizProjectApply::getDeleted, Boolean.FALSE));
applyMap = applys.stream().collect(Collectors.toMap(GovBizProjectApply::getBaseProjId, a -> a));
applyMap = applies.stream().collect(Collectors.toMap(GovBizProjectApply::getBaseProjId, a -> a));
}

Map<String, GovBizProjectApply> finalApplyMap = applyMap;
@@ -246,8 +244,6 @@ public class GovProjectCollectionManage {
LambdaQueryWrapper<GovOperationProjectBaseinfo> wrapper = Wrappers.lambdaQuery(GovOperationProjectBaseinfo.class)
.like(StringUtils.isNotBlank(req.getProjectName()), GovOperationProjectBaseinfo::getBaseProjName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrg()), GovOperationProjectBaseinfo::getBaseBuildDeprt, req.getBuildOrg())
.eq(StringUtils.isNotBlank(req.getAreaCode()), GovOperationProjectBaseinfo::getBaseAreaCode, req.getAreaCode() + BizConst.NINE_AREA_CODE_LAST)
.eq(StringUtils.isNotBlank(req.getRegionCode()), GovOperationProjectBaseinfo::getBaseAreaCode, req.getRegionCode() + BizConst.NINE_AREA_CODE_LAST)
.gt(Objects.nonNull(req.getCreateOnMin()), GovOperationProjectBaseinfo::getTongTime, req.getCreateOnMin())
.le(Objects.nonNull(req.getCreateOnMax()), GovOperationProjectBaseinfo::getTongTime, req.getCreateOnMax())
.eq(StringUtils.isNotBlank(req.getProjectType()), GovOperationProjectBaseinfo::getBaseProjType, req.getProjectType())
@@ -305,8 +301,6 @@ public class GovProjectCollectionManage {
LambdaQueryWrapper<GovBizProjectDraft> wrapper = Wrappers.lambdaQuery(GovBizProjectDraft.class)
.like(StringUtils.isNotBlank(req.getProjectName()), GovBizProjectDraft::getBaseProjName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrg()), GovBizProjectDraft::getBaseBuildDeprt, req.getBuildOrg())
.eq(StringUtils.isNotBlank(req.getAreaCode()), GovBizProjectDraft::getBaseAreaCode, req.getAreaCode() + BizConst.NINE_AREA_CODE_LAST)
.eq(StringUtils.isNotBlank(req.getRegionCode()), GovBizProjectDraft::getBaseAreaCode, req.getRegionCode() + BizConst.NINE_AREA_CODE_LAST)
.gt(Objects.nonNull(req.getCreateOnMin()), GovBizProjectDraft::getTongTime, req.getCreateOnMin())
.le(Objects.nonNull(req.getCreateOnMax()), GovBizProjectDraft::getTongTime, req.getCreateOnMax())
.eq(StringUtils.isNotBlank(req.getProjectType()), GovBizProjectDraft::getBaseProjType, req.getProjectType())
@@ -349,8 +343,6 @@ public class GovProjectCollectionManage {
LambdaQueryWrapper<GovOperationProjectDraft> wrapper = Wrappers.lambdaQuery(GovOperationProjectDraft.class)
.like(StringUtils.isNotBlank(req.getProjectName()), GovOperationProjectDraft::getBaseProjName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrg()), GovOperationProjectDraft::getBaseBuildDeprt, req.getBuildOrg())
.eq(StringUtils.isNotBlank(req.getAreaCode()), GovOperationProjectDraft::getBaseAreaCode, req.getAreaCode() + BizConst.NINE_AREA_CODE_LAST)
.eq(StringUtils.isNotBlank(req.getRegionCode()), GovOperationProjectDraft::getBaseAreaCode, req.getRegionCode() + BizConst.NINE_AREA_CODE_LAST)
.gt(Objects.nonNull(req.getCreateOnMin()), GovOperationProjectDraft::getTongTime, req.getCreateOnMin())
.le(Objects.nonNull(req.getCreateOnMax()), GovOperationProjectDraft::getTongTime, req.getCreateOnMax())
.eq(StringUtils.isNotBlank(req.getProjectType()), GovOperationProjectDraft::getBaseProjType, req.getProjectType())
@@ -385,8 +377,6 @@ public class GovProjectCollectionManage {
LambdaQueryWrapper<GovBizProjectBaseinfo> wrapper = Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.like(StringUtils.isNotBlank(req.getProjectName()), GovBizProjectBaseinfo::getBaseProjName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrg()), GovBizProjectBaseinfo::getBaseBuildDeprt, req.getBuildOrg())
.eq(StringUtils.isNotBlank(req.getAreaCode()), GovBizProjectBaseinfo::getAreaCode, req.getAreaCode())
.eq(StringUtils.isNotBlank(req.getRegionCode()), GovBizProjectBaseinfo::getAreaCode, req.getRegionCode())
.gt(Objects.nonNull(req.getCreateOnMin()), GovBizProjectBaseinfo::getTongTime, req.getCreateOnMin())
.le(Objects.nonNull(req.getCreateOnMax()), GovBizProjectBaseinfo::getTongTime, req.getCreateOnMax())
.eq(GovBizProjectBaseinfo::getDeleted, Boolean.FALSE)
@@ -398,8 +388,6 @@ public class GovProjectCollectionManage {
LambdaQueryWrapper<GovOperationProjectBaseinfo> wrapper = Wrappers.lambdaQuery(GovOperationProjectBaseinfo.class)
.like(StringUtils.isNotBlank(req.getProjectName()), GovOperationProjectBaseinfo::getBaseProjName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrg()), GovOperationProjectBaseinfo::getBaseBuildDeprt, req.getBuildOrg())
.eq(StringUtils.isNotBlank(req.getAreaCode()), GovOperationProjectBaseinfo::getAreaCode, req.getAreaCode())
.eq(StringUtils.isNotBlank(req.getRegionCode()), GovOperationProjectBaseinfo::getAreaCode, req.getRegionCode())
.gt(Objects.nonNull(req.getCreateOnMin()), GovOperationProjectBaseinfo::getTongTime, req.getCreateOnMin())
.le(Objects.nonNull(req.getCreateOnMax()), GovOperationProjectBaseinfo::getTongTime, req.getCreateOnMax())
.eq(GovOperationProjectBaseinfo::getDeleted, Boolean.FALSE)


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

@@ -46,8 +46,6 @@ public class IrsProjectManage {
Page<Project> page = req.page();
UserInfoDetails user = LoginUserUtil.loginUserDetail();
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class)
.eq(StringUtils.isNotBlank(req.getAreaCode()), Project::getAreaCode, req.getAreaCode())
.eq(StringUtils.isNotBlank(req.getRegionCode()), Project::getAreaCode, req.getRegionCode())
.eq(StringUtils.isNotBlank(req.getProjectType()), Project::getProjectType, req.getProjectType())
.eq(Objects.nonNull(req.getStatus()), Project::getStatus, req.getStatus())
.eq(Objects.nonNull(req.getStage()), Project::getStage, req.getStage())
@@ -78,7 +76,7 @@ public class IrsProjectManage {
if (user.getSuperAdmin() || user.getRegionAdmin()) {
log.info("超管 都可看 项目档案列表");
} else {
wrapper.eq(Project::getBuildOrgCode, user.getMhUnitId());
wrapper.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
}
}
}

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

@@ -158,7 +158,7 @@ public class OrgSelfAppraisalManage {
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getBuildOrgCode, user.getMhUnitId())
.eq(Project::getBuildOrgCode, user.getMhUnitIdStr())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName());
projectService.page(page, wrapper);

@@ -211,7 +211,7 @@ public class OrgSelfAppraisalManage {
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getBuildOrgCode, user.getMhUnitId())
.eq(Project::getBuildOrgCode, user.getMhUnitIdStr())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName());
projectService.page(page, wrapper);



+ 8
- 5
hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/VerifyManage.java View File

@@ -16,6 +16,7 @@ import com.google.common.collect.Lists;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.common.util.StrUtils;
import com.hz.pm.api.performance.constant.ProjectBizConst;
import com.hz.pm.api.performance.enumration.AppraisalTypeEnum;
import com.hz.pm.api.performance.enumration.RectifyStatusEnum;
@@ -105,12 +106,14 @@ public class VerifyManage {
List<PerformanceAppraisalProjectGroup> projectGroups = groupService.list();
for (PerformanceAppraisalProjectGroup projectGroup : projectGroups) {
String verificationUsers = projectGroup.getVerificationUsers();
if (verificationUsers.contains(StrPool.COMMA)) {
if (verificationUsers.contains(employeeCode)) {
if (StrUtils.isNotBlank(verificationUsers)) {
if (verificationUsers.contains(StrPool.COMMA)) {
if (verificationUsers.contains(employeeCode)) {
groups.add(projectGroup);
}
} else if (verificationUsers.equals(employeeCode)) {
groups.add(projectGroup);
}
} else if (verificationUsers.equals(employeeCode)) {
groups.add(projectGroup);
}
}
// 当前登录专家没有绩效分组信息
@@ -165,7 +168,7 @@ public class VerifyManage {
public PageVo<PerformanceAppraisalProjectVO> groupProjectList(Long groupId, PerformanceAppraisalListReq req) {

UserInfoDetails userDetail = LoginUserUtil.loginUserDetail();
String userIdStr = String.valueOf(userDetail.getUserId());
String userIdStr = userDetail.getUserIdStr();

// 获取分组内的项目信息
PerformanceAppraisalProjectGroup projectGroup = groupService.getById(groupId);


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ConstructionController.java View File

@@ -46,7 +46,7 @@ public class ConstructionController {
@ApiOperation(value = "已经完善合同信息的项目列表", notes = "已经完善合同信息的项目列表")
@GetMapping("/contract/project-list-perfect")
public PageVo<ProjectContractListVO> projectlistPerfect(@ModelAttribute ProjectListReq req) {
return constructionManage.projectlistPerfect(req);
return constructionManage.projectListPerfect(req);
}

@GetMapping("/contract/export")


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

@@ -96,7 +96,7 @@ public class ConstructionManage {
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
query.orderByAsc(Project::getTransactionTime);
Page<Project> page = projectService.page(req.page(), query);
long total;
@@ -130,10 +130,10 @@ public class ConstructionManage {
/**
* 已完善合同信息的列表
*
* @param req
* @return
* @param req \
* @return \
*/
public PageVo<ProjectContractListVO> projectlistPerfect(ProjectListReq req) {
public PageVo<ProjectContractListVO> projectListPerfect(ProjectListReq req) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
//建设中状态以后的 都是
@@ -142,7 +142,7 @@ public class ConstructionManage {
.isNotNull(Project::getContractAmount)));
query.eq(Project::getNewest, Boolean.TRUE);
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
query.orderByAsc(Project::getUpdateOn);
Page<Project> page = projectService.page(req.page(), query);

@@ -191,7 +191,6 @@ public class ConstructionManage {
}

public void exportList(HttpServletResponse response, ProjectListReq param) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param);
//待采购状态
query.eq(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
@@ -372,7 +371,7 @@ public class ConstructionManage {
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.eq(Project::getNewest, Boolean.TRUE);
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
//交货时间 排序
query.isNotNull(Project::getDeliveryTime);
query.orderByAsc(Project::getDeliveryTime);


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

@@ -173,7 +173,7 @@ public class ConstructionPlanManage {
}

//发送给第一个审批人消息
noticeManage.sendFirtUser(buildProject, model.getFormName(), instanceId,
noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId,
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;


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

@@ -113,7 +113,7 @@ public class DeclaredProjectManage {
*/
@Transactional(rollbackFor = Exception.class)
public String startTheProcess(DefaultDeclaredDTO dto) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
UserInfoDetails user = LoginUserUtil.loginUserDetail();
ProjectDTO projectInfo = dto.getProjectInfo();

projectInfo.setBuildOrgCode(user.getMhUnitIdStr());
@@ -176,7 +176,7 @@ public class DeclaredProjectManage {
}

//发送给第一个审批人消息
noticeManage.sendFirtUser(buildProject, model.getFormName(), instanceId,
noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId,
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
@@ -253,7 +253,7 @@ public class DeclaredProjectManage {
Project buildProject = projectLibManage.saveProjectInDeclared(projectDto, instanceId, user.getUserId());

//发送给第一个审批人消息
noticeManage.sendFirtUser(buildProject, model.getFormName(), instanceId,
noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId,
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;


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

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectdeclared.manage;

import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -128,16 +129,14 @@ public class DefaultDeclaredProjectManage {
}

public ProcessInstanceUserDto buildUser(Long userId) {
UserFullInfoDTO userInfoDetail = userInfoHelper.getUserFullInfo(userId);

VUtils.isTrue(Objects.isNull(userInfoDetail))
.throwMessage(String.format("【%s】获取不到用户!", userId));
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(userId);
Assert.notNull(user, "【%s】获取不到用户!", userId);

return ProcessInstanceUserDto.builder()
.userId(String.valueOf(userInfoDetail.getUserId()))
.userName(userInfoDetail.getRealName())
.orgCode(String.valueOf(userInfoDetail.getMhUnitId()))
.orgName(userInfoDetail.getMhUnitName())
.userId(user.getUserIdStr())
.userName(user.getRealName())
.orgCode(user.getMhUnitIdStr())
.orgName(user.getMhUnitName())
.build();
}

@@ -153,7 +152,7 @@ public class DefaultDeclaredProjectManage {
return Collections.emptyMap();
}

String startOrgCode = String.valueOf(userFullInfo.getMhUnitId());
String startOrgCode = userFullInfo.getMhUnitIdStr();
String startOrgName = userFullInfo.getMhUnitName();
String startOrgParentCode;
String startOrgParentName;


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

@@ -283,7 +283,7 @@ public class DelayedApplyManage {
projectLibManage.saveProjectByApplyDelay(dto, project, instanceId);

//发送给第一个审批人消息
noticeManage.sendFirtUser(project, model.getFormName(), instanceId,
noticeManage.sendFirstUser(project, model.getFormName(), instanceId,
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;


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

@@ -6,27 +6,25 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.common.util.ExcelExportStyle;
import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectdeclared.model.vo.FinalAcceptanceVO;
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.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.helper.ProjectHelper;
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.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
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;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.staging.enums.MsgTypeEnum;
import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
@@ -55,6 +53,9 @@ import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

import static com.hz.pm.api.staging.enums.MsgTypeEnum.PROJECT_REVIEW;
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE;

/**
* @Classname FinalAcceptanceManage
* @Description 终验
@@ -90,7 +91,7 @@ public class FinalAcceptanceManage {
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
//待终验 并且还未过期
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
query.eq(Project::getStatus, ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode());
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode());
query.ge(Project::getPlanAcceptanceTime, LocalDateTime.now());
@@ -238,8 +239,7 @@ public class FinalAcceptanceManage {
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(), Boolean.FALSE);

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo, model.getFormName(), instanceId,
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId, PASS_MSG_TEMPLATE, PROJECT_REVIEW);

return instanceId;
}
@@ -293,9 +293,7 @@ public class FinalAcceptanceManage {
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(), Boolean.TRUE);

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

noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId, PASS_MSG_TEMPLATE, PROJECT_REVIEW);
return instanceId;
}
}

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

@@ -178,16 +178,12 @@ public class PrequalificationDeclaredProjectManage {
//把条件值给放入工作流
defaultDeclaredProjectManage.buildCondition(params, projectInfo);

String regionCode = projectInfo.getAreaCode();

WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode)
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.PROJECT_PREQUALIFICATION_APPROVAL_PROCESS.getCode())
.last(BizConst.LIMIT_1));

if (Objects.isNull(model)) {
log.error("此 【{}】区域找不到 预审流程配置", regionCode);
throw new BusinessException(String.format("此 【%s】区域找不到 预审流程配置", regionCode));
throw new BusinessException("找不到预审流程配置");
}

// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息
@@ -206,7 +202,7 @@ public class PrequalificationDeclaredProjectManage {
}

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo, model.getFormName(), instanceId,
noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId,
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
@@ -295,18 +291,17 @@ public class PrequalificationDeclaredProjectManage {
*
* @param query
*/
public UserFullInfoDTO buildPermission(LambdaQueryWrapper<Project> query, UserFullInfoDTO user) {
public void buildPermission(LambdaQueryWrapper<Project> query, UserFullInfoDTO user) {
if (user.getIsOrgAdmin()) {
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目
query.and(q1 -> q1.eq(Project::getBuildOrgCode, user.getMhUnitId())
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())))
.eq(Project::getSuperOrgCode, user.getMhUnitId())));
.eq(Project::getSuperOrgCode, user.getMhUnitIdStr())));
} else {
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
}
return user;
}

public void exportList(HttpServletResponse response, PrequalificationDeclaredListReq preReq) {


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

@@ -70,10 +70,10 @@ public class PurchaseManage {
*/
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!");
Assert.notNull(user, "获取登录用户失败!");
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
//只能看自己单位的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
//待采购状态
query.in(Project::getStatus, Lists.newArrayList(ProjectStatusEnum.TO_BE_PURCHASED.getCode(),
ProjectStatusEnum.OPERATION.getCode()));


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

@@ -1,18 +1,16 @@
package com.hz.pm.api.projectdeclared.manage;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Maps;
import com.ningdatech.basic.function.VUtils;
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.manage.ProjectLibManage;
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.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.staging.enums.MsgTypeEnum;
import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.basic.function.VUtils;
import com.wflow.bean.entity.WflowModels;
import com.wflow.exception.BusinessException;
import com.wflow.workflow.bean.dto.OrgInfoDTO;
@@ -24,7 +22,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
@@ -67,16 +64,13 @@ public class ReviewByDeptJointManage {
VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!");
Project projectInfo = projectService.getNewProject(project.getId());
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");
String regionCode = projectInfo.getAreaCode();

WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode)
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode())
.last("limit 1"));

if (Objects.isNull(model)) {
log.error("此 【{}】区域找不到 部门联审申报流程配置", regionCode);
throw new BusinessException(String.format("此 【%s】区域找不到 部门联审申报流程配置", regionCode));
throw new BusinessException("找不到部门联审申报流程配置");
}
//要判断 项目当前状态 是不是 部门联审
VUtils.isTrue(!ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode().equals(projectInfo.getStatus()) ||
@@ -84,8 +78,7 @@ public class ReviewByDeptJointManage {
.throwMessage("提交失败 该项目不是 省级部门联审状态状态或者未立项阶段");

// 再判断 该项目是否 真实走完 预审审批 并且提取出 提交人
VUtils.isTrue(Objects.isNull(projectInfo.getSponsor()))
.throwMessage("提交失败 项目信息 缺少项目发起人!");
VUtils.isTrue(Objects.isNull(projectInfo.getSponsor())).throwMessage("提交失败 项目信息 缺少项目发起人!");

ProcessStartParamsVo params = new ProcessStartParamsVo();
//发起人的信息
@@ -104,8 +97,7 @@ public class ReviewByDeptJointManage {
projectInfo = projectLibManage.saveProjectWithVersion(projectInfo, instanceId, ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode());

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo, model.getFormName(), instanceId,
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId, WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
return Boolean.TRUE;
}



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

@@ -12,7 +12,6 @@ import com.wflow.bean.entity.WflowModels;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.service.ProcessModelService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collections;
@@ -67,7 +66,7 @@ public class ProcessExecuteChainHandle {
}
} else if (processBusinessHandle instanceof ProvinceUnitedReviewHandle) {
//省级联审
if (StateMachineUtil.isCityProject(project) && StateMachineUtil.judgeDeclareAmount(project,
if (StateMachineUtil.isCityProject() && StateMachineUtil.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)) {
handles.add(processBusinessHandle);
}


+ 1
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectHelper.java View File

@@ -34,8 +34,7 @@ public class ProjectHelper {
**/
public static LambdaQueryWrapper<Project> projectQuery(ProjectListReq req) {
LambdaQueryWrapper<Project> query = new LambdaQueryWrapper<>();
query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode())
.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId())
query.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId())
.like(StrUtil.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName())
.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType())
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear())


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

@@ -147,7 +147,7 @@ public class ApplicationManage {
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::getBuildOrgCode, user.getMhUnitId()));
.eq(Project::getBuildOrgCode, user.getMhUnitIdStr()));
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
}


+ 5
- 13
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectCollectionManage.java View File

@@ -67,13 +67,6 @@ public class ProjectCollectionManage {
.like(StringUtils.isNotBlank(req.getBuildOrg()), ProjectCollection::getBuildOrg, req.getBuildOrg())
.eq(Objects.nonNull(buildOrgCode), ProjectCollection::getBuildOrgCode, buildOrgCode);
//处理 行政区域
if (StringUtils.isNotBlank(req.getRegionCode())) {
List<RegionDTO> regions = regionCacheHelper.listChildren(req.getRegionCode(), req.getRegionLevel());

if (CollUtil.isNotEmpty(regions)) {
wrapper.in(ProjectCollection::getAreaCode, regions.stream().map(RegionDTO::getRegionCode).collect(Collectors.toList()));
}
}

collectionService.page(page, wrapper);

@@ -81,12 +74,11 @@ public class ProjectCollectionManage {
return PageVo.empty();
}

List<ProjectCollectionVO> res = page.getRecords().stream()
.map(record -> {
ProjectCollectionVO vo = BeanUtil.copyProperties(record, ProjectCollectionVO.class);
vo.setArea(regionCacheHelper.getDisplayName(record.getAreaCode(), RegionConst.RL_COUNTY));
return vo;
}).collect(Collectors.toList());
List<ProjectCollectionVO> res = page.getRecords().stream().map(w -> {
ProjectCollectionVO vo = BeanUtil.copyProperties(w, ProjectCollectionVO.class);
vo.setArea(regionCacheHelper.getDisplayName(w.getAreaCode(), RegionConst.RL_COUNTY));
return vo;
}).collect(Collectors.toList());

return PageVo.of(res, page.getTotal());
}


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

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -86,6 +87,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.flowable.engine.TaskService;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskInfo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

@@ -355,8 +357,11 @@ public class ProjectLibManage {
Map<Long, UserFullInfoDTO> userMap) {
if (map.containsKey(instCode)) {
List<Task> tasks = map.get(instCode);
return tasks.stream().map(task -> userMap.get(Long.parseLong(task.getAssignee())))
.filter(Objects::nonNull).collect(Collectors.toList());
return tasks.stream().map(TaskInfo::getAssignee)
.filter(NumberUtil::isNumber)
.map(w -> userMap.get(Long.parseLong(w)))
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
return Collections.emptyList();
}
@@ -365,9 +370,13 @@ public class ProjectLibManage {
if (CollUtil.isEmpty(tasks)) {
return Collections.emptyMap();
}
List<UserFullInfoDTO> users = userInfoHelper.listUserFullInfoByUserIds(
tasks.stream().map(w -> Long.parseLong(w.getAssignee()))
.collect(Collectors.toSet()));
Set<Long> userIds = tasks.stream().filter(w -> NumberUtil.isNumber(w.getAssignee()))
.map(w -> Long.parseLong(w.getAssignee()))
.collect(Collectors.toSet());
if (userIds.isEmpty()) {
return Collections.emptyMap();
}
List<UserFullInfoDTO> users = userInfoHelper.listUserFullInfoByUserIds(userIds);
return users.stream().collect(Collectors.toMap(UserFullInfoDTO::getUserId, u -> u));
}

@@ -719,7 +728,7 @@ public class ProjectLibManage {
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds));
Map<Long, List<ProjectCoreBusinessIndicators>> coreBizMap = coreBizs.stream().collect(Collectors.groupingBy(ProjectCoreBusinessIndicators::getApplicationId));

Optional.ofNullable(applications).ifPresent(apps ->
Optional.of(applications).ifPresent(apps ->
vo.setProjectApplications(CollUtils.convert(apps,
app -> ProjectHelper.convertVOWithMap(app, coreBizMap))
));


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

@@ -123,7 +123,7 @@ public class ProjectRenewalFundManage {
//项目查最新
query.eq(Project::getNewest, Boolean.TRUE);
//自己单位
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
//立项批复后 都可以
query.gt(Project::getStatus, ProjectStatusEnum.APPROVED_AFTER_CHOICE.getCode());
Page<Project> page = projectService.page(req.page(), query);


+ 1
- 42
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml View File

@@ -235,12 +235,6 @@
<if test="req.id != null">
and b.id = #{req.id}
</if>
<if test="req.regionCode != null and req.regionCode != ''">
and b.base_area_code = concat(#{req.regionCode},'000')
</if>
<if test="req.areaCode != null and req.areaCode != ''">
and b.base_area_code = concat(#{req.regionCode},'000')
</if>
<if test="req.projectName != null and req.projectName != ''">
and b.base_proj_name like concat('%',#{req.projectName},'%')
</if>
@@ -350,12 +344,6 @@
<if test="req.id != null">
and p.id = #{req.id}
</if>
<if test="req.regionCode != null and req.regionCode != ''">
and p.area_code = #{req.regionCode}
</if>
<if test="req.areaCode != null and req.areaCode != ''">
and p.area_code = #{req.areaCode}
</if>
<if test="req.projectName != null and req.projectName != ''">
and p.project_name like concat('%',#{req.projectName},'%')
</if>
@@ -399,17 +387,6 @@
and (p.build_org_code = #{req.userValue} or
(p.stage = 10000 and p.status = 10003 and p.super_org_code = #{req.userValue}))
</if>
<if test="req.userType != null and req.userType == 'region'">
<if test="req.regionCodes != null">
and p.area_code in
<foreach close=")" collection="req.regionCodes" item="code" open="(" separator=",">
#{code}
</foreach>
</if>
<if test="req.userRegionCode != null">
and p.area_code = #{req.userRegionCode}
</if>
</if>
UNION ALL
(
SELECT
@@ -441,12 +418,6 @@
<if test="req.id != null">
and b.id = #{req.id}
</if>
<if test="req.regionCode != null and req.regionCode != ''">
and b.base_area_code = concat(#{req.regionCode},'000')
</if>
<if test="req.areaCode != null and req.areaCode != ''">
and b.base_area_code = concat(#{req.regionCode},'000')
</if>
<if test="req.projectName != null and req.projectName != ''">
and b.base_proj_name like concat('%',#{req.projectName},'%')
</if>
@@ -488,19 +459,7 @@
</if>
<if test="req.userType != null and req.userType == 'org'">
and b.base_build_deprt_ding = #{req.userValue}
</if>
<if test="req.userType != null and req.userType == 'region'">
<if test="req.regionCodes != null">
and b.base_area_code in
<foreach close=")" collection="req.regionCodes" item="code" open="(" separator=",">
concat(#{code},'000')
</foreach>
</if>
<if test="req.userRegionCode != null">
and b.base_area_code = concat(#{req.userRegionCode},'000')
</if>
</if>
)
</if>)
) ORDER BY update_on DESC
</select>
</mapper>

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

@@ -8,8 +8,8 @@ import org.apache.commons.lang3.StringUtils;
import java.util.Objects;

/**
*
* 实例类型枚举
*
* @author CMM
* @since 2023/02/24 16:14
*/
@@ -22,13 +22,13 @@ public enum InstTypeEnum {
*/
UNIT_INNER_AUDIT(1, "单位内部审批流程"),
PRELIMINARY_PREVIEW(2, "项目预审审批流程"),
DEPT_UNITED_REVIEW(3,"部门联合审批流程"),
CONSTRUCTION_PLAN_REVIEW(4,"建设方案审批流程"),
PROJECT_FINAL_INSPECTION(5,"验收申报审批流程"),
DEPT_UNITED_REVIEW(3, "部门联合审批流程"),
CONSTRUCTION_PLAN_REVIEW(4, "建设方案审批流程"),
PROJECT_FINAL_INSPECTION(5, "验收申报审批流程"),

APPLY_DELAY(6,"申请延期审批流程"),
APPLY_DELAY(6, "申请延期审批流程"),

APPLY_BORROW(7,"申请借阅审批流程");
APPLY_BORROW(7, "申请借阅审批流程");

private Integer code;
private String desc;
@@ -56,4 +56,9 @@ public enum InstTypeEnum {
}
return null;
}

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

}

+ 0
- 9
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectListReq.java View File

@@ -30,15 +30,6 @@ public class ProjectListReq extends PagePo {

private Long id;

@ApiModelProperty("区域编码")
private String regionCode;

@ApiModelProperty("区域编码")
private String areaCode;

@ApiModelProperty("区域等级")
private Integer regionLevel = 3;

@ApiModelProperty("项目名称")
private String projectName;



+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/safety/manage/SafetyRiskManage.java View File

@@ -65,7 +65,6 @@ public class SafetyRiskManage {
public PageVo<ProjectMonitorVO> personMonitorList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
.eq(StringUtils.isNotBlank(req.getRegionCode()), Project::getAreaCode, req.getRegionCode())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName())
.orderByDesc(Project::getUpdateOn);


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/CcTaskListener.java View File

@@ -114,7 +114,7 @@ public class CcTaskListener {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(Long.valueOf(task.getUserId()));

//发送消息
noticeManage.sendNotice(task.getUserId(), Objects.nonNull(user) ? user.getUserId() : 93L, project, instance.getProcessDefinitionName(),
noticeManage.sendNotice(Objects.nonNull(user) ? user.getUserId() : 93L, project, instance.getProcessDefinitionName(),
CC_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_CC);
});
}

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

@@ -208,7 +208,7 @@ public class ProcessEndListener {
// 当前项目状态是部门联审中
case DEPARTMENT_JOINT_REVIEW:
//如果是 区县 并且 500万及以上要推送省局重大项目
if (!StateMachineUtil.isCityProject(declaredProject) &&
if (!StateMachineUtil.isCityProject() &&
StateMachineUtil.judgeDeclareAmount(declaredProject,
ProjectDeclareConst.Number.DECLARE_COUNTY_AMOUNT_JUDGEMENT)) {
try {
@@ -235,8 +235,7 @@ public class ProcessEndListener {
}
}
//发送消息
noticeManage.sendNotice(instance.getStartUserId(), userId, declaredProject, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS);
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(), PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS);
} else {
// 若有下一个审核人(当前节点的用户),会签/或签会有多个
// 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。
@@ -246,7 +245,7 @@ public class ProcessEndListener {
throw new BizException("审核人信息不存在!");
}
//发送消息
noticeManage.sendNotice(currentEmployeeCode, userId, declaredProject, instance.getProcessDefinitionName(),
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
}
}


+ 6
- 8
hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/NoticeManage.java View File

@@ -203,25 +203,24 @@ public class NoticeManage {
/**
* 发送消息
*
* @param employeeCode 员工号
* @param userId 用户ID
* @param project 项目
* @param procDefinitionName 流程定义名
* @param template 消息模板内容
* @param msgTypeEnum 枚举
*/
public void sendNotice(String employeeCode, Long userId, Project project, String procDefinitionName,
public void sendNotice(Long userId, Project project, String procDefinitionName,
String template, MsgTypeEnum msgTypeEnum) {
// 获取发送浙政钉工作通知必要信息
WorkNoticeInfo passWorkNoticeInfo = getSendWorkNoticeInfo(employeeCode);
String passMsg = String.format(template, project.getProjectName(), procDefinitionName);
passWorkNoticeInfo.setMsg(passMsg);
// 放入系统通知表中,保存记录
Notify notify = assemblyAuditNotify(userId, project, passMsg);
notify.setType(msgTypeEnum.name());
notifyService.save(notify);
// 放入工作通知暂存表中,通过扫表异步发送
workNoticeStagingService.addByWorkNotice(passWorkNoticeInfo, msgTypeEnum);
// WorkNoticeInfo passWorkNoticeInfo = getSendWorkNoticeInfo(employeeCode);
// passWorkNoticeInfo.setMsg(passMsg);
// workNoticeStagingService.addByWorkNotice(passWorkNoticeInfo, msgTypeEnum);
}

/**
@@ -294,7 +293,7 @@ public class NoticeManage {
* @param template
* @param msgTypeEnum
*/
public void sendFirtUser(Project project, String formName, String instanceId, String template, MsgTypeEnum msgTypeEnum) {
public void sendFirstUser(Project project, String formName, String instanceId, String template, MsgTypeEnum msgTypeEnum) {
try {
List<ActivityInstance> activityInstances = runtimeService.createActivityInstanceQuery()
.processInstanceId(instanceId)
@@ -306,8 +305,7 @@ public class NoticeManage {
for (ActivityInstance activityInstance : activityInstances) {
if (StringUtils.isNotBlank(activityInstance.getAssignee())) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(Long.valueOf(activityInstance.getAssignee()));
sendNotice(activityInstance.getAssignee(), user.getUserId(), project, formName,
template, msgTypeEnum);
sendNotice(user.getUserId(), project, formName, template, msgTypeEnum);
}
}
} catch (Exception e) {


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/UserGuidanceManage.java View File

@@ -79,7 +79,7 @@ public class UserGuidanceManage {
Integer finishedNum = 0;
//1.去查询 用户所在单位 有没有单位默认流程配置 并且process 不能为空
WflowOrgModels orgModel = orgProcdefService.getOne(Wrappers.lambdaQuery(WflowOrgModels.class)
.eq(WflowOrgModels::getOrgCode, user.getMhUnitId())
.eq(WflowOrgModels::getOrgCode, user.getMhUnitIdStr())
.eq(WflowOrgModels::getType, ProcessDefTypeEnum.DEFAULT.name())
.eq(WflowOrgModels::getIsDelete, Boolean.FALSE)
.last(BizConst.LIMIT_1));
@@ -105,7 +105,7 @@ public class UserGuidanceManage {
signatureGuidance.setRemark(UserGuidanceContant.Signature.GUIDANCE_REMARK);
signatureGuidance.setPath(UserGuidanceContant.Signature.GUIDANCE_PATH);
CompanySignature signature = signatureService.getOne(Wrappers.lambdaQuery(CompanySignature.class)
.eq(CompanySignature::getOrganizationCode, user.getMhUnitId())
.eq(CompanySignature::getOrganizationCode, user.getMhUnitIdStr())
.last(BizConst.LIMIT_1));
if (Objects.isNull(signature)) {
signatureGuidance.setIsFinish(Boolean.FALSE);


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/sys/utils/EarlyWarningUtil.java View File

@@ -49,10 +49,10 @@ public class EarlyWarningUtil {
if (user.getSuperAdmin()) {
// 看所有
} else if (user.getIsOrgAdmin()) {
wrapper.eq(Project::getBuildOrgCode, user.getMhUnitId());
wrapper.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
} else {
//否则都只能看自己单位的
wrapper.eq(Project::getBuildOrgCode, user.getMhUnitId());
wrapper.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
}
}



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

@@ -1,70 +1,71 @@
package com.hz.pm.api.todocenter.manage;

import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.*;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.file.service.FileService;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.model.constant.ProjectDeclareConst;
import com.hz.pm.api.common.statemachine.util.StateMachineUtil;
import com.hz.pm.api.filemanage.model.entity.ProjectApplyBorrow;
import com.hz.pm.api.filemanage.service.INdProjectApplyBorrowService;
import com.hz.pm.api.projectdeclared.converter.ApplicationConverter;
import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions;
import com.hz.pm.api.projectdeclared.service.IConstrctionSuggestionsService;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.entity.ProjectDelayApply;
import com.hz.pm.api.projectlib.service.INdProjectDelayApplyService;
import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService;
import org.apache.commons.lang3.StringUtils;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.task.Comment;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.hz.pm.api.common.statemachine.util.StateMachineUtil;
import com.hz.pm.api.projectdeclared.manage.DeclaredProjectManage;
import com.hz.pm.api.projectdeclared.model.dto.ProjectDraftSaveDTO;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions;
import com.hz.pm.api.projectdeclared.service.IConstrctionSuggestionsService;
import com.hz.pm.api.projectlib.model.dto.ProjectApplicationDTO;
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.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.service.INdProjectDelayApplyService;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService;
import com.hz.pm.api.staging.enums.MsgTypeEnum;
import com.hz.pm.api.staging.service.IProjectStagingService;
import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.todocenter.constant.TodoCenterConst;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.file.service.FileService;
import com.wflow.contants.HisProInsEndActId;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.process.enums.NodeTypeEnum;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessHandlerEnum;
import com.wflow.workflow.service.ProcessInstanceService;

import cn.hutool.core.collection.CollUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.task.Comment;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.*;

/**
* @Classname HandlerManage
@@ -181,7 +182,7 @@ public class HandlerManage {
case DEPARTMENT_JOINT_REVIEW:
log.info("部门联审成功后 要判断是否是 区县重大项目");

Boolean isImport = !StateMachineUtil.isCityProject(declaredProject) &&
boolean isImport = !StateMachineUtil.isCityProject() &&
StateMachineUtil.judgeDeclareAmount(declaredProject,
ProjectDeclareConst.Number.DECLARE_COUNTY_AMOUNT_JUDGEMENT);
log.info("isImport :{}", isImport);
@@ -199,8 +200,8 @@ public class HandlerManage {
log.info("区县推送省级联审失败[{}],{}", declaredProject.getProjectName(), e.getMessage());
log.error("区县推送省级联审失败:" + e);
}
break;
}
break;
// 当前项目状态是单位内部审核中
case UNDER_INTERNAL_AUDIT:
// 当前项目状态是方案评审中
@@ -218,8 +219,7 @@ public class HandlerManage {
}
}
//发送消息
noticeManage.sendNotice(instance.getStartUserId(), userId, declaredProject, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS);
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(), PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS);
} else {
// 若有下一个审核人(当前节点的用户),会签/或签会有多个
// 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。
@@ -229,7 +229,7 @@ public class HandlerManage {
throw new BizException("审核人信息不存在!");
}
//发送消息
noticeManage.sendNotice(currentEmployeeCode, userId, declaredProject, instance.getProcessDefinitionName(),
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
}
}
@@ -316,7 +316,7 @@ public class HandlerManage {
updateRejectProjectStatus(userId, declaredProject, instType);
}
//发送消息
noticeManage.sendNotice(instance.getStartUserId(), userId, declaredProject, instance.getProcessDefinitionName(),
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(),
REJECT_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_REJECT);
}

@@ -412,26 +412,24 @@ public class HandlerManage {
}
// 给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。
//发送消息
noticeManage.sendNotice(instance.getStartUserId(), userId, declaredProject, instance.getProcessDefinitionName(),
BACK_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_BACK);
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(), BACK_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_BACK);
}


/**
* 当为通过操作时,更新项目表中项目状态
*
* @param userId
* @param declaredProject
* @return void
* @param userId \
* @param project \
* @author CMM
* @since 2023/02/08
*/
public void updatePassProjectStatus(Long userId, Project declaredProject) {
public void updatePassProjectStatus(Long userId, Project project) {
try {
stateMachineUtil.pass(declaredProject);
declaredProject.setUpdateOn(LocalDateTime.now());
declaredProject.setUpdateBy(userId);
projectService.updateById(declaredProject);
stateMachineUtil.pass(project);
project.setUpdateOn(LocalDateTime.now());
project.setUpdateBy(userId);
projectService.updateById(project);
} catch (Exception e) {
log.error("状态机执行失败", e);
throw new BizException("状态机执行失败!");
@@ -441,76 +439,76 @@ public class HandlerManage {
/**
* 当为驳回操作时,更新项目表中的项目状态
*
* @param userId
* @param declaredProject
* @param instType
* @return void
* @param userId \
* @param project \
* @param instType \
* @author CMM
* @since 2023/02/08
*/
private void updateRejectProjectStatus(Long userId, Project declaredProject, Integer instType) {
stateMachineUtil.reject(declaredProject);
private void updateRejectProjectStatus(Long userId, Project project, Integer instType) {
stateMachineUtil.reject(project);
LambdaUpdateWrapper<Project> updateWrapper = Wrappers.lambdaUpdate();
declaredProject.setUpdateOn(LocalDateTime.now());
declaredProject.setUpdateBy(userId);
projectService.updateById(declaredProject);
project.setUpdateOn(LocalDateTime.now());
project.setUpdateBy(userId);
projectService.updateById(project);
// 如果是预审审批驳回,需要重新盖章,原来盖过章的文件要清空
if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)) {
if (InstTypeEnum.PRELIMINARY_PREVIEW.eq(instType)) {
updateWrapper.set(Project::getPretrialFileId, null)
.set(Project::getPretrialFileName, null)
.eq(Project::getId, declaredProject.getId());
projectService.update(updateWrapper);
} else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)) {
.eq(Project::getId, project.getId());
} else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.eq(instType)) {
updateWrapper.set(Project::getConstructFileId, null)
.set(Project::getConstructFileName, null)
.eq(Project::getId, declaredProject.getId());
projectService.update(updateWrapper);
.eq(Project::getId, project.getId());
} else {
return;
}
projectService.update(updateWrapper);
}

/**
* 当为撤回操作时,更新项目表中的项目状态为前一个状态
*
* @param userId
* @param declaredProject
* @param project
* @return void
* @author CMM
* @since 2023/02/08
*/
@Transactional(rollbackFor = Exception.class)
public void updateWithdrawProjectStatus(Long userId, Project declaredProject) {
public void updateWithdrawProjectStatus(Long userId, Project project) {
// 删除关联表信息
projectInstService.remove(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getProjectId, declaredProject.getId())
.eq(ProjectInst::getInstCode, declaredProject.getInstCode()));
.eq(ProjectInst::getProjectId, project.getId())
.eq(ProjectInst::getInstCode, project.getInstCode()));
//删除项目的实例信息
historyService.deleteHistoricProcessInstance(declaredProject.getInstCode());
historyService.deleteHistoricProcessInstance(project.getInstCode());

stateMachineUtil.withDraw(declaredProject);
declaredProject.setUpdateOn(LocalDateTime.now());
declaredProject.setUpdateBy(userId);
declaredProject.setInstCode(TodoCenterConst.Declared.NULL_INST_CODE);
projectService.updateById(declaredProject);
stateMachineUtil.withDraw(project);
project.setUpdateOn(LocalDateTime.now());
project.setUpdateBy(userId);
project.setInstCode(TodoCenterConst.Declared.NULL_INST_CODE);
projectService.updateById(project);
}

public void deleteBackComments(List<HistoricVariableInstance> approves) {
if (CollUtil.isNotEmpty(approves)) {
for (HistoricVariableInstance approve : approves) {
if (approve.getValue() instanceof ProcessHandlerEnum) {
if (ProcessHandlerEnum.BACK.equals(ProcessHandlerEnum.getEnumByName(String.valueOf(approve.getValue())))) {
runtimeService.removeVariable(approve.getProcessInstanceId(), approve.getVariableName());

Comment comment;
Optional<Comment> first = taskService.getProcessInstanceComments(approve.getProcessInstanceId())
.stream()
.filter(c -> c.getTaskId().equals(approve.getVariableName().replace("approve_", StringUtils.EMPTY)))
.findFirst();
if (first.isPresent()) {
comment = first.get();
taskService.deleteComment(comment.getId());
}
break;
if (approve.getValue() instanceof ProcessHandlerEnum
&& (ProcessHandlerEnum.BACK.equals(ProcessHandlerEnum.getEnumByName(String.valueOf(approve.getValue()))))) {
runtimeService.removeVariable(approve.getProcessInstanceId(), approve.getVariableName());

Comment comment;
Optional<Comment> first = taskService.getProcessInstanceComments(approve.getProcessInstanceId())
.stream()
.filter(c -> c.getTaskId().equals(approve.getVariableName().replace("approve_", StringUtils.EMPTY)))
.findFirst();
if (first.isPresent()) {
comment = first.get();
taskService.deleteComment(comment.getId());
}
break;

}
}
}


+ 2
- 6
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java View File

@@ -154,12 +154,8 @@ public class TodoCenterManage {
* @since 2023/02/18
*/
public PageVo<ResToBeProcessedVO> todoProjectList(ToBeProcessedReq param) {
String userIdStr = String.valueOf(param.getUserId());
if (StringUtils.isBlank(userIdStr)) {
// 获取登录用户ID
Long userId = Optional.ofNullable(param.getLoginUserId()).orElseGet(LoginUserUtil::getUserId);
userIdStr = String.valueOf(userId);
}
Long userId = Optional.ofNullable(param.getUserId()).orElseGet(LoginUserUtil::getUserId);
String userIdStr = String.valueOf(userId);

// 查出项目库项目
ProjectListReq projectListReq = new ProjectListReq();


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/impl/TodoServiceImpl.java View File

@@ -62,7 +62,7 @@ public class TodoServiceImpl implements ITodoService {
*/
@Override
public ProcessProgressDetailVO getProcessDetail(ProcessDetailReq request) {
String employeeCode = LoginUserUtil.loginUserDetail().getEmployeeCode();
String employeeCode = LoginUserUtil.loginUserDetail().getUserIdStr();
String instanceId = request.getInstanceId();
String nodeId = request.getNodeId();
Long projectId = request.getProjectId();


+ 1
- 1
hz-pm-api/src/main/resources/application-dev.yml View File

@@ -43,7 +43,7 @@ spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driverClassName: dm.jdbc.driver.DmDriver
url: jdbc:dm://47.98.125.47:5236/HZ_PROJECT_MANAGEMENT1?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
url: jdbc:dm://47.98.125.47:5236/HZ_PROJECT_MANAGEMENT1?nullToEmpty=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
username: SYSDBA
password: SYSDBA
# 数据源


+ 11
- 11
hz-pm-api/src/test/java/com/hz/pm/api/sys/service/IMenuServiceTest.java View File

@@ -6,14 +6,14 @@ import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.AppTests;
import com.hz.pm.api.sys.model.entity.Menu;
import com.hz.pm.api.sys.model.entity.Role;
import com.hz.pm.api.sys.model.entity.RoleMenu;
import com.hz.pm.api.sys.model.entity.UserRole;
import com.hz.pm.api.user.model.enumeration.RoleEnum;
import com.wflow.bean.entity.WflowOrgModels;
import com.wflow.service.OrgProcdefService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

@@ -112,16 +112,16 @@ class IMenuServiceTest extends AppTests {
});
}

@Autowired
private OrgProcdefService orgProcdefService;

@Test
public void test1(){
List<Integer> roleIds = Arrays.asList(1, 2);
LambdaQueryWrapper<UserRole> urQuery = Wrappers.lambdaQuery(UserRole.class)
.select(UserRole::getUserId).in(UserRole::getRoleId,roleIds);
System.out.println(urQuery.toString());
System.out.println(urQuery.getSqlSelect());
System.out.println(urQuery.getTargetSql());
System.out.println(urQuery.getSqlComment());
System.out.println(urQuery.getSqlSet());
public void test1() {
WflowOrgModels orgModel = orgProcdefService.getOne(Wrappers.lambdaQuery(WflowOrgModels.class)
.eq(WflowOrgModels::getOrgCode, null)
.eq(WflowOrgModels::getType, "DEFAULT")
.eq(WflowOrgModels::getIsDelete, Boolean.FALSE)
.last("limit 1"));
}

}

Loading…
Cancel
Save