package com.cusc.nirvana.user.rnr.fp.constants;

/**
 * Description: 组织业务类型枚举
 * <br />
 * CreateDate 2022-05-19 19:43:58
 *
 * @author yuyi
 **/
public enum OrganBizzTypeEnum {
    /**
     * 车厂
     */
    CAR_FACTORY(1, "车厂"),
    /**
     * 经销商
     */
    DISTRIBUTOR(2, "经销商"),
    /**
     * 车企子组织
     */
    CAR_SUB_ORGAN(3, "车企子组织");

    private int code;
    private String name;

    OrganBizzTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static OrganBizzTypeEnum getEnumByCode(int code) {
        for (OrganBizzTypeEnum e : OrganBizzTypeEnum.values()) {
            if (e.getCode() == code) {
                return e;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
