yun-zuoyi
joke.wang 5 years ago
parent 9b6be3167d
commit 54a51a4c69

@ -5837,7 +5837,18 @@ public class MesEnumUtil {
STRING("10", "String", "字符串"),
BOOLEAN("20","Boolean", "布尔"),
WORD("30", "Word", "整形-Word"),
DWORD("40","Dword", "整形-DWord");
DWORD("40","Dword", "整形-DWord"),
LONG("50", "Long", "长整形-Long"),
SHORT("60", "Short", "UShort"),
DOUBLE("70", "Double", "双精度-Double"),
FLOAT("80", "Float", "单精度-Float"),
LLONG("90", "LLong", "LLONG"),
QWORD("100", "QWord", "QWORD"),
BCD("110", "BCD", "BCD"),
LBCD("120", "LBCD", "LBCD"),
BYTE("130", "Byte", "Byte"),
CHAR("140", "Char", "Char"),
Date("150", "DateTime", "日期");
private String value;
private String code;

@ -4423,4 +4423,50 @@ public class MesPcnEnumUtil {
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum VALUE_RANGE {
SCAN(10, "扫描"),
READ_CACHE(20, "读取缓存");
private int value;
private String description;
VALUE_RANGE(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 Integer descriptionOfValue(String description) {
Integer tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(description)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
}

Loading…
Cancel
Save