package com.example.common.enums;

/**
 * 功能：
 *
 * @author 熊浩毅
 * @time 2024-02-10 21:22
 * @Description
 */
public enum OrderStatusToShop {
    CANCEL("已取消",-1),
    // 商家自动接单 直接跳转到待出餐！
    NO_OUT("待出餐",1),
    NO_GET("待取餐",2), // 自提
    NO_COMMENT("待评价",3),
    DONE("已完成",4),
        ;
    private String value;
    private Integer order;
//    public static Integer[] orderList = {1,2,3,4};
//    public static Map<Integer,OrderStatusToShop> statusMap;
    OrderStatusToShop(String value, Integer order){
        this.order = order;
        this.value = value;
//        OrderStatusToShop.statusMap.put(order,this);
    }
    public String getValue() {
        return value;
    }

    /**
     * 切换到下一个状态
     * @return
     */
    public OrderStatusToShop nextStatus(){
        OrderStatusToShop [] values = OrderStatusToShop.values();
        int nextOrdinal = this.ordinal()+1;
        if(nextOrdinal < values.length){
            return  values[nextOrdinal];
        }
        return null;
    }
}
