|
|
@@ -29,6 +29,7 @@ import com.wflow.workflow.notify.event.NodeCreateEvent; |
|
|
|
import com.wflow.workflow.service.ProcessModelHistorysService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.flowable.engine.HistoryService; |
|
|
|
import org.flowable.engine.TaskService; |
|
|
|
import org.flowable.task.api.Task; |
|
|
|
import org.flowable.task.api.history.HistoricTaskInstance; |
|
|
@@ -54,6 +55,7 @@ import static com.hz.pm.api.common.util.ThreadPoolUtil.SCHEDULER; |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class TaskCreatedListener { |
|
|
|
|
|
|
|
private final HistoryService historyService; |
|
|
|
private final IProjectService projectService; |
|
|
|
private final IProjectInstService projectInstService; |
|
|
|
private final ProcessModelHistorysService processModelHistorysService; |
|
|
@@ -165,7 +167,7 @@ public class TaskCreatedListener { |
|
|
|
WflowModelHistorys models = processModelHistorysService.getByProcessDefId(procDefId); |
|
|
|
ProjectProcessType procType = ProjectProcessType.getNoNull(models.getProcessType()); |
|
|
|
WflowHelper wflowHelper = SpringUtil.getBean(WflowHelper.class); |
|
|
|
Task task = taskService.createTaskQuery() |
|
|
|
HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery() |
|
|
|
.taskId(event.getTaskId()) |
|
|
|
.singleResult(); |
|
|
|
boolean orUserTask = wflowHelper.isOrUserTask(procDefId, task.getTaskDefinitionKey()); |
|
|
@@ -181,6 +183,7 @@ public class TaskCreatedListener { |
|
|
|
case COMPLIANCE_REVIEW: |
|
|
|
case PROJECT_REVIEW: |
|
|
|
MHTodoTypeEnum todoType = getMhTodoTypeEnum(procType); |
|
|
|
log.info("完成任务: {} 信产待办:{}", event.getTaskId(), todoType); |
|
|
|
if (orUserTask) { |
|
|
|
List<HistoricTaskInstance> tasks = wflowHelper.listFinishedTasks(task.getTaskDefinitionKey()); |
|
|
|
Set<String> taskIds = CollUtils.fieldSet(tasks, HistoricTaskInstance::getId); |
|
|
|