From 618688161567a5e92263874076c50d3d5eff48fc Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期一, 17 六月 2024 11:12:52 +0800 Subject: [PATCH] update 优化 特殊service传值方式 --- ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/ActTaskServiceImpl.java | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/ActTaskServiceImpl.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/ActTaskServiceImpl.java index 32be130..5cb288d 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/ActTaskServiceImpl.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/ActTaskServiceImpl.java @@ -10,6 +10,7 @@ import org.dromara.common.core.domain.dto.RoleDTO; import org.dromara.common.core.domain.dto.UserDTO; import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.core.service.OssService; import org.dromara.common.core.service.UserService; import org.dromara.common.core.utils.StreamUtils; import org.dromara.common.core.utils.StringUtils; @@ -78,8 +79,9 @@ private final ActHiTaskinstMapper actHiTaskinstMapper; private final IWfNodeConfigService wfNodeConfigService; private final IWfDefinitionConfigService wfDefinitionConfigService; - private final UserService userService; private final FlowProcessEventHandler flowProcessEventHandler; + private final UserService userService; + private final OssService ossService; /** * 鍚姩浠诲姟 @@ -175,7 +177,7 @@ return true; } //闄勪欢涓婁紶 - AttachmentCmd attachmentCmd = new AttachmentCmd(completeTaskBo.getFileId(), task.getId(), task.getProcessInstanceId()); + AttachmentCmd attachmentCmd = new AttachmentCmd(completeTaskBo.getFileId(), task.getId(), task.getProcessInstanceId(), ossService); managementService.executeCommand(attachmentCmd); String businessStatus = WorkflowUtils.getBusinessStatus(processInstance.getBusinessKey()); //娴佺▼鎻愪氦鐩戝惉 @@ -239,7 +241,7 @@ */ @Async public void sendMessage(List<Task> list, String name, List<String> messageType, String message) { - WorkflowUtils.sendMessage(list, name, messageType, message); + WorkflowUtils.sendMessage(list, name, messageType, message, userService); } /** @@ -273,7 +275,7 @@ List<WfNodeConfigVo> wfNodeConfigVoList = wfNodeConfigService.selectByDefIds(processDefinitionIds); for (TaskVo task : taskList) { task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus())); - task.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId())); + task.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId(), userService)); task.setMultiInstance(WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey()) != null); if (CollUtil.isNotEmpty(wfNodeConfigVoList)) { wfNodeConfigVoList.stream().filter(e -> e.getDefinitionId().equals(task.getProcessDefinitionId()) && FlowConstant.TRUE.equals(e.getApplyUserTask())).findFirst().ifPresent(task::setWfNodeConfigVo); @@ -338,7 +340,7 @@ }); } taskVo.setAssignee(StringUtils.isNotBlank(task.getAssignee()) ? Long.valueOf(task.getAssignee()) : null); - taskVo.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId())); + taskVo.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId(), userService)); taskVo.setMultiInstance(WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey()) != null); if (CollUtil.isNotEmpty(wfNodeConfigVoList)) { wfNodeConfigVoList.stream().filter(e -> e.getDefinitionId().equals(task.getProcessDefinitionId()) && FlowConstant.TRUE.equals(e.getApplyUserTask())).findFirst().ifPresent(taskVo::setWfNodeConfigVo); -- Gitblit v1.9.3