|
@@ -8,12 +8,14 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; |
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
|
|
import com.ningdatech.pmapi.todocenter.manage.HandlerManage; |
|
|
import com.wflow.workflow.notify.event.ProcessEndEvent; |
|
|
import com.wflow.workflow.notify.event.ProcessEndEvent; |
|
|
import com.wflow.workflow.notify.event.ProcessStartEvent; |
|
|
import com.wflow.workflow.notify.event.ProcessStartEvent; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.flowable.engine.HistoryService; |
|
|
import org.flowable.engine.HistoryService; |
|
|
import org.flowable.engine.TaskService; |
|
|
import org.flowable.engine.TaskService; |
|
|
|
|
|
import org.flowable.engine.history.HistoricProcessInstance; |
|
|
import org.flowable.task.api.Task; |
|
|
import org.flowable.task.api.Task; |
|
|
import org.flowable.task.api.history.HistoricTaskInstance; |
|
|
import org.flowable.task.api.history.HistoricTaskInstance; |
|
|
import org.springframework.context.event.EventListener; |
|
|
import org.springframework.context.event.EventListener; |
|
@@ -43,6 +45,8 @@ public class ProcessEndListener { |
|
|
|
|
|
|
|
|
private final StateMachineUtils stateMachineUtils; |
|
|
private final StateMachineUtils stateMachineUtils; |
|
|
|
|
|
|
|
|
|
|
|
private final HandlerManage handlerManage; |
|
|
|
|
|
|
|
|
@Async |
|
|
@Async |
|
|
@EventListener |
|
|
@EventListener |
|
|
public void onApplicationEvent(ProcessEndEvent event) { |
|
|
public void onApplicationEvent(ProcessEndEvent event) { |
|
@@ -67,6 +71,8 @@ public class ProcessEndListener { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Task> tasks = taskService.createTaskQuery() |
|
|
List<Task> tasks = taskService.createTaskQuery() |
|
|
.processInstanceId(instCode) |
|
|
.processInstanceId(instCode) |
|
|
.active() |
|
|
.active() |
|
@@ -81,9 +87,10 @@ public class ProcessEndListener { |
|
|
if (CollUtil.isEmpty(tasks) && CollUtil.isEmpty(historyTasks)) { |
|
|
if (CollUtil.isEmpty(tasks) && CollUtil.isEmpty(historyTasks)) { |
|
|
Long projectId = projectInst.getProjectId(); |
|
|
Long projectId = projectInst.getProjectId(); |
|
|
Project project = projectService.getNewProject(projectId); |
|
|
Project project = projectService.getNewProject(projectId); |
|
|
stateMachineUtils.pass(project); |
|
|
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
|
|
projectService.updateById(project); |
|
|
|
|
|
|
|
|
HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery() |
|
|
|
|
|
.processInstanceId(instCode).singleResult(); |
|
|
|
|
|
//通过审核后 所处理的逻辑 |
|
|
|
|
|
handlerManage.afterPassTodo(project,instance); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |