无关风月
2 天以前 0b4f853f6b05b28e3201386bdda3e8af0bfcfc7f
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
package com.ruoyi.common.enums;
 
import lombok.Getter;
 
/**
 * @author xiaochen
 * @ClassName Disable
 * @Description
 * @date 2022-06-08 16:55
 */
public enum StudyReportTypeEnum {
    /*1=可研报告 2=可行报告 3=工艺开发工具 4=验证与发布*/
    FEASIBILITY_STUDY_REPORT("K1", "可研报告"),
    FEASIBLE_REPORT("K2", "可行报告"),
    PROCESS_DEVELOPMENT_TOOLS("K3", "工艺开发工具"),
    VERIFICATION_RELEASE("K4", "验证与发布");
 
    @Getter
    private String desc;
 
 
    @Getter
    private String code;
 
 
    StudyReportTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static StudyReportTypeEnum fromCode(Integer code) {
        StudyReportTypeEnum[] resultTypes = StudyReportTypeEnum.values();
        for (StudyReportTypeEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
}