瀏覽代碼

。。。。

WANG 5 年之前
父節點
當前提交
8ca848f09b

+ 119 - 112
src/main/java/cn/com/qmth/examcloud/support/cache/CacheHelper.java

@@ -1,6 +1,14 @@
 package cn.com.qmth.examcloud.support.cache;
 
-import cn.com.qmth.examcloud.support.cache.bean.*;
+import cn.com.qmth.examcloud.support.cache.bean.AppCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.BasePaperCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.ExamRecordPropertyCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.OrgExamConfigCacheBean;
+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;
 
 /**
@@ -12,124 +20,123 @@ 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);
-    }
+	/**
+	 * 获取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");
-    }
+	/**
+	 * 获取系统属性<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");
-    }
+	/**
+	 * 根据考试记录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("SMS_ASSEMBLY_PROP:", new Object[]{smsAssemblyCode},
-                SmsAssemblyCacheBean.class, "EC-CORE-BASIC",
-                "cn.com.qmth.examcloud.core.basic.dao.cache.SmsAssemblyCache");
-    }
+	/**
+	 * 根据短信配置代码获取短信配置详情
+	 *
+	 * @param smsAssemblyCode
+	 *            短信配置代码
+	 * @return
+	 */
+	public static SmsAssemblyCacheBean getSmsAssembly(String smsAssemblyCode) {
+		return ObjectRedisCacheProcessor.get("SMS_ASSEMBLY_PROP:", new Object[]{smsAssemblyCode},
+				SmsAssemblyCacheBean.class, "EC-CORE-BASIC",
+				"cn.com.qmth.examcloud.core.basic.dao.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
+	 * @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("$__ROOT_ORG_PRIVS:", new Object[]{rootOrgId},
-                PrivilegeRolesCacheBean.class, "EC-CORE-BASIC",
-                "cn.com.qmth.examcloud.core.basic.service.cache.RootOrgPrrivilegesCache");
-    }
+	/**
+	 * 获取顶级机构关联的角色集合
+	 *
+	 * @param rootOrgId
+	 * @return
+	 * @author WANGWEI
+	 */
+	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");
+	}
 
-    /**
-     * @description 获取原始试卷
-     * @param examId 考试id
-     * @param courseCode 课程代码
-     * @param paperType 试卷类型
-     * @date 2019/7/30 16:00
-     * @author lideyin
-     * @return cn.com.qmth.examcloud.support.cache.bean.BasePaperCacheBean
-     */
-    public static BasePaperCacheBean getBasePaper(Long examId,String courseCode,String paperType) {
-        return ObjectRedisCacheProcessor.get("OE_BASE_PAPER_PROP:", new Object[]{examId,courseCode,paperType},
-                BasePaperCacheBean.class, "EC-CORE-OE-STUDENT",
-                "cn.com.qmth.examcloud.core.oe.common.cache.BasePaperCache");
-    }
+	/**
+	 * 获取原始试卷
+	 *
+	 * @param examId
+	 * @param courseCode
+	 * @param paperType
+	 * @return
+	 */
+	public static BasePaperCacheBean getBasePaper(Long examId, String courseCode,
+			String paperType) {
+		return null;
+	}
 
-    /**
-     * @description 获取课程信息
-     * @param courseId 课程id
-     * @param rootOrgId 学校id
-     * @date 2019/7/30 15:58
-     * @author lideyin
-     * @return cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean
-     */
-    public static CourseCacheBean getCourse(Long courseId,Long rootOrgId) {
-        return ObjectRedisCacheProcessor.get("OE_COURSE_PROP:", new Object[]{courseId,rootOrgId},
-                CourseCacheBean.class, "EC-CORE-OE-STUDENT",
-                "cn.com.qmth.examcloud.core.oe.common.cache.CourseCache");
-    }
+	/**
+	 * 查询课程
+	 *
+	 * @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");
+	}
 
-    /**
-     * @description 获取考试信息
-     * @param examId 考试id
-     * @param orgId 学习中心id
-     * @date 2019/7/30 15:51
-     * @author lideyin
-     * @return cn.com.qmth.examcloud.support.cache.bean.ExamCacheBean
-     */
-    public static ExamCacheBean getExam(Long examId, Long orgId) {
-        return ObjectRedisCacheProcessor.get("OE_EXAM_PROP:", new Object[]{examId, orgId},
-                ExamCacheBean.class, "EC-CORE-OE-STUDENT",
-                "cn.com.qmth.examcloud.core.oe.common.cache.ExamCache");
-    }
+	/**
+	 * 查询机构考试配置
+	 *
+	 * @author WANGWEI
+	 * @param examId
+	 * @param orgId
+	 * @return
+	 */
+	public static OrgExamConfigCacheBean getOrgExamConfig(Long examId, Long orgId) {
+		return ObjectRedisCacheProcessor.get("E_ORG_EXAM_CONF:", new Object[]{examId, orgId},
+				OrgExamConfigCacheBean.class, "EC-CORE-EXAMWORK",
+				"cn.com.qmth.examcloud.core.examwork.service.cache.OrgExamConfigCache");
+	}
 
 }

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/support/cache/bean/ExamCacheBean.java → src/main/java/cn/com/qmth/examcloud/support/cache/bean/OrgExamConfigCacheBean.java

@@ -10,7 +10,7 @@ import java.util.Date;
  * @Date 2019/7/30 14:20
  * @Version 1.0
  */
-public class ExamCacheBean extends RandomCacheBean {
+public class OrgExamConfigCacheBean extends RandomCacheBean {
 
 	private static final long serialVersionUID = -8007446755455123835L;
 	private Long id;