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
package com.ruoyi.common.enums;
 
import lombok.Getter;
 
/**
 * @author xiaochen
 * @ClassName Disable
 * @Description
 * @date 2022-06-08 16:55
 */
public enum ProjectStageEnum {
    /*项目阶段 1=实验室开发阶段 2=中式试验阶段 3=生产验证试验阶段*/
    DEVELOPMENT_PHASE("LS", "实验室开发阶段"),
    CHINESE_STYLE_EXPERIMENT("PS", "中式试验阶段"),
    PRODUCTION_VALIDATION("IV", "生产验证试验阶段");
 
    @Getter
    private String desc;
 
 
    @Getter
    private String code;
 
 
    ProjectStageEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static ProjectStageEnum fromCode(Integer code) {
        ProjectStageEnum[] resultTypes = ProjectStageEnum.values();
        for (ProjectStageEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
}