| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.mdm.basesetting.producedivision.entity.MdmUser; |
| | | import org.springblade.mdm.basesetting.producedivision.service.MdmUserService; |
| | | import org.springblade.mdm.flow.service.FlowBusinessService; |
| | | import org.springblade.mdm.flow.service.FlowCommonService; |
| | | import org.springblade.mdm.flow.service.FlowTransferService; |
| | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private HistoryService historyService; |
| | | private MdmUserService mdmUserService; |
| | | @Autowired |
| | | private FlowBusinessService businessService; |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private FlowTransferService flowTransferService; |
| | | @Autowired |
| | | private FlowCommonService flowCommonService; |
| | | /** |
| | | * 待办任务列表页 |
| | | */ |
| | |
| | | @GetMapping("flow-user-list") |
| | | @ApiOperationSupport(order = 3) |
| | | @Operation(summary = "用户下拉数据", description = "用户下拉数据") |
| | | public R<List<User>> flowUserList(@Parameter(description = "部门ID") String deptId) { |
| | | return userSearchClient.listByDept(deptId); |
| | | public R<List<MdmUser>> flowUserList(@Parameter(description = "部门ID") String deptId, String taskId) { |
| | | |
| | | return R.data(mdmUserService.listByDeptAndRoleAlias()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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)); |
| | | } |
| | | } |