BeanServiceFlowEnum.java
1.16 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
41
42
43
44
package com.dituhui.pea.enums;
import org.apache.commons.lang3.StringUtils;
/**
* bean 服务状态枚举
*/
public enum BeanServiceFlowEnum {
//bean 已联系/准备服务/开始服务/结束服务等
//pea 服务状态:INIT-初始化/PENDING待服务/CONTACTED已排期/STARTED-已开始/FINISHED已完成/UNFINISHED-已上门未完成
PENDING("已联系", "PENDING"),
CONTACTED("准备服务", "CONTACTED"),
STARTED("开始服务", "STARTED"),
CANCELED("已取消", "CANCELED"),
FINISHED("结束服务", "FINISHED");
private String name;
private String status;
BeanServiceFlowEnum(String name, String status) {
this.name = name;
this.status = status;
}
public String getName() {
return name;
}
public String getStatus() {
return status;
}
public static String getStatusByName(String name) {
if (StringUtils.isBlank(name)) {
return null;
}
for (BeanServiceFlowEnum value : BeanServiceFlowEnum.values()) {
if (name.equals(value.name)) {
return value.status;
}
}
return null;
}
}