package com.ruoyi.enums.order;

import java.util.Arrays;

/**
 * 订单状态枚举
 * @Author liwenlong
 */
public enum OrderStatusEnums {

    to_be_confirm(1, "待确认"),
    ongoing(2, "进行中(待支付尾款)"),
    pending_drawings(3, "待上传大图"),
    to_be_evaluated(4, "待评价"),
    cancel(-1, "取消"),


    ;

    private final Integer code;
    private final String name;

    public static String getName(Integer code) {
        return getPayEnums(code).name;
    }


    public static OrderStatusEnums getPayEnums(Integer code) {
        return Arrays.stream(OrderStatusEnums.values()).filter(c->c.getCode().equals(code)).findFirst().get();
    }

    OrderStatusEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }


}
