|
@@ -12,83 +12,82 @@ import cn.com.qmth.examcloud.web.cache.ObjectRedisCacheProcessor;
|
|
|
*/
|
|
|
public class CacheHelper {
|
|
|
|
|
|
- /**
|
|
|
- * 获取APP
|
|
|
- *
|
|
|
- * @param appId
|
|
|
- * @return
|
|
|
- * @author WANGWEI
|
|
|
- */
|
|
|
- public static AppCacheBean getApp(Long appId) {
|
|
|
- return ObjectRedisCacheProcessor.get("$_APP:", new Object[]{appId}, AppCacheBean.class);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取系统属性<br>
|
|
|
- *
|
|
|
- * @param propKey
|
|
|
- * @return
|
|
|
- * @author WANGWEI
|
|
|
- */
|
|
|
- public static SysPropertyCacheBean getSysProperty(String propKey) {
|
|
|
- return ObjectRedisCacheProcessor.get("$_SYS_PROP:", new Object[]{propKey},
|
|
|
- SysPropertyCacheBean.class, "EC-CORE-BASIC",
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.SystemPropertyCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据考试记录id获取考试信息<br>
|
|
|
- *
|
|
|
- * @param propKey
|
|
|
- * @return
|
|
|
- * @author WANGWEI
|
|
|
- */
|
|
|
- public static ExamRecordPropertyCacheBean getExamRecordProperty(Long examRecordDataId) {
|
|
|
- return ObjectRedisCacheProcessor.get("OE_EXAM_RECORD_PROP:", new Object[]{examRecordDataId},
|
|
|
- ExamRecordPropertyCacheBean.class, "EC-CORE-OE-STUDENT",
|
|
|
- "cn.com.qmth.examcloud.core.oe.common.cache.ExamRecordPropertyCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据短信配置代码获取短信配置详情
|
|
|
- *
|
|
|
- * @param smsAssemblyCode
|
|
|
- * 短信配置代码
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static SmsAssemblyCacheBean getSmsAssembly(String smsAssemblyCode) {
|
|
|
- return ObjectRedisCacheProcessor.get("B_SMS_ASSEMBLY_PROP:", new Object[]{smsAssemblyCode},
|
|
|
- SmsAssemblyCacheBean.class, "EC-CORE-BASIC",
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.SmsAssemblyCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取权限关联的角色集合
|
|
|
- *
|
|
|
- * @param rootOrgId
|
|
|
- * @param privilegeCode
|
|
|
- * @return
|
|
|
- * @author WANGWEI
|
|
|
- */
|
|
|
- public static PrivilegeRolesCacheBean getPrivilegeRoles(Long rootOrgId, String privilegeCode) {
|
|
|
- return ObjectRedisCacheProcessor.get("$_PRIV_ROLES:",
|
|
|
- new Object[]{rootOrgId, privilegeCode}, PrivilegeRolesCacheBean.class,
|
|
|
- "EC-CORE-BASIC",
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.PrrivilegeRolesCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取顶级机构关联的角色集合
|
|
|
- *
|
|
|
- * @param rootOrgId
|
|
|
- * @return
|
|
|
- * @author WANGWEI
|
|
|
- */
|
|
|
- public static RootOrgPrivilegesCacheBean getRootOrgPrivileges(Long rootOrgId) {
|
|
|
- return ObjectRedisCacheProcessor.get("B_ROOT_ORG_PRIVS:", new Object[]{rootOrgId},
|
|
|
- PrivilegeRolesCacheBean.class, "EC-CORE-BASIC",
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.RootOrgPrrivilegesCache");
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 获取APP
|
|
|
+ *
|
|
|
+ * @param appId
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static AppCacheBean getApp(Long appId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("$_APP:", new Object[]{appId}, AppCacheBean.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取系统属性<br>
|
|
|
+ *
|
|
|
+ * @param propKey
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static SysPropertyCacheBean getSysProperty(String propKey) {
|
|
|
+ return ObjectRedisCacheProcessor.get("$_SYS_PROP:", new Object[]{propKey},
|
|
|
+ SysPropertyCacheBean.class, "EC-CORE-BASIC",
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.SystemPropertyCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据考试记录id获取考试信息<br>
|
|
|
+ *
|
|
|
+ * @param propKey
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static ExamRecordPropertyCacheBean getExamRecordProperty(Long examRecordDataId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("OE_EXAM_RECORD_PROP:", new Object[]{examRecordDataId},
|
|
|
+ ExamRecordPropertyCacheBean.class, "EC-CORE-OE-STUDENT",
|
|
|
+ "cn.com.qmth.examcloud.core.oe.common.cache.ExamRecordPropertyCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据短信配置代码获取短信配置详情
|
|
|
+ *
|
|
|
+ * @param smsAssemblyCode 短信配置代码
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static SmsAssemblyCacheBean getSmsAssembly(String smsAssemblyCode) {
|
|
|
+ return ObjectRedisCacheProcessor.get("B_SMS_ASSEMBLY_PROP:", new Object[]{smsAssemblyCode},
|
|
|
+ SmsAssemblyCacheBean.class, "EC-CORE-BASIC",
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.SmsAssemblyCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取权限关联的角色集合
|
|
|
+ *
|
|
|
+ * @param rootOrgId
|
|
|
+ * @param privilegeCode
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static PrivilegeRolesCacheBean getPrivilegeRoles(Long rootOrgId, String privilegeCode) {
|
|
|
+ return ObjectRedisCacheProcessor.get("$_PRIV_ROLES:",
|
|
|
+ new Object[]{rootOrgId, privilegeCode}, PrivilegeRolesCacheBean.class,
|
|
|
+ "EC-CORE-BASIC",
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.PrrivilegeRolesCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取顶级机构关联的角色集合
|
|
|
+ *
|
|
|
+ * @param rootOrgId
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static RootOrgPrivilegesCacheBean getRootOrgPrivileges(Long rootOrgId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("B_ROOT_ORG_PRIVS:", new Object[]{rootOrgId},
|
|
|
+ PrivilegeRolesCacheBean.class, "EC-CORE-BASIC",
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.RootOrgPrrivilegesCache");
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 获取调卷规则信息(题库)
|
|
@@ -147,98 +146,109 @@ public class CacheHelper {
|
|
|
"cn.com.qmth.examcloud.core.questions.service.cache.QuestionCache");
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 查询课程
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param courseId
|
|
|
- * @param rootOrgId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static CourseCacheBean getCourse(Long courseId) {
|
|
|
- return ObjectRedisCacheProcessor.get("B_COURSE:", new Object[]{courseId},
|
|
|
- CourseCacheBean.class, "EC-CORE-BASIC",
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.CourseCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询学生
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param courseId
|
|
|
- * @param rootOrgId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static StudentCacheBean getStudent(Long studentId) {
|
|
|
- return ObjectRedisCacheProcessor.get("B_STUDENT:", new Object[]{studentId},
|
|
|
- StudentCacheBean.class, "EC-CORE-BASIC",
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.StudentCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询考试机构配置
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param examId
|
|
|
- * @param orgId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static ExamOrgSettingsCacheBean getExamOrgSettings(Long examId, Long orgId) {
|
|
|
- return ObjectRedisCacheProcessor.get("E_EXAM_ORG_SETTINGS:", new Object[]{examId, orgId},
|
|
|
- ExamOrgSettingsCacheBean.class, "EC-CORE-EXAMWORK",
|
|
|
- "cn.com.qmth.examcloud.core.examwork.service.cache.ExamOrgSettingsCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询考试机构属性
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param examId
|
|
|
- * @param orgId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static ExamOrgPropertyCacheBean getExamOrgProperty(Long examId, Long orgId, String key) {
|
|
|
- return ObjectRedisCacheProcessor.get("E_EXAM_ORG_PROP:", new Object[]{examId, orgId, key},
|
|
|
- ExamOrgSettingsCacheBean.class, "EC-CORE-EXAMWORK",
|
|
|
- "cn.com.qmth.examcloud.core.examwork.service.cache.ExamOrgPropertyCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询考试
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param examId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static ExamSettingsCacheBean getExamSettings(Long examId) {
|
|
|
- return ObjectRedisCacheProcessor.get("E_EXAM:", new Object[]{examId},
|
|
|
- ExamSettingsCacheBean.class, "EC-CORE-EXAMWORK",
|
|
|
- "cn.com.qmth.examcloud.core.examwork.service.cache.ExamSettingsCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询机构
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param orgId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static OrgCacheBean getOrg(Long orgId) {
|
|
|
- return ObjectRedisCacheProcessor.get("B_ORG:", new Object[]{orgId}, OrgCacheBean.class,
|
|
|
- "EC-CORE-BASIC", "cn.com.qmth.examcloud.core.basic.service.cache.OrgCache");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过域名查询顶级机构
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param domain
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static RootOrgCacheBean getRootOrg(String domain) {
|
|
|
- return ObjectRedisCacheProcessor.get("B_ROOT_ORG:", new Object[]{domain},
|
|
|
- RootOrgCacheBean.class, "EC-CORE-BASIC",
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.RootOrgCache");
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 获取试题答案(题库)
|
|
|
+ *
|
|
|
+ * @param questionId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static QuestionAnswerCacheBean getQuestionAnswer(String questionId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("Q_QUESTION:ANSWER_", new Object[]{questionId},
|
|
|
+ QuestionAnswerCacheBean.class, "EC-CORE-QUESTION",
|
|
|
+ "cn.com.qmth.examcloud.core.questions.service.cache.QuestionAnswerCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询课程
|
|
|
+ *
|
|
|
+ * @param courseId
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static CourseCacheBean getCourse(Long courseId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("B_COURSE:", new Object[]{courseId},
|
|
|
+ CourseCacheBean.class, "EC-CORE-BASIC",
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.CourseCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询学生
|
|
|
+ *
|
|
|
+ * @param courseId
|
|
|
+ * @param rootOrgId
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static StudentCacheBean getStudent(Long studentId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("B_STUDENT:", new Object[]{studentId},
|
|
|
+ StudentCacheBean.class, "EC-CORE-BASIC",
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.StudentCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询考试机构配置
|
|
|
+ *
|
|
|
+ * @param examId
|
|
|
+ * @param orgId
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static ExamOrgSettingsCacheBean getExamOrgSettings(Long examId, Long orgId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("E_EXAM_ORG_SETTINGS:", new Object[]{examId, orgId},
|
|
|
+ ExamOrgSettingsCacheBean.class, "EC-CORE-EXAMWORK",
|
|
|
+ "cn.com.qmth.examcloud.core.examwork.service.cache.ExamOrgSettingsCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询考试机构属性
|
|
|
+ *
|
|
|
+ * @param examId
|
|
|
+ * @param orgId
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static ExamOrgPropertyCacheBean getExamOrgProperty(Long examId, Long orgId, String key) {
|
|
|
+ return ObjectRedisCacheProcessor.get("E_EXAM_ORG_PROP:", new Object[]{examId, orgId, key},
|
|
|
+ ExamOrgSettingsCacheBean.class, "EC-CORE-EXAMWORK",
|
|
|
+ "cn.com.qmth.examcloud.core.examwork.service.cache.ExamOrgPropertyCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询考试
|
|
|
+ *
|
|
|
+ * @param examId
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static ExamSettingsCacheBean getExamSettings(Long examId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("E_EXAM:", new Object[]{examId},
|
|
|
+ ExamSettingsCacheBean.class, "EC-CORE-EXAMWORK",
|
|
|
+ "cn.com.qmth.examcloud.core.examwork.service.cache.ExamSettingsCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询机构
|
|
|
+ *
|
|
|
+ * @param orgId
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static OrgCacheBean getOrg(Long orgId) {
|
|
|
+ return ObjectRedisCacheProcessor.get("B_ORG:", new Object[]{orgId}, OrgCacheBean.class,
|
|
|
+ "EC-CORE-BASIC", "cn.com.qmth.examcloud.core.basic.service.cache.OrgCache");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过域名查询顶级机构
|
|
|
+ *
|
|
|
+ * @param domain
|
|
|
+ * @return
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static RootOrgCacheBean getRootOrg(String domain) {
|
|
|
+ return ObjectRedisCacheProcessor.get("B_ROOT_ORG:", new Object[]{domain},
|
|
|
+ RootOrgCacheBean.class, "EC-CORE-BASIC",
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.RootOrgCache");
|
|
|
+ }
|
|
|
|
|
|
}
|