| | |
| | | import org.flowable.engine.history.HistoricProcessInstanceQuery; |
| | | import org.flowable.engine.task.Comment; |
| | | import org.flowable.task.api.Task; |
| | | import org.flowable.task.api.TaskInfo; |
| | | import org.flowable.task.api.TaskInfoQuery; |
| | | import org.flowable.task.api.TaskQuery; |
| | | import org.flowable.task.api.history.HistoricTaskInstance; |
| | |
| | | public class DoneQueryService { |
| | | private final FlowProgramFileService flowProgramFileService; |
| | | private final HistoryService historyService; |
| | | private final IUserClient userClient; |
| | | private final FlowCommonService flowCommonService; |
| | | private final DoneMapper doneMapper; |
| | | // |
| | | public IPage<FlowVO> selectDonePage(IPage<FlowVO> page, String s, LocalDateTime createTimeBegin, LocalDateTime createTimeEnd, String keyword) { |
| | | private final TaskService taskService; |
| | | /** |
| | | * 查询用户已办任务分页列表 |
| | | * @param page |
| | | * @param s |
| | | * @param createTimeBegin |
| | | * @param createTimeEnd |
| | | * @param keyword |
| | | * @return |
| | | */ |
| | | public IPage<FlowVO> selectDonePage(IPage<FlowVO> page, LocalDateTime createTimeBegin, LocalDateTime createTimeEnd, String keyword) { |
| | | //已办新查询 |
| | | String userId = "" + AuthUtil.getUserId(); |
| | | DoneQueryVO queryVO = new DoneQueryVO(); |
| | |
| | | |
| | | boolean active = flowCommonService.isProcessInstanceActive(flowVO.getProcessInstanceId()); |
| | | flowVO.setProcessIsFinished((Func.toStr(!active))); |
| | | if(active){ |
| | | flowVO.setFlag(getCurrentTaskDefKeys(flowVO.getProcessInstanceId())); |
| | | } |
| | | }); |
| | | } |
| | | return pageDta; |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | String getCurrentTaskDefKeys(String processInstanceId) { |
| | | List<Task> tasks = taskService.createTaskQuery() |
| | | .processInstanceId(processInstanceId) // 根据流程实例ID查询 |
| | | .active() // 查询活动的任务 |
| | | .list(); |
| | | return tasks.stream().map(TaskInfo::getTaskDefinitionKey).collect(Collectors.joining(",")); |
| | | |
| | | } |
| | | } |