From d02e1e1d6be194345e61c65a84437f151f808169 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 8 Sep 2024 11:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91BPM=EF=BC=9A=E8=8E=B7=E5=8F=96=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9A=84=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/enums/definition/BpmProcessNodeProgressEnum.java | 2 +- .../task/vo/instance/BpmProcessInstanceProgressRespVO.java | 5 +++++ .../bpm/framework/flowable/core/util/SimpleModelUtils.java | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmProcessNodeProgressEnum.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmProcessNodeProgressEnum.java index 4a6f32a7e3..a9483074f7 100644 --- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmProcessNodeProgressEnum.java +++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmProcessNodeProgressEnum.java @@ -29,7 +29,7 @@ public enum BpmProcessNodeProgressEnum { USER_TASK_REJECT(31, "审批不通过"), // 审批节点 USER_TASK_RETURN(32, "已退回"), // 审批节点 USER_TASK_CANCEL(34, "已取消"), // 审批节点 - // 40 ~ 50 一般节点的接榫状态 + // 40 ~ 50 一般节点的接榫状态 // TODO @jason:接榫 是啥呀? FINISHED(41, "已结束"), // 一般节点的节点的结束状态 SKIP(42, "跳过"); // 未执行,跳过的节点 diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceProgressRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceProgressRespVO.java index 3760234cc2..90af0213c9 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceProgressRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceProgressRespVO.java @@ -32,6 +32,7 @@ public class BpmProcessInstanceProgressRespVO { @Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Integer nodeType; // 参见 BpmSimpleModelNodeType 枚举 + // TODO @jason:可以复用 BpmTaskStatusEnum 么?非必要不加太多状态枚举哈 @Schema(description = "节点状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") private Integer status; // 参见 BpmProcessNodeProgressEnum 枚举 @@ -42,6 +43,8 @@ public class BpmProcessInstanceProgressRespVO { @Schema(description = "用户列表") private List userList; + + // TODO @jason:如果条件信息,怎么展示哈? @Schema(description = "分支节点") private List branchNodes; // 有且仅有条件、并行、包容节点才会有分支节点 @@ -62,6 +65,8 @@ public class BpmProcessInstanceProgressRespVO { @Schema(description = "用户头像", example = "芋艿") private String avatar; + // TODO @jason:是不是把 processed 和 userTaskStatus 合并? + @Schema(description = "是否已处理", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") private Boolean processed; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java index 03085166a9..158dfd3eec 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java @@ -654,10 +654,11 @@ public class SimpleModelUtils { } buildNodeProgress(processInstance, simpleModel, nodeProgresses, historicActivityList, activityInstanceMap, returnNodePosition); // 如果有“子”节点,则递归处理子节点 + // TODO @jason:需要根据条件,是否继续递归。例如说,一共有 3 个 node;第 2 个 node 审批不通过了。那么第 3 个 node 就不用了。(微信讨论下) traverseNodeToBuildNodeProgress(processInstance, simpleModel.getChildNode(), historicActivityList, activityInstanceMap, nodeProgresses, returnNodePosition); } - // TODO @芋艿:重点在 review 下 + // TODO @芋艿,@jason:可重构优化的点,SimpleModelUtils 负责提供一个遍历的方法,有个 Function 进行每个节点的处理。目的是,把逻辑拿回到 Service 里面;或者说,减少 Utils 去调用 Service private static void buildNodeProgress(HistoricProcessInstance processInstance, BpmSimpleModelNodeVO node, List nodeProgresses, List historicActivityList, Map activityInstanceMap, List returnNodePosition) { BpmSimpleModelNodeType nodeType = BpmSimpleModelNodeType.valueOf(node.getType()); @@ -674,6 +675,7 @@ public class SimpleModelUtils { // 2. 设置节点状态 nodeProgress.setStatus(activityService.getNotRunActivityProgressStatus(processInstanceStatus)); // 3. 抄送节点, 审批节点设置用户列表 + // TODO @芋艿:抄送节点,要不要跳过(不展示) if (COPY_NODE.getType().equals(node.getType()) || (APPROVE_NODE.getType().equals(node.getType()) && USER.getType().equals(node.getApproveType()))) { nodeProgress.setUserList(activityService.getNotRunActivityUserList(processInstance.getId() @@ -707,6 +709,7 @@ public class SimpleModelUtils { } break; } + // TODO @芋艿:抄送节点,要不要跳过(不展示) case COPY_NODE: { // 抄送节点 // 1. 设置节点的状态 nodeProgress.setStatus(activityService.getHistoricActivityProgressStatus(historicActivity, false, historicActivityList));