郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
 
package com.gkhy.safePlatform.specialWork.enums;
 
import java.util.HashMap;
import java.util.Map;
 
public enum WorkMaterialCheckEnum {
    NOT_ASSOCIATED((byte)-1,"未关联"),
    QUALIFIED((byte)0,"合格"),
    UNQUALIFIED((byte)1,"不合格")
    ;
 
    private Byte type;
    private String desc;
 
    WorkMaterialCheckEnum(Byte type, String desc) {
        this.type = type;
        this.desc = desc;
    }
 
 
    static Map<Byte, WorkMaterialCheckEnum> map;
    static {
        map = new HashMap<>();
        for (WorkMaterialCheckEnum e : WorkMaterialCheckEnum.values()) {
            map.put(e.type, e);
        }
    }
 
 
    public static WorkMaterialCheckEnum parse(Byte type) {
        return map.get(type);
    }
 
    public Byte getType() {
        return type;
    }
 
    public void setType(Byte type) {
        this.type = type;
    }
 
    public String getDesc() {
        return desc;
    }
 
    public void setDesc(String desc) {
        this.desc = desc;
    }
 
    public static boolean checkStepType(Byte type){
        boolean flag = false;
        for (WorkMaterialCheckEnum stepType: WorkMaterialCheckEnum.values()) {
            if (type.equals(stepType.getType())) {
                flag = true;
            }
        }
        return flag;
    }
}