xuhy
2025-05-09 202729432866117778bc1c20315a06aa84fee98e
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 QaReportTypeEnum {
    /*1=检测项报告、2=中试 、3=生产验证分析报告;4=辅料*/
    TEST_REPORT("H1", "检测项报告"),
    TEST_PILOT("H2", "中试"),
    PRODUCTION_VERIFICATION_ANALYSIS_REPORT("H3", "生产验证分析报告"),
    AUXILIARY_MATERIALS("H4", "辅料");
 
    @Getter
    private String desc;
 
 
    @Getter
    private String code;
 
 
    QaReportTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static QaReportTypeEnum fromCode(Integer code) {
        QaReportTypeEnum[] resultTypes = QaReportTypeEnum.values();
        for (QaReportTypeEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
}