mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-25 16:51:52 +08:00
【代码评审】BPM:获取审批任务的记录列表
This commit is contained in:
parent
4d15396e36
commit
d02e1e1d6b
@ -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, "跳过"); // 未执行,跳过的节点
|
||||
|
||||
|
@ -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<User> userList;
|
||||
|
||||
// TODO @jason:如果条件信息,怎么展示哈?
|
||||
@Schema(description = "分支节点")
|
||||
private List<ProcessNodeProgress> 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;
|
||||
|
||||
|
@ -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<ProcessNodeProgress> nodeProgresses,
|
||||
List<HistoricActivityInstance> historicActivityList, Map<String, HistoricActivityInstance> activityInstanceMap, List<Integer> 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));
|
||||
|
Loading…
Reference in New Issue
Block a user