| | |
| | | @RequestMapping("/flow/") |
| | | @Tag(name = "派工流程", description = "派工流程") |
| | | public class MyFlowController { |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private FlowBusinessService businessService; |
| | | |
| | | /** |
| | | * 待办事务列表页 |
| | | * 待办任务列表页 |
| | | */ |
| | | @GetMapping("todo-list") |
| | | @ApiOperationSupport(order = 3) |
| | | @Operation(summary = "我的流程", description = "传入流程信息") |
| | | @Operation(summary = "待办任务", description = "传入流程信息") |
| | | public R<IPage<BladeFlow>> todoList(@Parameter(description = "关键字") String keyword, Query query) { |
| | | IPage<BladeFlow> pages = businessService.selectTodoPage(Condition.getPage(query), keyword); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 待办任务列表页 |
| | | */ |
| | | @GetMapping("alltask-list") |
| | | @ApiOperationSupport(order = 3) |
| | | @Operation(summary = "所有任务(fortest)", description = "传入流程信息") |
| | | public R<IPage<BladeFlow>> alltaskList(@Parameter(description = "关键字") String keyword, Query query) { |
| | | IPage<BladeFlow> pages = businessService.selectAllTaskPage(Condition.getPage(query), keyword); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | @Operation(summary = "转派任务", description = "") |
| | | @PostMapping("transferTask") |
| | | public R<Void> transferTask(String taskId,String newAssigneeId, String processInstanceId, String comment, @RequestBody Map<String, Object> variables) { |
| | | // 增加评论 |
| | | if (StringUtil.isNoneBlank(processInstanceId, comment)) { |
| | | taskService.addComment(taskId, processInstanceId, comment); |
| | | } |
| | | // 非空判断 |
| | | if (Func.isEmpty(variables)) { |
| | | variables = Kv.create(); |
| | | } |
| | | // 完成任务 |
| | | taskService.setAssignee(taskId, newAssigneeId); |
| | | return R.success("流程转派成功"); |
| | | } |
| | | |
| | | } |