TaskStatusAgvEnum.java
1.24 KB
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
package com.huaheng.common.utils;
public enum TaskStatusAgvEnum {
TASK1(1, "创建"),
TASK10(10, "下发ACS"),
TASK20(20, "取料"),
TASK30(30, "执行中"),
TASK100(100, "AGV任务完成");
// TASK50(50, "XZ00014");
private Integer taskStatusName;
private String taskStatusCode;
// 构造方法
private TaskStatusAgvEnum(Integer taskStatusName, String taskStatusCode) {
this.taskStatusName = taskStatusName;
this.taskStatusCode = taskStatusCode;
}
public static String getTaskStatusCode(Integer taskStatusName){
for (TaskStatusAgvEnum taskStatusEnum : TaskStatusAgvEnum.values()) {
if (taskStatusEnum.taskStatusName.equals(taskStatusName)){
return taskStatusEnum.taskStatusCode;
}
}
return null;
}
public static void main(String[] args) {
TaskStatusAgvEnum[] values = TaskStatusAgvEnum.values();
// for (TaskStatusEnum value : values) {
// System.out.println(value + " taskStatusCode: " + value.taskStatusCode + " taskStatusName: " + value.taskStatusName);
// }
// System.out.println("======================");
System.out.println(TaskStatusAgvEnum.getTaskStatusCode(10));
}
}