ny
昨天 b6f169fe43a2b13f351aefc152374fc7f0bc8cb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package jnpf.flowable.enums;
 
import lombok.Getter;
 
/**
 * 异常规则
 *
 * @author :JNPF开发平台组
 * @version: V3.1.0
 * @copyright 引迈信息技术有限公司
 * @date :2022/6/17 10:57
 */
@Getter
public enum ErrorRuleEnum {
    /**
     * 1.超级管理员
     */
    administrator(1, "超级管理员"),
    /**
     * 2.指定人员
     */
    initiator(2, "指定人员"),
    /**
     * 3.上一节点审批人指定处理人
     */
    node(3, "上一节点审批人指定处理人"),
    /**
     * 4.默认审批通过
     */
    pass(4, "默认审批通过"),
    /**
     * 5.无法提交
     */
    notSubmit(5, "无法提交"),
    /**
     * 6.发起者本人处理
     */
    creatorUserId(6, "发起者本人处理");
 
    private final Integer code;
    private final String message;
 
    ErrorRuleEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
 
    /**
     * 根据状态code获取枚举名称
     *
     * @return
     */
    public static ErrorRuleEnum getByCode(Integer code) {
        for (ErrorRuleEnum status : ErrorRuleEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return ErrorRuleEnum.administrator;
    }
 
}