From f9b6eef4d2bbc67dbca4e98bf8cbd23ad485858b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 16 Jan 2022 11:42:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9A=84=20bpm=20=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=9A=84=20todo=E3=80=81done=20=E7=9A=84=20vo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/task/BpmTaskController.java | 11 +++----- .../vo/task/BpmTaskDonePageItemRespVO.java | 6 ----- .../{TaskHandleVO.java => BpmTaskRespVO.java} | 10 +++---- .../task/vo/task/TaskQueryReqVO.java | 15 ----------- .../controller/task/vo/task/TaskStepVO.java | 24 ----------------- .../bpm/service/task/BpmTaskService.java | 26 +++++++------------ .../service/task/impl/BpmTaskServiceImpl.java | 26 +++++++++++-------- 7 files changed, 32 insertions(+), 86 deletions(-) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/{TaskHandleVO.java => BpmTaskRespVO.java} (51%) delete mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskQueryReqVO.java delete mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskStepVO.java diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmTaskController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmTaskController.java index 92b9248c8..f7e309c29 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmTaskController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/BpmTaskController.java @@ -56,16 +56,13 @@ public class BpmTaskController { return success(true); } - @PostMapping("/task-steps") - public CommonResult getTaskSteps(@RequestBody TaskQueryReqVO taskQuery) { + @GetMapping("/list-by-process-instance-id") + @ApiOperation(value = "获得指定流程实例的任务列表", notes = "包括完成的、未完成的") + public CommonResult> getTaskListByProcessInstanceId( + @RequestParam("processInstanceId") String processInstanceId) { return success(taskService.getTaskSteps(taskQuery)); } - @GetMapping("/process/history-steps") - public CommonResult> getHistorySteps(@RequestParam("id") String processInstanceId) { - return success(taskService.getHistorySteps(processInstanceId)); - } - /** * 返回高亮的流转图SVG * @param processInstanceId 流程Id diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java index 9779992fe..799c8ae30 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskDonePageItemRespVO.java @@ -57,10 +57,4 @@ public class BpmTaskDonePageItemRespVO { } - - // 任务编号、流程名称、任务节点、流程发起人、接收时间、审批时间、耗时【名称、开始时间】「流程记录、撤回」 - // 任务编号、任务名称、所属流程、委托代办人、流程发起人、优先级、审批操作、审批意见、耗时、创建时间【名称、开始时间】「申请详情」 - - // 任务编号、任务名称、流程名称、流程发起人、接收时间、审批时间、耗时【名称、接收时间】「详情」TODO 撤回 - } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskHandleVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRespVO.java similarity index 51% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskHandleVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRespVO.java index 2f28f4961..d52d6dd00 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskHandleVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/BpmTaskRespVO.java @@ -1,19 +1,15 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; +import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.ToString; import java.util.List; +@ApiModel("流程任务的 Response VO") @Data -@ToString -public class TaskHandleVO { - - private Object formObject; +public class BpmTaskRespVO extends Page{ - private List historyTask; - - private String taskVariable; } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskQueryReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskQueryReqVO.java deleted file mode 100644 index 97135bb66..000000000 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskQueryReqVO.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; - -import lombok.Data; -import lombok.ToString; - -@Data -@ToString -public class TaskQueryReqVO { - - private String processKey; - - private String taskId; - - private String businessKey; -} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskStepVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskStepVO.java deleted file mode 100644 index ad148a85d..000000000 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/task/vo/task/TaskStepVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task; - -import lombok.Data; -import lombok.ToString; - -import java.util.Date; - -@Data -@ToString -public class TaskStepVO { - - private String stepName; - - private Date startTime; - - private Date endTime; - - private String assignee; - - private String comment; - - private Integer status; - -} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java index ea53a0900..b46bf065a 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java @@ -18,12 +18,20 @@ import java.util.Map; public interface BpmTaskService { /** - * 获得流程任务列表 + * 获得指定流程实例的 Running 进行中的流程任务列表 * * @param processInstanceId 流程实例的编号 * @return 流程任务列表 */ - List getTasksByProcessInstanceId(String processInstanceId); + List getRunningTaskListByProcessInstanceId(String processInstanceId); + + /** + * 获得指令流程实例的流程任务列表,包括所有状态的 + * + * @param processInstanceId 流程实例的编号 + * @return 流程任务列表 + */ + List getTaskListByProcessInstanceId(String processInstanceId); /** * 获得流程任务列表 @@ -84,20 +92,6 @@ public interface BpmTaskService { */ void rejectTask(@Valid BpmTaskRejectReqVO reqVO); - /** - * 根据任务id, 查询已经完成的用户任务,未完成的用户任务 - * @param taskQuery 查询参数 一般 taskId - */ - @Deprecated - TaskHandleVO getTaskSteps(TaskQueryReqVO taskQuery); - - /** - * 根据流程实例id, 查询历史用户任务,包括已完成,未完成 - * @param processInstanceId 流程实例id - */ - @Deprecated - List getHistorySteps(String processInstanceId); - /** * 返回高亮的流转进程 * @param processInstanceId 实例Id diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java index 1b7715902..9b638d4d8 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java @@ -82,10 +82,24 @@ public class BpmTaskServiceImpl implements BpmTaskService { private BpmTaskExtMapper taskExtMapper; @Override - public List getTasksByProcessInstanceId(String processInstanceId) { + public List getRunningTaskListByProcessInstanceId(String processInstanceId) { return taskService.createTaskQuery().processInstanceId(processInstanceId).list(); } + @Override + public List getTaskListByProcessInstanceId(String processInstanceId) { + // 获得任务列表 + List tasks = historyService.createHistoricTaskInstanceQuery() + .processInstanceId(processInstanceId) + .orderByTaskCreateTime().list(); + if (CollUtil.isEmpty(tasks)) { + return Collections.emptyList(); + } + + // 拼接数据 + return null; + } + @Override public List getTasksByProcessInstanceIds(List processInstanceIds) { if (CollUtil.isEmpty(processInstanceIds)) { @@ -218,16 +232,6 @@ public class BpmTaskServiceImpl implements BpmTaskService { // taskService.addComment(task.getId(), task.getProcessInstanceId(), reqVO.getComment()); } - @Override - public TaskHandleVO getTaskSteps(TaskQueryReqVO taskQuery) { -// TaskHandleVO handleVO = new TaskHandleVO(); -// final Task task = taskRuntime.task(taskQuery.getTaskId()); -// List steps = getTaskSteps(task.getProcessInstanceId()); -// handleVO.setHistoryTask(steps); -// return handleVO; - return null; - } - private List getTaskSteps(String processInstanceId) { // 获得已完成的活动 List finished = historyService.createHistoricActivityInstanceQuery()