package com.tmerclub.cloud.common.order.constant;

/**
 * 库存模式
 * @author admin
 */
public enum StockModeEnum {
    /**
     * 共享总部库存
     */
    ALL_STOCK(1, "共享总部库存"),
    /**
     * 独立销售库存
     */
    SINGLE_STOCK(2, "独立销售库存");

    private final Integer num;
    private final String name;

    public Integer value() {
        return num;
    }

    StockModeEnum(Integer num, String name) {
        this.num = num;
        this.name = name;
    }

    public static StockModeEnum instance(Integer value) {
        StockModeEnum[] enums = values();
        for (StockModeEnum statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }
}
