package com.goafanti.order.enums;

import java.util.HashMap;
import java.util.Map;

public enum SalesTypes {

    dhxkf(0,"电话新开发"),
    dhzdzy(1,"电话自带资源"),
    wl(2,"网络"),
    qd(3,"渠道"),
    zjs(4,"转介绍"),
    qt(5,"其他"),
    gxfg(6,"高新复购"),
    qtfg(7,"其他复购");

    private Integer code;
    private String desc;

    private SalesTypes(Integer code, String desc){
        this.code=code;
        this.desc=desc;
    }
    private static Map<Integer , SalesTypes> map=new HashMap<>();

    static {
        for (SalesTypes value : SalesTypes.values()) {
            map.put(value.code,value);
        }
    }

    public static String getValueByCode(Integer code){
        for(SalesTypes o:SalesTypes.values()){
            if(code.equals(o.getCode())){
                return o.getDesc();
            }
        }
        return  null;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
