Browse Source

debug 条件分支 因为前端没传parentType引发的条线问题

tags/24080901
PoffyZhang 1 year ago
parent
commit
410cd280f5
2 changed files with 8 additions and 6 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/ProjectStatusFlowTask.java
  2. +7
    -5
      pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/ProjectStatusFlowTask.java View File

@@ -43,7 +43,7 @@ public class ProjectStatusFlowTask {
@Scheduled(cron = "0 */1 * * * ?")
public void statusFlow() throws UnknownHostException {
//测试暂时用自己207
if (TaskContant.Host.HOST_207.equals(InetAddress.getLocalHost().getHostName())) {
if (TaskContant.Host.HOST_ZPF.equals(InetAddress.getLocalHost().getHostName())) {
//1. 定时取 项目暂存表的数据 去进行状态继续流转
List<ProjectStaging> stagingList = projectStagingService.list(Wrappers.lambdaQuery(ProjectStaging.class)
.eq(ProjectStaging::getDead,Boolean.FALSE)


+ 7
- 5
pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java View File

@@ -5,6 +5,7 @@ import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

@@ -21,13 +22,14 @@ public class StateMachineTest extends AppTests {
@Autowired
private StateMachineUtils stateMachineUtils;

@Autowired
private IProjectService projectService;

@Test
public void stateMachineTest() {
Project project = new Project();
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
project.setDeclareAmount(BigDecimal.valueOf(2000));
stateMachineUtils.withDraw(project);
Project project = projectService.getById(292);
stateMachineUtils.pass(project);
System.out.println(String.format("project:%s", JSON.toJSONString(project)));
projectService.updateById(project);
}
}

Loading…
Cancel
Save