Browse Source

。。。

WANG 6 years ago
parent
commit
d1030ed189

+ 14 - 0
src/main/java/cn/com/qmth/examcloud/support/cache/CacheHelper.java

@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.support.cache;
 import cn.com.qmth.examcloud.support.cache.bean.AppCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.ExamRecordPropertyCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.PrivilegeRolesCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.RootOrgPrivilegesCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.SmsAssemblyCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
 import cn.com.qmth.examcloud.web.cache.ObjectRedisCacheProcessor;
@@ -81,4 +82,17 @@ public class CacheHelper {
 				"cn.com.qmth.examcloud.core.basic.service.cache.PrrivilegeRolesCache");
 	}
 
+	/**
+	 * 获取顶级机构关联的角色集合
+	 *
+	 * @author WANGWEI
+	 * @param rootOrgId
+	 * @return
+	 */
+	public static RootOrgPrivilegesCacheBean getRootOrgPrivileges(Long rootOrgId) {
+		return ObjectRedisCacheProcessor.get("$__ROOT_ORG_PRIVS:", new Object[]{rootOrgId},
+				PrivilegeRolesCacheBean.class, "EC-CORE-BASIC",
+				"cn.com.qmth.examcloud.core.basic.service.cache.RootOrgPrrivilegesCache");
+	}
+
 }

+ 41 - 0
src/main/java/cn/com/qmth/examcloud/support/cache/bean/RootOrgPrivilegesCacheBean.java

@@ -0,0 +1,41 @@
+package cn.com.qmth.examcloud.support.cache.bean;
+
+import java.util.Set;
+
+import cn.com.qmth.examcloud.web.cache.RandomCacheBean;
+
+public class RootOrgPrivilegesCacheBean extends RandomCacheBean {
+
+	private static final long serialVersionUID = 7517123394296666833L;
+
+	private Long rootOrgId;
+
+	private Set<Long> privilegeIdList;
+
+	private Set<String> privilegeCodeList;
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public Set<Long> getPrivilegeIdList() {
+		return privilegeIdList;
+	}
+
+	public void setPrivilegeIdList(Set<Long> privilegeIdList) {
+		this.privilegeIdList = privilegeIdList;
+	}
+
+	public Set<String> getPrivilegeCodeList() {
+		return privilegeCodeList;
+	}
+
+	public void setPrivilegeCodeList(Set<String> privilegeCodeList) {
+		this.privilegeCodeList = privilegeCodeList;
+	}
+
+}