package cn.com.countrygarden.bi.main.constant.wcx.enumeration;

/**
 * 系统角色
 * Created by ADMS on 2018/7/14.
 */
public enum WcxSysRoleEnum {
    WCX_AC("wcx_ac", "1"),
    WCX_KF("wcx_kf", "2"),
    WCX_BA("wcx_ba", "3"),
    WCX_BJ("wcx_bj", "4"),
    WCX_LH("wcx_lh", "5"),
    WCX_GC("wcx_gc", "6"),
    WCX_FW("wcx_fw", "7"),
    WCX_QY("wcx_qy", "0"), // 0 号权限特殊意义
    WCX_ADMIN("wcx_admin", "Z"), // Z表示为所有权限
    ADMIN("admin", "Z");

    String roleCode;
    String baselineCode;

    WcxSysRoleEnum(String roleCode, String baselineCode) {
        this.roleCode = roleCode;
        this.baselineCode = baselineCode;
    }

    /**
     * 获取奖单处理方式
     */
    public static String getBaselineCode(String roleCode) {
        for (WcxSysRoleEnum e : WcxSysRoleEnum.values()) {
            if (e.roleCode.equals(roleCode)) {
                return e.baselineCode;
            }
        }
        return null;
    }
    public static String getRoleCode(String baselineCode) {
        for (WcxSysRoleEnum e : WcxSysRoleEnum.values()) {
            if (e.baselineCode.equals(baselineCode)) {
                return e.roleCode;
            }
        }
        return null;
    }
}
