package com.crm.rely.backend.core.constant;

/**
 * 常用的状态管理
 *
 * @author y
 * @create 2022/1/21
 */
public enum SalesKpiType {


    DW(1, "DW"),
    AGENT_COMMISSION(2, "AGENT_COMMISSION"),
    HIDE_REBATE(3, "HIDE_REBATE");


    private final Integer code;
    private final String desc;

    SalesKpiType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static SalesKpiType matchCode(Integer code) {
        for (SalesKpiType type : SalesKpiType.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;
    }


}
