|
|
|
@ -11,6 +11,51 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
* @Modify:
|
|
|
|
|
**/
|
|
|
|
|
public class AndonEnumUtil {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 安灯配置表分组列枚举
|
|
|
|
|
* 10-是,20-否
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum ANDON_CONFIG_GROUP {
|
|
|
|
|
BROAD_GROUP(10,"广播配置分组");
|
|
|
|
|
|
|
|
|
|
private int value;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
ANDON_CONFIG_GROUP(int value, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String valueOfDescription(int val) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (values()[i].value == val) {
|
|
|
|
|
tmp = values()[i].description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int descriptionOfValue(String val) {
|
|
|
|
|
int tmp = -1;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (StringUtils.equalsIgnoreCase(values()[i].description, val)) {
|
|
|
|
|
tmp = values()[i].value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 成功失败标识
|
|
|
|
|
*
|
|
|
|
|