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; + + }