无关风月
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 QaReportFileEnum {
    /*报告类型 1=检测报告 2=中试生产验证 3=原辅料报告 4=产品报批报告*/
    TEST_REPORT(1, "检测报告"),
    PILOT_PRODUCTION_VALIDATION(2, "中试生产验证"),
    RAW_MATERIAL_REPORT(3, "原辅料报告"),
    PRODUCT_APPROVAL_REPORT(4, "产品报批报告");
 
    @Getter
    private String desc;
 
 
    @Getter
    private int code;
 
 
    QaReportFileEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static QaReportFileEnum fromCode(Integer code) {
        QaReportFileEnum[] resultTypes = QaReportFileEnum.values();
        for (QaReportFileEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
}