yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.qianwen.smartman.modules.cps.enums;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/enums/MaterialPropertyEnum.class */
public enum MaterialPropertyEnum {
    T1(1, "原材料"),
    T2(2, "半成品"),
    T3(3, "成品"),
    T4(4, "备品备件"),
    T5(5, "辅助用品"),
    T9(9, "其它");
    
    private final int type;
    private final String desc;
 
    MaterialPropertyEnum(final int type, final String desc) {
        this.type = type;
        this.desc = desc;
    }
 
    public int getType() {
        return this.type;
    }
 
    public String getDesc() {
        return this.desc;
    }
 
    public static MaterialPropertyEnum of(Integer status) {
        if (status == null) {
            return null;
        }
        MaterialPropertyEnum[] values = values();
        for (MaterialPropertyEnum materialPropertyEnum : values) {
            if (materialPropertyEnum.type == status.intValue()) {
                return materialPropertyEnum;
            }
        }
        return null;
    }
 
    public static Integer getType(String desc) {
        if (desc == null) {
            return null;
        }
        MaterialPropertyEnum[] values = values();
        for (MaterialPropertyEnum materialPropertyEnum : values) {
            if (desc.equals(materialPropertyEnum.desc)) {
                return Integer.valueOf(materialPropertyEnum.type);
            }
        }
        return null;
    }
 
    public static String getDesc(Integer type) {
        if (type == null) {
            return null;
        }
        MaterialPropertyEnum[] values = values();
        for (MaterialPropertyEnum materialPropertyEnum : values) {
            if (type.intValue() == materialPropertyEnum.type) {
                return materialPropertyEnum.desc;
            }
        }
        return null;
    }
}