package com.sqx.modules.printInfo.entity;

/**
 * @Author: binguo
 * @Date: 2023/7/26 星期三 14:55
 * @Description: com.repair.model.enumModel
 * @Version: 1.0
 * 订单状态
 * 0待结算
 * 1待支付
 * 2直接购买（未支付）
 * 3待取餐/派送中
 * 4已完成
 * 5已取消
 * 6制作中
 * 7商家待接单
 * 8商家拒绝接单
 */
public enum eOrderStatus {
    Pending(0),//待结算
    Pendpay(1),//待支付
    Unpaid(2),//直接购买（未支付）
    Waiting(3),//待取餐/派送中
    Completed(4),//已完成
    Cancelled(5),//已取消
    Making(6),//制作中
    Pendorder(7),//商家待接单
    Refuse(8);//商家拒绝接单

    private int value;

    eOrderStatus(int value){
        this.value = value;
    }

    public int getValue() {
        return value;
    }
    public static eOrderStatus valueOf(int value) {
        switch (value) {
            case 0:
                return eOrderStatus.Pending;
            case 1:
                return eOrderStatus.Pendpay;
            case 2:
                return eOrderStatus.Unpaid;
            case 3:
                return eOrderStatus.Waiting;
            case 4:
                return eOrderStatus.Completed;
            case 5:
                return eOrderStatus.Cancelled;
            case 6:
                return eOrderStatus.Making;
            case 7:
                return eOrderStatus.Pendorder;
            case 8:
                return eOrderStatus.Refuse;
            default:
                return null;
        }
    }
    public static String stringOf(Integer value) {
        switch (value) {
            case 0:
                return "待结算";
            case 1:
                return "待支付";
            case 2:
                return "直接购买（未支付）";
            case 3:
                return "待取餐/派送中";
            case 4:
                return "已完成";
            case 5:
                return "已取消";
            case 6:
                return "制作中";
            case 7:
                return "商家待接单";
            case 8:
                return "商家拒绝接单";
            default:
                return null;
        }
    }
    public static Integer integerOf(String value) {
        switch (value) {
            case "待结算":
                return 0;
            case "待支付":
                return 1;
            case "直接购买（未支付）":
                return 2;
            case "待取餐/派送中":
                return 3;
            case "已完成":
                return 4;
            case "已取消":
                return 5;
            case "制作中":
                return 6;
            case "商家待接单":
                return 7;
            case "商家拒绝接单":
                return 8;
            default:
                return null;
        }
    }
}
