yun-zuoyi
amy 6 years ago
commit 0d39621875

@ -139,4 +139,49 @@ public class SwebEnumUtil {
return description;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ORDER_TYPE {
CREATE(10, "标准包装"),
RECEIPT(20, "非标包装");
private int value;
private String description;
ORDER_TYPE(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOf(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 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