| | |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.flowable.engine.HistoryService; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.engine.task.Comment; |
| | | import org.flowable.task.api.history.HistoricTaskInstance; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineExcelVO; |
| | | import org.springblade.mdm.flow.service.ApproveRecordService; |
| | | import org.springblade.mdm.flow.service.FlowBusinessService; |
| | | import org.springblade.mdm.flow.vo.FlowVO; |
| | | import org.springblade.mdm.flow.vo.OvertimeTaskExcelVO; |
| | |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private FlowBusinessService businessService; |
| | | |
| | | @Autowired |
| | | private HistoryService historyService; |
| | | |
| | | |
| | | @GetMapping("overtime-list") |
| | | @ApiOperationSupport(order = 3) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Operation(summary = "流程执行轨迹", description = "流程执行轨迹") |
| | | @GetMapping("process-trace") |
| | | public R<List<TaskTraceVO>> processTrace(long processInstanceId){ |
| | | return R.data(Collections.emptyList()); |
| | | public R<List<TaskTraceVO>> processTrace(String processInstanceId){ |
| | | List<TaskTraceVO> result = new ArrayList<>(); |
| | | List<HistoricTaskInstance> hisTasks = historyService.createHistoricTaskInstanceQuery() |
| | | .processInstanceId(processInstanceId).orderByTaskCreateTime().desc().list(); |
| | | // 批注信息 |
| | | List<Comment> comments; |
| | | for (HistoricTaskInstance hisTask : hisTasks) { |
| | | TaskTraceVO vo = new TaskTraceVO(); |
| | | BeanUtils.copyProperties(hisTask, vo); |
| | | comments = taskService.getTaskComments(hisTask.getId()); |
| | | if(!comments.isEmpty()) { |
| | | vo.setComment(comments.get(0).getFullMessage()); |
| | | } |
| | | result.add(vo); |
| | | } |
| | | |
| | | return R.data(result); |
| | | } |
| | | |
| | | |