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.nanometer.smartlab.entity.enumtype;
|
| import java.util.*;
|
| public enum OperateStatus {
| ERRORIN(1, "错误入库"),
| USE(2, "领用"),
| STORE(3, "存放"),
| ERRORSTORE(4, "错误存放"),
| WAREHOUSEIN(10, "仓库入库"),
| WAREHOUSEOUT(11, "仓库领用"),
| LABORATORYIN(0, "试剂柜入库"),
| TRANSFER(6,"转移"),
| SCRAP(5, "报废");
| private int key;
|
| private String text;
|
| private OperateStatus(int key, String text) {
| this.key = key;
| this.text = text;
| }
|
| public int getKey() {
| return key;
| }
|
| public String getText() {
| return text;
| }
|
| private static HashMap<Integer,OperateStatus> map = new HashMap<Integer,OperateStatus>();
| static {
| for(OperateStatus d : OperateStatus.values()){
| map.put(d.key, d);
| }
| }
|
| public static OperateStatus parse(Integer index) {
| if(map.containsKey(index)){
| return map.get(index);
| }
| return null;
| }
|
| /**
| * 获取广告位置集合Map
| * @return
| */
| public static List<Map<String,Object>> getOperateStatusList() {
| List<Map<String,Object>> mapList=new ArrayList<>();
| for (OperateStatus operateStatus : EnumSet.allOf(OperateStatus.class)) {
| Map<String,Object> map=new HashMap<>();
| map.put("key",operateStatus.key);
| map.put("value",operateStatus.text);
| mapList.add(map);
| }
| return mapList;
| }
| }
|
|