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

/**
 * 微创新区域基线权限审核用
 * @author chw
 */

public enum WcxAuditRoleEnum {
    //区域基线权限
    QY_AC("wcx_ac_sh", "1"),
    QY_KF("wcx_kf_sh", "2"),
    QY_BA("wcx_ba_sh", "3"),
    QY_BJ("wcx_bj_sh", "4"),
    QY_LH("wcx_lh_sh", "5"),
    QY_GC("wcx_gc_sh", "6"),
    QY_FW("wcx_fw_sh", "7"),
    // Z表示为所有权限
    QY_ADMIN("wcx_admin_sh", "Z");

    String roleCode;
    String baselineCode;

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

    /**
     * 获取对应的基线
     */
    public static String getBaselineCode(String roleCode) {
        for (WcxAuditRoleEnum e : WcxAuditRoleEnum.values()) {
            if (e.roleCode.equals(roleCode)) {
                return e.baselineCode;
            }
        }
        return null;
    }
    public static String getRoleCode(String baselineCode) {
        for (WcxAuditRoleEnum e : WcxAuditRoleEnum.values()) {
            if (e.baselineCode.equals(baselineCode)) {
                return e.roleCode;
            }
        }
        return null;
    }
}
