huminmin
昨天 980b824680ec8b1b7e69b19327ccc61e8fd4a869
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
package com.ruoyi.common.enums;
 
 
public enum RawMaterialCheckResult implements BaseEnum<Integer>{
    RawMaterialCheckResultUnqualified(0, "不合格"),
    RawMaterialCheckResultQualified(1, "合格");
 
    private final Integer value;
    private final String label;
 
    RawMaterialCheckResult(Integer value, String label) {
        this.value = value;
        this.label = label;
    }
 
    public Integer getCode() {
        return value;
    }
 
    public String getValue() {
        return label;
    }
 
    /**
     * 根据值获取对应的枚举
     */
    public static RawMaterialCheckResult fromValue(Integer value) {
        for (RawMaterialCheckResult type : values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("未知的 RawMaterialCheckResult 值: " + value);
    }
}