package com.ruoyi.enums.mallorder;

import java.util.Arrays;

/**
 * 商城订单状态枚举
 * @Author liwenlong
 */
public enum MallOrderStatusEnums {


    已取消(-1, "取消"),

    待付款(1, "待付款"),

    待发货(2, "待发货"),

    已发货(3, "已发货"),

    已完成(4, "已完成"),

    已到账(5, "已到账"),

    已评价(6, "已评价"),


    ;

    private final Integer code;
    private final String name;

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


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

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

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }


}
