From 38fc4bc147f2f01f9ce2e4314d4169df2045d22a Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 20 Sep 2024 11:57:19 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E4=BB=BB=E5=8A=A1=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E7=9B=91=E5=90=AC;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hz/pm/api/scheduler/listener/TaskCreatedListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/TaskCreatedListener.java b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/TaskCreatedListener.java index ee65b68..1b9e153 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/TaskCreatedListener.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/TaskCreatedListener.java @@ -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 tasks = wflowHelper.listFinishedTasks(task.getTaskDefinitionKey()); Set taskIds = CollUtils.fieldSet(tasks, HistoricTaskInstance::getId);