| | |
| | | |
| | | @Autowired |
| | | private FlowTransferService flowTransferService; |
| | | @Autowired |
| | | private FlowCommonService flowCommonService; |
| | | /** |
| | | * 待办任务列表页 |
| | | */ |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @Operation(summary = "上一步审批人查询", description = "上一步审批人查询,返回审批人id") |
| | | public R<String> previusApproveUserId(@Parameter(description = "部门ID") String processInstanceId) { |
| | | // 获取历史任务实例 |
| | | List<HistoricTaskInstance> historicTasks = historyService.createHistoricTaskInstanceQuery() |
| | | .processInstanceId(processInstanceId) |
| | | .orderByHistoricTaskInstanceEndTime().asc() |
| | | .list(); |
| | | |
| | | // 获取上一个已完成的任务 |
| | | String assignee = ""; |
| | | if(historicTasks.size()>1) { |
| | | assignee = historicTasks.get(historicTasks.size() - 2).getAssignee(); |
| | | } |
| | | return R.data(assignee); |
| | | |
| | | return R.data(this.flowCommonService.previusAssignee(processInstanceId)); |
| | | } |
| | | } |