package com.fs.erp.dto.sdk.wangdian.enums;

public enum FenxiaoType {
    DAIXIAO(1, "代销"),
    JINGXIAO(2, "经销");

    private final int value;
    private final String description;

    FenxiaoType(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据类型值获取枚举实例
     * @param value 类型值
     * @return 对应的枚举实例, 如果找不到则返回 null
     */
     public static FenxiaoType fromValue(int value){
         for(FenxiaoType type : FenxiaoType.values()){
             if(type.value == value){
                 return  type;
             }
         }
         return null;
     }
}
