mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-15 06:29:01 +08:00
♻️ Refactoring code. 适配最新 flowable 工作流代码
This commit is contained in:
1 parent
ae37d1d6fe
commit
86aa539ad9
19 files changed
+466
-240
No files matched your search
+13
-3
@@ -2,26 +2,36 @@ package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 节点枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum NodeTypeEnum {
|
||||
|
||||
ROOT("根节点", 0),
|
||||
ROOT("根节点", 0, false), END("结束节点", -1, false),
|
||||
|
||||
APPROVAL("审批节点", 1), CC("抄送节点", 2), EXCLUSIVE_GATEWAY("条件分支", 4), PARALLEL_GATEWAY("并行分支", 5), EMPTY("空", 3)
|
||||
APPROVAL("审批节点", 1, false), CC("抄送节点", 2, false), EXCLUSIVE_GATEWAY("条件分支", 4, true),
|
||||
|
||||
PARALLEL_GATEWAY("并行分支", 5, true), EMPTY("空", 3, false),
|
||||
|
||||
;
|
||||
|
||||
NodeTypeEnum(String name, Integer value) {
|
||||
public static NodeTypeEnum getByValue(int value) {
|
||||
return Arrays.stream(NodeTypeEnum.values()).filter(w -> w.getValue() == value).findAny().orElse(null);
|
||||
}
|
||||
|
||||
NodeTypeEnum(String name, Integer value, Boolean branch) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.branch = branch;
|
||||
}
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer value;
|
||||
|
||||
private Boolean branch;
|
||||
|
||||
}
|
||||
+2
@@ -27,6 +27,8 @@ public class ProcessInstanceConstant {
|
||||
*/
|
||||
public static final String USER_TASK_NOBODY_HANDLER_TO_END = "TO_END";
|
||||
|
||||
public static final String USER_TASK_NOBODY_HANDLER_TO_REFUSE = "TO_REFUSE";
|
||||
|
||||
/**
|
||||
* 拒绝之后 结束流程
|
||||
*/
|
||||
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
/**
|
||||
* Security 常量
|
||||
*
|
||||
* @author haoxr
|
||||
* @since 2023/03/24
|
||||
*/
|
||||
public interface SecurityConstants {
|
||||
|
||||
/**
|
||||
* 登录接口路径
|
||||
*/
|
||||
String LOGIN_PATH = "/api/v1/auth/login";
|
||||
|
||||
/**
|
||||
* Token 前缀
|
||||
*/
|
||||
String TOKEN_PREFIX = "Bearer ";
|
||||
|
||||
/**
|
||||
* 请求头Token的Key
|
||||
*/
|
||||
String TOKEN_KEY = "Authorization";
|
||||
|
||||
/**
|
||||
* 验证码缓存前缀
|
||||
*/
|
||||
String VERIFY_CODE_CACHE_PREFIX = "AUTH:VERIFY_CODE:";
|
||||
|
||||
/**
|
||||
* 用户权限集合缓存前缀
|
||||
*/
|
||||
String USER_PERMS_CACHE_PREFIX = "AUTH:USER_PERMS:";
|
||||
|
||||
/**
|
||||
* 黑名单Token缓存前缀
|
||||
*/
|
||||
String BLACK_TOKEN_CACHE_PREFIX = "AUTH:BLACK_TOKEN:";
|
||||
|
||||
}
|
||||
+2
@@ -53,4 +53,6 @@ public class Node {
|
||||
|
||||
private List<GroupCondition> conditionList;
|
||||
|
||||
private Refuse refuse;
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Refuse {
|
||||
|
||||
private String handler;
|
||||
|
||||
private String nodeId;
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Huijun Zhao
|
||||
* @description
|
||||
* @date 2023-07-28 10:36
|
||||
*/
|
||||
@Data
|
||||
public class SelectValue {
|
||||
|
||||
private String key;
|
||||
|
||||
private String value;
|
||||
|
||||
}
|
||||
+21
@@ -18,6 +18,27 @@ public class NodeUtil {
|
||||
return childNode != null && StrUtil.isNotBlank(childNode.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加结束节点
|
||||
* @param node
|
||||
*/
|
||||
public static void addEndNode(Node node) {
|
||||
|
||||
Node children = node.getChildren();
|
||||
if (isNode(children)) {
|
||||
addEndNode(children);
|
||||
}
|
||||
else {
|
||||
Node end = new Node();
|
||||
end.setId("end");
|
||||
end.setType(NodeTypeEnum.END.getValue());
|
||||
end.setName("结束节点");
|
||||
end.setParentId(node.getId());
|
||||
node.setChildren(end);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 需要发起人选择用户的节点
|
||||
* @param node
|
||||
|
||||
Reference in new issue
Block a user