first commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.budwk.app.flow.enums;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author mldong
|
||||
* @date 2023/11/24
|
||||
*/
|
||||
//@DictEnum(key = "wf_countersign_type", name = "会签类型")
|
||||
public enum CountersignTypeEnum {
|
||||
PARALLEL(0, "并行会签"),
|
||||
SEQUENTIAL(1, "串行会签"),
|
||||
;
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
public static CountersignTypeEnum codeOf(Object code) {
|
||||
return Arrays.stream(CountersignTypeEnum.class.getEnumConstants()).filter(e ->
|
||||
e.getCode().equals(Convert.toInt(code))
|
||||
|| e.name().equalsIgnoreCase(Convert.toStr(code))
|
||||
|| e.getMessage().equalsIgnoreCase(Convert.toStr(code))
|
||||
).findAny().orElse(CountersignTypeEnum.PARALLEL);
|
||||
}
|
||||
|
||||
CountersignTypeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.budwk.app.flow.enums;
|
||||
|
||||
/**
|
||||
* @author mldong
|
||||
* @date 2023/12/5
|
||||
*/
|
||||
public enum ProcessEventTypeEnum{
|
||||
PROCESS_INSTANCE_START(1,"流程实例开始事件"),
|
||||
PROCESS_INSTANCE_END(2, "流程实例结束事件"),
|
||||
PROCESS_TASK_START(3, "流程任务开始事件"),
|
||||
PROCESS_TASK_END(4, "流程任务结束事件"),
|
||||
|
||||
PROCESS_TASK_REVOKE(5, "流程任务撤销事件"),
|
||||
|
||||
;
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
|
||||
ProcessEventTypeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.budwk.app.flow.enums;
|
||||
|
||||
import com.budwk.app.base.annotation.DictEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 流程实例状态(10:进行中;20:已完成;30:已撤回;40:强行终止;50:挂起;99:已废弃)
|
||||
*/
|
||||
@Getter
|
||||
@DictEnum(key = "ProcessInstanceStateEnum", name = "流程实例状态")
|
||||
public enum ProcessInstanceStateEnum {
|
||||
DOING(10, "进行中", "primary"),
|
||||
FINISHED(20, "已完成", "success"),
|
||||
WITHDRAW(30, "已撤回", "danger"),
|
||||
INTERRUPT(40, "强行终止", "danger"),
|
||||
REJECT(45, "已拒绝", "danger"),
|
||||
PENDING(50, "挂起", "danger"),
|
||||
ABANDON(99, "已废弃", "danger");
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
private final String type;
|
||||
|
||||
ProcessInstanceStateEnum(Integer code, String message, String type) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.budwk.app.flow.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 流程提交类型(操作类型)
|
||||
*
|
||||
* @author mldong
|
||||
* @date 2023/10/7
|
||||
*/
|
||||
@Getter
|
||||
public enum ProcessSubmitTypeEnum {
|
||||
APPLY(0, "发起申请"),
|
||||
AGREE(1, "同意"),
|
||||
REJECT(2, "拒绝"),
|
||||
ROLLBACK(3, "退回上一步"),
|
||||
JUMP(4, "跳转"),
|
||||
RE_APPLY(5, "重新提交"),
|
||||
ROLLBACK_TO_OPERATOR(6, "退回发起人"),
|
||||
COUNTERSIGN_DISAGREE(20, "会签不同意");
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
|
||||
ProcessSubmitTypeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.budwk.app.flow.enums;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
/**
|
||||
*
|
||||
* 任务参与类型
|
||||
* @author mldong
|
||||
* @date 2023/4/25
|
||||
*/
|
||||
public enum ProcessTaskPerformTypeEnum {
|
||||
/**
|
||||
* 普通参与:一个或多个人同时参与一个任务,所有人只要其中一人执行完成,就能驱动任务节点往下一步执行
|
||||
*/
|
||||
NORMAL(0,"普通参与"),
|
||||
/**
|
||||
* 会签参与:给每个人都创建任务,满足一定条件时,才能驱动任务节点往下一步执行
|
||||
* 1. 所有人都执行完成
|
||||
* 2. 有一定比率执行完成时
|
||||
* 3. 某特殊人员执行完成时
|
||||
* ……等等
|
||||
*/
|
||||
COUNTERSIGN(1, "会签参与"),
|
||||
;
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
|
||||
ProcessTaskPerformTypeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* code转成枚举
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static ProcessTaskPerformTypeEnum codeOf(Object code) {
|
||||
if("ALL".equalsIgnoreCase(Convert.toStr(code))
|
||||
|| COUNTERSIGN.toString().toUpperCase().equals(code)
|
||||
|| COUNTERSIGN.toString().toLowerCase().equals(code)
|
||||
|| COUNTERSIGN.code.equals(code)) {
|
||||
return COUNTERSIGN;
|
||||
}
|
||||
return NORMAL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.budwk.app.flow.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 流程任务状态枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum ProcessTaskStateEnum {
|
||||
|
||||
DOING(10, "进行中"),
|
||||
FINISHED(20, "已完成"),
|
||||
WITHDRAW(30, "已撤回"),
|
||||
INTERRUPT(40, "强行终止"),
|
||||
PENDING(50, "挂起"),
|
||||
TRANSFER(60, "已转办"),
|
||||
ABANDON(99, "已废弃");
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
ProcessTaskStateEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.budwk.app.flow.enums;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
*
|
||||
* 任务类型
|
||||
* @author mldong
|
||||
* @date 2023/4/25
|
||||
*/
|
||||
//@DictEnum(key = "wf_process_task_type", name = "流程任务类型")
|
||||
public enum ProcessTaskTypeEnum {
|
||||
MAJOR(0,"主办"),
|
||||
SECONDARY(1, "协办"),
|
||||
RECORD(2,"记录"),
|
||||
;
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
|
||||
ProcessTaskTypeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* code转成枚举
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static ProcessTaskTypeEnum codeOf(Object code) {
|
||||
return Arrays.stream(ProcessTaskTypeEnum.class.getEnumConstants()).filter(e ->
|
||||
e.getCode().equals(Convert.toInt(code))
|
||||
|| e.name().equalsIgnoreCase(Convert.toStr(code))
|
||||
|| e.getMessage().equalsIgnoreCase(Convert.toStr(code))
|
||||
).findAny().orElse(ProcessTaskTypeEnum.MAJOR);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user