xuhy
2 天以前 39a97f1b7585edc184ea5066600f1d9a2d2cb8cf
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
package com.ruoyi.common.enums;
 
import lombok.Getter;
 
/**
 * @author xiaochen
 * @ClassName Disable
 * @Description
 * @date 2022-06-08 16:55
 */
public enum FeasibilityStudyReportStatusEnum {
    /*状态 -1=草稿箱 1=待审核 2=待评定 3=已评定 4=已驳回 5=已撤回*/
    DRAFTS(-1, "草稿箱"),
    PENDING_APPROVAL(1, "待审核"),
    PASSED(2, "待评定"),
    EVALUATED(3, "已评定"),
    REJECTED(4, "已驳回"),
    REVOKED(5, "已撤销");
 
    @Getter
    private String desc;
 
 
    @Getter
    private int code;
 
 
    FeasibilityStudyReportStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static FeasibilityStudyReportStatusEnum fromCode(Integer code) {
        FeasibilityStudyReportStatusEnum[] resultTypes = FeasibilityStudyReportStatusEnum.values();
        for (FeasibilityStudyReportStatusEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
}