枚举类加入禁用、启用、全部

yun-zuoyi
Silliter 6 years ago
parent 41a1cc46e8
commit 11a2a72917

@ -2013,4 +2013,46 @@ public class WmsEnumUtil {
return null;
}
}
/**
*
* 1
* 2
* 3
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DATA_STATUS {
ENABLE(1, "启用"),
DISABLE(2, "禁用"),
LOCKING(3, "全部");
private int value;
private String description;
DATA_STATUS() {
}
DATA_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
}

Loading…
Cancel
Save