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
  | package com.zy.core.enums; 
 |    
 |  public enum CrnStatusType { 
 |    
 |      IDLE(0, "空闲,无任务"), 
 |      FETCH_POSITION(1, "取货定位中"), 
 |      FETCHING(2, "取货中"), 
 |      PUT_POSITION(3, "取货完成,放货定位中"), 
 |      PUTTING(4, "放货中"), 
 |      TO_ORIGIN(5, "回原点中"), 
 |      ORIGIN(6, "反原点"), 
 |      LOC_MOVE(7, "库位移位"), 
 |      POSITON_MOVE(10, "坐标移行"), 
 |      FETCH_WAITING(21, "等待取货允许"), 
 |      PUT_WAITING(22, "等待放货允许"), 
 |      WAITING(90, "任务完成等待WCS确认"), 
 |      SOS(99, "报警"), 
 |      ; 
 |    
 |      public Integer id; 
 |      public String desc; 
 |      CrnStatusType(Integer id, String desc) { 
 |          this.id = id; 
 |          this.desc = desc; 
 |      } 
 |    
 |      public static CrnStatusType get(Short id) { 
 |          if (null == id) { 
 |              return null; 
 |          } 
 |          for (CrnStatusType type : CrnStatusType.values()) { 
 |              if (type.id.equals(id.intValue())) { 
 |                  return type; 
 |              } 
 |          } 
 |          return null; 
 |      } 
 |    
 |      public static CrnStatusType get(CrnStatusType type) { 
 |          if (null == type) { 
 |              return null; 
 |          } 
 |          for (CrnStatusType crnStatusType : CrnStatusType.values()) { 
 |              if (crnStatusType == type) { 
 |                  return crnStatusType; 
 |              } 
 |          } 
 |          return null; 
 |      } 
 |  } 
 |  
  |