刘光辉
昨天 bb638871a7fb692d80f1b7a758f991dc0879002c
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
package jnpf.flowable.enums;
 
import lombok.Getter;
 
@Getter
public enum ActionEnum {
 
    /**
     * 无
     */
    NONE(0, "无"),
    /**
     * 同意
     */
    AUDIT(1, "同意"),
    /**
     * 拒绝
     */
    REJECT(2, "拒绝"),
    /**
     * 退回
     */
    BACK(3, "退回"),
    /**
     * 办理
     */
    PROCESSING(4, "办理"),
 
    ;
 
 
    private final Integer code;
    private final String message;
 
    ActionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
 
    /**
     * 根据状态code获取枚举名称
     *
     * @return
     */
    public static ActionEnum getByCode(Integer code) {
        for (ActionEnum status : ActionEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return ActionEnum.NONE;
    }
}