wangliang 4 سال پیش
والد
کامیت
e74c50e942

+ 3 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamActivityServiceImpl.java

@@ -6,6 +6,7 @@ import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
 import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
+import com.qmth.themis.business.constant.SpringContextHolder;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dao.TEExamActivityMapper;
 import com.qmth.themis.business.dto.MqDto;
@@ -309,8 +310,9 @@ public class TEExamActivityServiceImpl extends ServiceImpl<TEExamActivityMapper,
                 }
                 this.saveOrUpdate(s);
             });
+            TEExamActivityService teExamActivityService = SpringContextHolder.getBean(TEExamActivityService.class);
             for (TEExamActivity ac : teExamActivityList) {
-                this.updateExamActivityCacheBean(ac.getId());
+                teExamActivityService.updateExamActivityCacheBean(ac.getId());
             }
             if (Objects.nonNull(teExam.getForceFinish()) && teExam.getForceFinish().intValue() == 1) {
                 //新增quartz任务,发送mq消息start

+ 5 - 151
themis-business/src/main/java/com/qmth/themis/business/util/RedisUtil.java

@@ -24,93 +24,6 @@ public class RedisUtil {
     @Resource
     RedisTemplate<String, Object> redisTemplate;
 
-//    /**
-//     * 获取机构信息
-//     *
-//     * @param orgId
-//     * @return
-//     */
-//    public Object getOrg(Long orgId) {
-//        return redisTemplate.opsForValue().get(SystemConstant.ORG + orgId);
-//    }
-//
-//    /**
-//     * 设置机构信息
-//     *
-//     * @param orgId
-//     * @param o
-//     */
-//    public void setOrg(Long orgId, Object o) {
-//        redisTemplate.opsForValue().set(SystemConstant.ORG + orgId, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
-//    }
-
-//    /**
-//     * 获取机构信息
-//     *
-//     * @param orgCode
-//     * @return
-//     */
-//    public Object getOrgCode(String orgCode) {
-//        return redisTemplate.opsForValue().get(SystemConstant.ORG + orgCode);
-//    }
-//
-//    /**
-//     * 设置机构信息
-//     *
-//     * @param o
-//     */
-//    public void setRole(Object o) {
-//        redisTemplate.opsForList().leftPushAll(SystemConstant.ROLE, o);
-//        redisTemplate.expire(SystemConstant.ROLE, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
-//    }
-
-//    /**
-//     * 获取机构信息
-//     *
-//     * @return
-//     */
-//    public Object getRole() {
-//        return redisTemplate.opsForList().range(SystemConstant.ROLE, 0, -1);
-//    }
-
-//    /**
-//     * 设置机构信息
-//     *
-//     * @param orgCode
-//     * @param o
-//     */
-//    public void setOrgCode(String orgCode, Object o) {
-//        redisTemplate.opsForValue().set(SystemConstant.ORG + orgCode, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
-//    }
-//
-//    /**
-//     * 删除机构缓存
-//     *
-//     * @param orgId
-//     */
-//    public void deleteOrg(Long orgId) {
-//        redisTemplate.delete(SystemConstant.ORG + orgId);
-//    }
-//
-//    /**
-//     * 删除机构缓存
-//     *
-//     * @param orgCode
-//     */
-//    public void deleteOrgCode(String orgCode) {
-//        redisTemplate.delete(SystemConstant.ORG + orgCode);
-//    }
-
-//    /**
-//     * 获取用户信息
-//     *
-//     * @param userId
-//     * @return
-//     */
-//    public Object getUser(Long userId) {
-//        return redisTemplate.opsForValue().get(SystemConstant.USER + userId);
-//    }
-
     /**
      * 获取用户会话信息
      *
@@ -121,15 +34,6 @@ public class RedisUtil {
         return redisTemplate.opsForValue().get(SystemConstant.SESSION + sessionId);
     }
 
-//    /**
-//     * 删除用户缓存
-//     *
-//     * @param userId
-//     */
-//    public void deleteUser(Long userId) {
-//        redisTemplate.delete(SystemConstant.USER + userId);
-//    }
-//
     /**
      * 删除用户会话缓存
      *
@@ -138,57 +42,6 @@ public class RedisUtil {
     public void deleteUserSession(String sessionId) {
         redisTemplate.delete(SystemConstant.SESSION + sessionId);
     }
-//
-//    /**
-//     * 设置用户信息
-//     *
-//     * @param userId
-//     * @param o
-//     */
-//    public void setUser(Long userId, Object o) {
-//        redisTemplate.opsForValue().set(SystemConstant.USER + userId, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
-//    }
-
-//    /**
-//     * 设置学生信息
-//     *
-//     * @param studentId
-//     * @param o
-//     * @param time
-//     * @param timeUnit
-//     */
-//    public void setStudent(Long studentId, Object o, Long time, TimeUnit timeUnit) {
-//        redisTemplate.opsForValue().set(SystemConstant.STUDENT + studentId, o, time, timeUnit);
-//    }
-//
-//    /**
-//     * 设置学生信息
-//     *
-//     * @param studentId
-//     * @param o
-//     */
-//    public void setStudent(Long studentId, Object o) {
-//        redisTemplate.opsForValue().set(SystemConstant.STUDENT + studentId, o);
-//    }
-
-//    /**
-//     * 删除学生缓存
-//     *
-//     * @param studentId
-//     */
-//    public void deleteStudent(Long studentId) {
-//        redisTemplate.delete(SystemConstant.STUDENT + studentId);
-//    }
-//
-//    /**
-//     * 获取学生信息
-//     *
-//     * @param studentId
-//     * @return
-//     */
-//    public Object getStudent(Long studentId) {
-//        return redisTemplate.opsForValue().get(SystemConstant.STUDENT + studentId);
-//    }
 
     /**
      * 设置用户session信息
@@ -225,7 +78,6 @@ public class RedisUtil {
         }
     }
 
-
     /**
      * 设置hash
      *
@@ -372,12 +224,14 @@ public class RedisUtil {
     public void expire(String key, int timeOutSecond) {
         redisTemplate.expire(key, timeOutSecond, TimeUnit.SECONDS);
     }
-    
-    /**设置过期时间
+
+    /**
+     * 设置过期时间
+     *
      * @param key
      * @param timeOut
      */
-    public void expire(String key, long timeOut,TimeUnit timeUnit) {
+    public void expire(String key, long timeOut, TimeUnit timeUnit) {
         redisTemplate.expire(key, timeOut, timeUnit);
     }