From d20d78afe592f6228d1c7a64bf58e9feb44ca769 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 13 Feb 2023 10:23:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=BA=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=88=86=E6=94=AF=E5=88=A4=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../builder/ProjectDeclareStateMachineBuilder.java | 6 +++--- .../pmapi/projectlib/controller/ProjectLibController.java | 6 ------ .../pmapi/projectlib/manage/ProjectLibManage.java | 13 ------------- .../pmapi/todocenter/manage/TodoCenterManage.java | 4 ++++ .../pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java | 3 +++ .../com/ningdatech/pmapi/statemachine/StateMachineTest.java | 8 ++++++-- 6 files changed, 16 insertions(+), 24 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java index 4283c0c..117c2af 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java @@ -91,7 +91,7 @@ public class ProjectDeclareStateMachineBuilder { .withChoice() .source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),projectDeclareAction.new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PRE_APPLYING).and() + .last(ProjectStatusEnum.PRE_APPLYING,projectDeclareAction.new ProjectDeclareChoiceAction()).and() // 待预审撤回,从待预审到单位内部审核中 .withExternal() .source(ProjectStatusEnum.PENDING_PREQUALIFICATION) @@ -127,11 +127,11 @@ public class ProjectDeclareStateMachineBuilder { .source(ProjectStatusEnum.PRE_APPLYING) .target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) .event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and() - // 预审中撤回,从待预审选择->省级部门联审中,预审中,完成其中一种状态 + // 预审中撤回,从待预审选择->省级部门联审中,待预审,完成其中一种状态 .withChoice() .source(ProjectStatusEnum.PRE_APPLYING) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PRE_APPLYING).and() + .last(ProjectStatusEnum.PENDING_PREQUALIFICATION,projectDeclareAction.new ProjectDeclareChoiceAction()).and() // 部门联审通过,从部门联审中到年度计划中 .withExternal() .source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java index a929f2e..0f9a893 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java @@ -40,10 +40,4 @@ public class ProjectLibController { return projectLibManage.getProjectDetail(id); } - @GetMapping("/getProjectInfo") - @ApiOperation("获取申报项目信息") - private Project getProjectInfo (@RequestParam String processInstanceId){ - return projectLibManage.getProjectInfo(processInstanceId); - } - } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 2e809cd..c3cbd08 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -95,17 +95,4 @@ public class ProjectLibManage { return vo; } - /** - * - * @param instanceCode 申报项目流程实例编号 - * @return com.ningdatech.pmapi.projectlib.model.entity.Project - * @author CMM - * @since 2023/02/11 11:15 - */ - public Project getProjectInfo(String instanceCode) { - // 查询项目申报信息 - Project projectInfo = projectService.getOne(Wrappers.lambdaQuery(Project.class) - .eq(Project::getInstCode, instanceCode)); - return projectInfo; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 1060fc6..cbb2d69 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -161,6 +161,7 @@ public class TodoCenterManage { List resVos = results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String format = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); @@ -952,6 +953,7 @@ public class TodoCenterManage { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); @@ -1124,6 +1126,7 @@ public class TodoCenterManage { results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); @@ -1330,6 +1333,7 @@ public class TodoCenterManage { results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java index 88725c1..f03e734 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java @@ -29,6 +29,9 @@ import org.springframework.format.annotation.DateTimeFormat; public class ResToBeProcessedDTO implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty("项目ID") + private Long projectId; + @ApiModelProperty("流程实例编号") private String instanceCode; diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java index d9ed6e6..1819a47 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java @@ -8,6 +8,8 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import java.math.BigDecimal; + /** * 状态机测试 * @@ -22,7 +24,9 @@ public class StateMachineTest extends AppTests { @Test public void stateMachineTest() throws Exception { Project project = new Project(); - project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); - stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS); + project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + project.setDeclareAmount(BigDecimal.valueOf(2000)); + // stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS); + stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); } }