huminmin
昨天 e978ceb872e250c3e42d0457f7601082a7ac1b05
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 RawMaterialInspectState implements BaseEnum<Integer>{
    RawMaterialInspectStateUnsubmitted(0, "未提交"),
    RawMaterialInspectStateSubmitted(1, "已提交");
 
    private final Integer value;
    private final String label;
 
    RawMaterialInspectState(Integer value, String label) {
        this.value = value;
        this.label = label;
    }
 
    public Integer getCode() {
        return value;
    }
 
    public String getValue() {
        return label;
    }
 
    /**
     * 根据值获取对应的枚举
     */
    public static RawMaterialInspectState fromValue(Integer value) {
        for (RawMaterialInspectState type : values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("未知的 RawMaterialInspectState 值: " + value);
    }
}