From 8263635b28d0a99c69d32c94e27cbb1e6c75e08b Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 30 Jun 2023 09:53:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=BF=9B=E5=BA=A6=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/statemachine/util/StateMachineUtils.java | 1 + .../ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java | 6 +++--- .../pmapi/projectlib/model/entity/ProjectStatusChange.java | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java index ec65e8c..3f88703 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java @@ -89,6 +89,7 @@ public class StateMachineUtils { projectStatusChange.setAfterStatus(project.getStatus()); projectStatusChange.setEvent(event.name()); projectStatusChange.setCreateOn(LocalDateTime.now()); + projectStatusChange.setProjectCode(project.getProjectCode()); // 插入项目状态变更表中 projectStatusChangeService.save(projectStatusChange); log.info("调用状态机后的项目状态为>>>>>>>>>>{}" + project.getStatus()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java index 88814c9..6f7c652 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java @@ -81,16 +81,16 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { if (ProjectStatusEnum.TO_BE_APPROVED.getCode().equals(status)){ // 根据建设方案评审通过的时间获取 ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) - .eq(ProjectStatusChange::getProjectId, projectId) + .eq(ProjectStatusChange::getProjectCode, project.getProjectCode()) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PLAN_REVIEW_PASS.name()) .last("limit 1")); processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); - } else { + } else { // 取 状态机 改变状态时间 ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) - .eq(ProjectStatusChange::getProjectId, projectId) + .eq(ProjectStatusChange::getProjectCode, project.getProjectCode()) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PROJECT_APPROVAL.name()) .last("limit 1")); if (Objects.nonNull(projectStatusChange)) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectStatusChange.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectStatusChange.java index b4cef13..ba55b15 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectStatusChange.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectStatusChange.java @@ -48,4 +48,9 @@ public class ProjectStatusChange implements Serializable { @ApiModelProperty("状态变更发生的时间") private LocalDateTime createOn; + + @ApiModelProperty("项目code") + private String projectCode; + + }