Commit 14c8b591d342f0ce764204c71c8a8d36a43924d9
1 parent
3a433e82
【代码评审】工作流:抄送的实现逻辑
Showing
3 changed files
with
11 additions
and
14 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/simple/BpmSimpleModelNodeVO.java
| @@ -31,8 +31,7 @@ public class BpmSimpleModelNodeVO { | @@ -31,8 +31,7 @@ public class BpmSimpleModelNodeVO { | ||
| 31 | @Schema(description = "模型节点名称", example = "领导审批") | 31 | @Schema(description = "模型节点名称", example = "领导审批") |
| 32 | private String name; | 32 | private String name; |
| 33 | 33 | ||
| 34 | - // TODO @jason:要不改成 placeholder 和一般 Element-Plus 组件一致。占位符,用于展示。@芋艿。这个不是 placeholder 占位符的含义。节点配置后。节点展示的内容,不知道取什么名字好??? | ||
| 35 | - // TODO @jason:【回复】占位文本(showText)是指当一个文本框没有被 focus 的时候显示的是提示文字,当他被点击之后就显示空白。。。虽然不是完全精准,但是 placeholder 相对正式点~ | 34 | + // TODO @jason:和 gpt 大模型对了下这个字段的命名,貌似叫 displayText 合适点。可以等最后我们全局替换下。(优先级:低) |
| 36 | @Schema(description = "节点展示内容", example = "指定成员: 芋道源码") | 35 | @Schema(description = "节点展示内容", example = "指定成员: 芋道源码") |
| 37 | private String showText; | 36 | private String showText; |
| 38 | 37 | ||
| @@ -43,7 +42,7 @@ public class BpmSimpleModelNodeVO { | @@ -43,7 +42,7 @@ public class BpmSimpleModelNodeVO { | ||
| 43 | private List<BpmSimpleModelNodeVO> conditionNodes; // 补充说明:有且仅有条件、并行、包容等分支会使用 | 42 | private List<BpmSimpleModelNodeVO> conditionNodes; // 补充说明:有且仅有条件、并行、包容等分支会使用 |
| 44 | 43 | ||
| 45 | @Schema(description = "节点的属性") | 44 | @Schema(description = "节点的属性") |
| 46 | - private Map<String, Object> attributes; // TODO @jason:建议是字段分拆下;类似说: | 45 | + private Map<String, Object> attributes; // TODO @jason:这个字段,目前只有条件表达式使用;是不是搞的更巨像。TODO @芋艿 |
| 47 | 46 | ||
| 48 | // TODO @jason:看看是不是可以简化;@芋艿: 暂时先放着。不知道后面是否会用到 | 47 | // TODO @jason:看看是不是可以简化;@芋艿: 暂时先放着。不知道后面是否会用到 |
| 49 | /** | 48 | /** |
| @@ -95,8 +94,8 @@ public class BpmSimpleModelNodeVO { | @@ -95,8 +94,8 @@ public class BpmSimpleModelNodeVO { | ||
| 95 | */ | 94 | */ |
| 96 | private AssignEmptyHandler assignEmptyHandler; | 95 | private AssignEmptyHandler assignEmptyHandler; |
| 97 | 96 | ||
| 98 | - @Data | ||
| 99 | @Schema(description = "审批节点拒绝处理策略") | 97 | @Schema(description = "审批节点拒绝处理策略") |
| 98 | + @Data | ||
| 100 | public static class RejectHandler { | 99 | public static class RejectHandler { |
| 101 | 100 | ||
| 102 | @Schema(description = "拒绝处理类型", example = "1") | 101 | @Schema(description = "拒绝处理类型", example = "1") |
| @@ -107,9 +106,9 @@ public class BpmSimpleModelNodeVO { | @@ -107,9 +106,9 @@ public class BpmSimpleModelNodeVO { | ||
| 107 | private String returnNodeId; | 106 | private String returnNodeId; |
| 108 | } | 107 | } |
| 109 | 108 | ||
| 110 | - @Data | ||
| 111 | @Schema(description = "审批节点超时处理策略") | 109 | @Schema(description = "审批节点超时处理策略") |
| 112 | @Valid | 110 | @Valid |
| 111 | + @Data | ||
| 113 | public static class TimeoutHandler { | 112 | public static class TimeoutHandler { |
| 114 | 113 | ||
| 115 | @Schema(description = "是否开启超时处理", requiredMode = Schema.RequiredMode.REQUIRED, example = "false") | 114 | @Schema(description = "是否开启超时处理", requiredMode = Schema.RequiredMode.REQUIRED, example = "false") |
| @@ -130,8 +129,8 @@ public class BpmSimpleModelNodeVO { | @@ -130,8 +129,8 @@ public class BpmSimpleModelNodeVO { | ||
| 130 | 129 | ||
| 131 | } | 130 | } |
| 132 | 131 | ||
| 133 | - @Data | ||
| 134 | @Schema(description = "空处理策略") | 132 | @Schema(description = "空处理策略") |
| 133 | + @Data | ||
| 135 | @Valid | 134 | @Valid |
| 136 | public static class AssignEmptyHandler { | 135 | public static class AssignEmptyHandler { |
| 137 | 136 | ||
| @@ -145,12 +144,14 @@ public class BpmSimpleModelNodeVO { | @@ -145,12 +144,14 @@ public class BpmSimpleModelNodeVO { | ||
| 145 | 144 | ||
| 146 | } | 145 | } |
| 147 | 146 | ||
| 148 | - @Data | ||
| 149 | @Schema(description = "操作按钮设置") | 147 | @Schema(description = "操作按钮设置") |
| 148 | + @Data | ||
| 149 | + @Valid | ||
| 150 | public static class OperationButtonSetting { | 150 | public static class OperationButtonSetting { |
| 151 | 151 | ||
| 152 | + // TODO @jason:是不是按钮的标识?id 会和数据库的 id 自增有点模糊,key 标识会更合理一点点哈。 | ||
| 152 | @Schema(description = "按钮 Id", example = "1") | 153 | @Schema(description = "按钮 Id", example = "1") |
| 153 | - private Integer id; | 154 | + private Integer id; |
| 154 | 155 | ||
| 155 | @Schema(description = "显示名称", example = "审批") | 156 | @Schema(description = "显示名称", example = "审批") |
| 156 | private String displayName; | 157 | private String displayName; |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateDeptLeaderMultiStrategy.java
| 1 | package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy; | 1 | package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy; |
| 2 | 2 | ||
| 3 | -import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.hutool.core.lang.Assert; | 3 | import cn.hutool.core.lang.Assert; |
| 5 | import cn.iocoder.yudao.framework.common.util.string.StrUtils; | 4 | import cn.iocoder.yudao.framework.common.util.string.StrUtils; |
| 6 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy; | 5 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy; |
| @@ -9,7 +8,6 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi; | @@ -9,7 +8,6 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi; | ||
| 9 | import org.flowable.engine.delegate.DelegateExecution; | 8 | import org.flowable.engine.delegate.DelegateExecution; |
| 10 | import org.springframework.stereotype.Component; | 9 | import org.springframework.stereotype.Component; |
| 11 | 10 | ||
| 12 | -import java.util.List; | ||
| 13 | import java.util.Set; | 11 | import java.util.Set; |
| 14 | 12 | ||
| 15 | /** | 13 | /** |
| @@ -31,7 +29,7 @@ public class BpmTaskCandidateDeptLeaderMultiStrategy extends BpmTaskCandidateAbs | @@ -31,7 +29,7 @@ public class BpmTaskCandidateDeptLeaderMultiStrategy extends BpmTaskCandidateAbs | ||
| 31 | 29 | ||
| 32 | @Override | 30 | @Override |
| 33 | public void validateParam(String param) { | 31 | public void validateParam(String param) { |
| 34 | - // 参数格式: | 分隔 。左边为部门(多个部门用 , 分隔)。 右边为部门层级 | 32 | + // 参数格式: | 分隔:1)左边为部门(多个部门用 , 分隔)。2)右边为部门层级 |
| 35 | String[] params = param.split("\\|"); | 33 | String[] params = param.split("\\|"); |
| 36 | Assert.isTrue(params.length == 2, "参数格式不匹配"); | 34 | Assert.isTrue(params.length == 2, "参数格式不匹配"); |
| 37 | deptApi.validateDeptList(StrUtils.splitToLong(params[0], ",")); | 35 | deptApi.validateDeptList(StrUtils.splitToLong(params[0], ",")); |
| @@ -40,8 +38,6 @@ public class BpmTaskCandidateDeptLeaderMultiStrategy extends BpmTaskCandidateAbs | @@ -40,8 +38,6 @@ public class BpmTaskCandidateDeptLeaderMultiStrategy extends BpmTaskCandidateAbs | ||
| 40 | 38 | ||
| 41 | @Override | 39 | @Override |
| 42 | public Set<Long> calculateUsers(DelegateExecution execution, String param) { | 40 | public Set<Long> calculateUsers(DelegateExecution execution, String param) { |
| 43 | - // 参数格式: | 分隔 。左边为部门(多个部门用 , 分隔)。 右边为部门层级 | ||
| 44 | - // 参数格式: ,分割。前面的部门Id. 可以为多个。 最后一个为部门层级 | ||
| 45 | String[] params = param.split("\\|"); | 41 | String[] params = param.split("\\|"); |
| 46 | return getMultiLevelDeptLeaderIds(StrUtils.splitToLong(params[0], ","), Integer.valueOf(params[1])); | 42 | return getMultiLevelDeptLeaderIds(StrUtils.splitToLong(params[0], ","), Integer.valueOf(params[1])); |
| 47 | } | 43 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java
| @@ -454,7 +454,7 @@ public class SimpleModelUtils { | @@ -454,7 +454,7 @@ public class SimpleModelUtils { | ||
| 454 | addFormFieldsPermission(node.getFieldsPermission(), userTask); | 454 | addFormFieldsPermission(node.getFieldsPermission(), userTask); |
| 455 | // 添加操作按钮配置属性元素 | 455 | // 添加操作按钮配置属性元素 |
| 456 | addButtonsSetting(node.getButtonsSetting(), userTask); | 456 | addButtonsSetting(node.getButtonsSetting(), userTask); |
| 457 | - // 处理多实例 | 457 | + // 处理多实例(审批方式) |
| 458 | processMultiInstanceLoopCharacteristics(node.getApproveMethod(), node.getApproveRatio(), userTask); | 458 | processMultiInstanceLoopCharacteristics(node.getApproveMethod(), node.getApproveRatio(), userTask); |
| 459 | // 添加任务被拒绝的处理元素 | 459 | // 添加任务被拒绝的处理元素 |
| 460 | addTaskRejectElements(node.getRejectHandler(), userTask); | 460 | addTaskRejectElements(node.getRejectHandler(), userTask); |