@@ -91,7 +91,7 @@ public class ProjectDeclareStateMachineBuilder { | |||||
.withChoice() | .withChoice() | ||||
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | .source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | ||||
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),projectDeclareAction.new ProjectDeclareChoiceAction()) | .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() | .withExternal() | ||||
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION) | .source(ProjectStatusEnum.PENDING_PREQUALIFICATION) | ||||
@@ -127,11 +127,11 @@ public class ProjectDeclareStateMachineBuilder { | |||||
.source(ProjectStatusEnum.PRE_APPLYING) | .source(ProjectStatusEnum.PRE_APPLYING) | ||||
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | .target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | ||||
.event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and() | .event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and() | ||||
// 预审中撤回,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | |||||
// 预审中撤回,从待预审选择->省级部门联审中,待预审,完成其中一种状态 | |||||
.withChoice() | .withChoice() | ||||
.source(ProjectStatusEnum.PRE_APPLYING) | .source(ProjectStatusEnum.PRE_APPLYING) | ||||
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction()) | .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() | .withExternal() | ||||
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) | .source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) | ||||
@@ -40,10 +40,4 @@ public class ProjectLibController { | |||||
return projectLibManage.getProjectDetail(id); | return projectLibManage.getProjectDetail(id); | ||||
} | } | ||||
@GetMapping("/getProjectInfo") | |||||
@ApiOperation("获取申报项目信息") | |||||
private Project getProjectInfo (@RequestParam String processInstanceId){ | |||||
return projectLibManage.getProjectInfo(processInstanceId); | |||||
} | |||||
} | } |
@@ -95,17 +95,4 @@ public class ProjectLibManage { | |||||
return vo; | 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; | |||||
} | |||||
} | } |
@@ -161,6 +161,7 @@ public class TodoCenterManage { | |||||
List<ResToBeProcessedDTO> resVos = results.stream().map(d -> { | List<ResToBeProcessedDTO> resVos = results.stream().map(d -> { | ||||
ResToBeProcessedDTO res = new ResToBeProcessedDTO(); | ResToBeProcessedDTO res = new ResToBeProcessedDTO(); | ||||
BeanUtils.copyProperties(d, res); | BeanUtils.copyProperties(d, res); | ||||
res.setProjectId(d.getId()); | |||||
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); | res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); | ||||
LocalDateTime processLaunchTime = d.getCreateOn(); | LocalDateTime processLaunchTime = d.getCreateOn(); | ||||
String format = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); | String format = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); | ||||
@@ -952,6 +953,7 @@ public class TodoCenterManage { | |||||
ResToBeProcessedDTO res = new ResToBeProcessedDTO(); | ResToBeProcessedDTO res = new ResToBeProcessedDTO(); | ||||
BeanUtils.copyProperties(d, res); | BeanUtils.copyProperties(d, res); | ||||
res.setProjectId(d.getId()); | |||||
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); | res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); | ||||
LocalDateTime processLaunchTime = d.getCreateOn(); | LocalDateTime processLaunchTime = d.getCreateOn(); | ||||
String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); | String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); | ||||
@@ -1124,6 +1126,7 @@ public class TodoCenterManage { | |||||
results.stream().map(d -> { | results.stream().map(d -> { | ||||
ResToBeProcessedDTO res = new ResToBeProcessedDTO(); | ResToBeProcessedDTO res = new ResToBeProcessedDTO(); | ||||
BeanUtils.copyProperties(d, res); | BeanUtils.copyProperties(d, res); | ||||
res.setProjectId(d.getId()); | |||||
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); | res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); | ||||
LocalDateTime processLaunchTime = d.getCreateOn(); | LocalDateTime processLaunchTime = d.getCreateOn(); | ||||
String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); | String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); | ||||
@@ -1330,6 +1333,7 @@ public class TodoCenterManage { | |||||
results.stream().map(d -> { | results.stream().map(d -> { | ||||
ResToBeProcessedDTO res = new ResToBeProcessedDTO(); | ResToBeProcessedDTO res = new ResToBeProcessedDTO(); | ||||
BeanUtils.copyProperties(d, res); | BeanUtils.copyProperties(d, res); | ||||
res.setProjectId(d.getId()); | |||||
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); | res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); | ||||
LocalDateTime processLaunchTime = d.getCreateOn(); | LocalDateTime processLaunchTime = d.getCreateOn(); | ||||
String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); | String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); | ||||
@@ -29,6 +29,9 @@ import org.springframework.format.annotation.DateTimeFormat; | |||||
public class ResToBeProcessedDTO implements Serializable { | public class ResToBeProcessedDTO implements Serializable { | ||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@ApiModelProperty("项目ID") | |||||
private Long projectId; | |||||
@ApiModelProperty("流程实例编号") | @ApiModelProperty("流程实例编号") | ||||
private String instanceCode; | private String instanceCode; | ||||
@@ -8,6 +8,8 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import java.math.BigDecimal; | |||||
/** | /** | ||||
* 状态机测试 | * 状态机测试 | ||||
* | * | ||||
@@ -22,7 +24,9 @@ public class StateMachineTest extends AppTests { | |||||
@Test | @Test | ||||
public void stateMachineTest() throws Exception { | public void stateMachineTest() throws Exception { | ||||
Project project = new Project(); | 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())); | |||||
} | } | ||||
} | } |