仿钉钉流程设计 - 获取审批记录修改列表,合并正在运行的会签和或签任务

This commit is contained in:
jason 2024-09-26 13:36:28 +08:00
parent b6c78ad04f
commit 31df372ab5
3 changed files with 16 additions and 5 deletions

View File

@ -26,8 +26,7 @@ import java.util.Objects;
import static cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO.OperationButtonSetting; import static cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO.OperationButtonSetting;
import static cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO.TimeoutHandler; import static cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO.TimeoutHandler;
import static cn.iocoder.yudao.module.bpm.enums.definition.BpmSimpleModelNodeType.*; import static cn.iocoder.yudao.module.bpm.enums.definition.BpmSimpleModelNodeType.*;
import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskApproveMethodEnum.RANDOM; import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskApproveMethodEnum.*;
import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskApproveMethodEnum.RATIO;
import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskApproveTypeEnum.USER; import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskApproveTypeEnum.USER;
import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskAssignStartUserHandlerTypeEnum.SKIP; import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskAssignStartUserHandlerTypeEnum.SKIP;
import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskTimeoutHandlerTypeEnum.REMINDER; import static cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskTimeoutHandlerTypeEnum.REMINDER;
@ -288,6 +287,10 @@ public class SimpleModelUtils {
return node != null && node.getId() != null; return node != null && node.getId() != null;
} }
public static boolean isSequentialApproveNode(BpmSimpleModelNodeVO node) {
return APPROVE_NODE.getType().equals(node.getType()) && SEQUENTIAL.getMethod().equals(node.getApproveMethod());
}
private static List<FlowElement> buildFlowNode(BpmSimpleModelNodeVO node, BpmSimpleModelNodeType nodeType) { private static List<FlowElement> buildFlowNode(BpmSimpleModelNodeVO node, BpmSimpleModelNodeType nodeType) {
List<FlowElement> list = new ArrayList<>(); List<FlowElement> list = new ArrayList<>();
switch (nodeType) { switch (nodeType) {
@ -523,7 +526,7 @@ public class SimpleModelUtils {
multiInstanceCharacteristics.setCompletionCondition(ANY_OF_APPROVE_COMPLETE_EXPRESSION); multiInstanceCharacteristics.setCompletionCondition(ANY_OF_APPROVE_COMPLETE_EXPRESSION);
multiInstanceCharacteristics.setSequential(false); multiInstanceCharacteristics.setSequential(false);
userTask.setLoopCharacteristics(multiInstanceCharacteristics); userTask.setLoopCharacteristics(multiInstanceCharacteristics);
} else if (approveMethodEnum == BpmUserTaskApproveMethodEnum.SEQUENTIAL) { } else if (approveMethodEnum == SEQUENTIAL) {
multiInstanceCharacteristics.setCompletionCondition(ALL_APPROVE_COMPLETE_EXPRESSION); multiInstanceCharacteristics.setCompletionCondition(ALL_APPROVE_COMPLETE_EXPRESSION);
multiInstanceCharacteristics.setSequential(true); multiInstanceCharacteristics.setSequential(true);
multiInstanceCharacteristics.setLoopCardinality("1"); multiInstanceCharacteristics.setLoopCardinality("1");

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.bpm.service.task.bo;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import static cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmApprovalDetailRespVO.ApprovalNodeInfo; import static cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmApprovalDetailRespVO.ApprovalNodeInfo;
@ -21,8 +22,15 @@ public class AlreadyRunApproveNodeRespBO {
private List<ApprovalNodeInfo> approveNodes; private List<ApprovalNodeInfo> approveNodes;
/** /**
* 已运行的节点 ID 数组 * 已运行的节点 ID 数组 (对应 Bpmn XML 节点 id)
*/ */
private Set<String> runNodeIds; private Set<String> runNodeIds;
/**
* 正在运行的节点的审批信息 ( key: activityId. value: 审批信息 )
* <p>
* 用于依次审批 需要加上候选人信息
*/
private Map<String, ApprovalNodeInfo> runningApprovalNodes;
} }