|
|
@@ -0,0 +1,59 @@
|
|
|
+package shop.alien.util.common.constant;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 订单状态枚举
|
|
|
+ */
|
|
|
+public enum OrderStatusEnum {
|
|
|
+ //(0,待支付;1,已支付/待使用;2,已核销;3,已过期;4,已取消;5.已退款,全退款了才算;
|
|
|
+ /**
|
|
|
+ * 待支付
|
|
|
+ */
|
|
|
+ WAIT_PAY(0, "待支付"),
|
|
|
+ /**
|
|
|
+ * 已支付/待使用
|
|
|
+ */
|
|
|
+ WAIT_USE(1, "已支付/待使用"),
|
|
|
+ /**
|
|
|
+ * 已核销
|
|
|
+ */
|
|
|
+ USED(2, "已核销"),
|
|
|
+ /**
|
|
|
+ * 已过期
|
|
|
+ */
|
|
|
+ EXPIRE(3, "已过期"),
|
|
|
+ /**
|
|
|
+ * 已取消
|
|
|
+ */
|
|
|
+ CANCEL(4, "已取消"),
|
|
|
+ /**
|
|
|
+ * 已退款
|
|
|
+ */
|
|
|
+ REFUND(5, "已退款");
|
|
|
+
|
|
|
+
|
|
|
+ private final Integer status;
|
|
|
+ // 属性值
|
|
|
+ private final String description;
|
|
|
+ // 构造方法,用于初始化描述信息
|
|
|
+ OrderStatusEnum(Integer status, String description) {
|
|
|
+ this.status = status;
|
|
|
+ this.description = description;
|
|
|
+ }
|
|
|
+ // 提供获取描述信息的方法
|
|
|
+ public static String getDescription(Integer status) {
|
|
|
+ for (OrderStatusEnum orderStatusEnum : OrderStatusEnum.values()) {
|
|
|
+ if (orderStatusEnum.status.equals(status)) {
|
|
|
+ return orderStatusEnum.description;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Integer getStatus() {
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getDescription() {
|
|
|
+ return description;
|
|
|
+ }
|
|
|
+}
|