提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author : 260611 |
|
6 |
* @description : 作业统计检测类型 |
|
7 |
* @since : Created in 2022/03/08 15:25 |
|
8 |
*/ |
|
9 |
|
|
10 |
public enum EM_WORKSTATDETECTION_TYPE { |
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
EM_WORKSTATDETECTION_UNKNOWN(0, "未知"), |
|
15 |
/** |
|
16 |
* 脱岗检测 |
|
17 |
*/ |
|
18 |
EM_WORKSTATDETECTION_NO_WORKER(1, "脱岗检测"), |
|
19 |
/** |
|
20 |
* 单人作业 |
|
21 |
*/ |
|
22 |
EM_WORKSTATDETECTION_SINGLE_WORKER(2, "单人作业"), |
|
23 |
/** |
|
24 |
* 工作负责人脱岗检测 |
|
25 |
*/ |
|
26 |
EM_WORKSTATDETECTION_NO_WORKER_LEADER(3, "工作负责人脱岗检测"), |
|
27 |
/** |
|
28 |
* 手部消毒检测 |
|
29 |
*/ |
|
30 |
EM_WORKSTATDETECTION_HAND_DISINFECTION(4, "手部消毒检测"), |
|
31 |
/** |
|
32 |
* 蘸脚动作检测 |
|
33 |
*/ |
|
34 |
EM_WORKSTATDETECTION_FOOT_DIP(5, "蘸脚动作检测"), |
|
35 |
/** |
|
36 |
* 换鞋动作检测 |
|
37 |
*/ |
|
38 |
EM_WORKSTATDETECTION_SHOES_CHANGE(6, "换鞋动作检测"); |
|
39 |
|
|
40 |
private int value; |
|
41 |
|
|
42 |
private String note; |
|
43 |
|
|
44 |
public String getNote() { |
|
45 |
return note; |
|
46 |
} |
|
47 |
|
|
48 |
public int getValue() { |
|
49 |
return value; |
|
50 |
} |
|
51 |
|
|
52 |
EM_WORKSTATDETECTION_TYPE(int givenValue, String note) { |
|
53 |
this.value = givenValue; |
|
54 |
this.note = note; |
|
55 |
} |
|
56 |
|
|
57 |
public static String getNoteByValue(int givenValue) { |
|
58 |
for (EM_WORKSTATDETECTION_TYPE enumType : EM_WORKSTATDETECTION_TYPE.values()) { |
|
59 |
if (givenValue == enumType.getValue()) { |
|
60 |
return enumType.getNote(); |
|
61 |
} |
|
62 |
} |
|
63 |
return null; |
|
64 |
} |
|
65 |
|
|
66 |
public static int getValueByNote(String givenNote) { |
|
67 |
for (EM_WORKSTATDETECTION_TYPE enumType : EM_WORKSTATDETECTION_TYPE.values()) { |
|
68 |
if (givenNote.equals(enumType.getNote())) { |
|
69 |
return enumType.getValue(); |
|
70 |
} |
|
71 |
} |
|
72 |
return -1; |
|
73 |
} |
|
74 |
|
|
75 |
public static EM_WORKSTATDETECTION_TYPE getEnum(int value) { |
|
76 |
for (EM_WORKSTATDETECTION_TYPE e : EM_WORKSTATDETECTION_TYPE.values()) { |
|
77 |
if (e.getValue() == value) |
|
78 |
return e; |
|
79 |
} |
|
80 |
return EM_WORKSTATDETECTION_TYPE.EM_WORKSTATDETECTION_UNKNOWN; |
|
81 |
} |
|
82 |
|
|
83 |
} |