package com.qmth.sop.common.enums;

/**
 * 角色类型
 *
 * @Date: 2021/3/23.
 */
public enum RoleTypeEnum {

    ADMIN("系统管理员", "系统角色"),

    PMO("总负责人", "系统角色"),

    BUSSINESS("业务线负责人", "系统角色"),

    REGION_MANAGER("大区经理", "系统角色"),

    //regionCoordinator
    REGION_COORDINATOR("区域协调人", "外包角色"),

    //effectEngineer
    EFFECT_ENGINEER("实施工程师", "外包角色"),

    //assistantEngineer
    ASSISTANT_ENGINEER("助理工程师", "外包角色"),

    QA("QA", "系统角色"),

    CUSTOM("技术客服", "系统角色"),

    ACCOUNT_MANAGER("客户经理", "系统角色"),

    THIRD_PMO("乙方总负责人", "系统角色"),

    DEVICE_DELIVERY("设备发货员", "系统角色"),

    DEFINED("自定义", "自定义角色");

    RoleTypeEnum(String desc, String title) {
        this.desc = desc;
        this.title = title;
    }

    private String desc;

    private String title;

    public String getDesc() {
        return desc;
    }

    public String getTitle() {
        return title;
    }

    /**
     * 根据desc查找枚举类
     *
     * @param desc desc
     * @return 枚举类
     */
    public static RoleTypeEnum convertDescToEnum(String desc) {
        RoleTypeEnum res = null;
        for (RoleTypeEnum value : RoleTypeEnum.values()) {
            if (desc.equals(value.getDesc())) {
                res = value;
            }
        }
        return res;
    }
}
