|
@@ -623,8 +623,8 @@ public class ThemisCacheServiceImpl implements ThemisCacheService {
|
|
//统计当天00:00:00~23:59:59可以进行的考试批次、场次、考场编码信息
|
|
//统计当天00:00:00~23:59:59可以进行的考试批次、场次、考场编码信息
|
|
if (!CollectionUtils.isEmpty(teExamActivityList)) {
|
|
if (!CollectionUtils.isEmpty(teExamActivityList)) {
|
|
LinkedMultiValueMap<Long, ExamListBean> todayExamListMap = new LinkedMultiValueMap<>();//考试批次、场次集合/考场编码集合
|
|
LinkedMultiValueMap<Long, ExamListBean> todayExamListMap = new LinkedMultiValueMap<>();//考试批次、场次集合/考场编码集合
|
|
- Map<Long, Set<Long>> examActivityIdMap = new LinkedHashMap<>();//考试批次id,场次id集合
|
|
|
|
- Map<Long, Set<String>> roomCodeMap = new LinkedHashMap<>();//考试场次id,考场编码集合
|
|
|
|
|
|
+ Map<Long, Set<Long>> examActivityIdMap = new HashMap<>();//考试批次id,场次id集合
|
|
|
|
+ Map<Long, Set<String>> roomCodeMap = new HashMap<>();//考试场次id,考场编码集合
|
|
for (TEExamActivity t : teExamActivityList) {
|
|
for (TEExamActivity t : teExamActivityList) {
|
|
ExamCacheBean examCacheBean = teExamService.getExamCacheBean(t.getExamId());
|
|
ExamCacheBean examCacheBean = teExamService.getExamCacheBean(t.getExamId());
|
|
if (Objects.nonNull(examCacheBean.getEnable()) && examCacheBean.getEnable().intValue() == 1 && Objects.nonNull(t.getEnable()) && t.getEnable().intValue() == 1) {
|
|
if (Objects.nonNull(examCacheBean.getEnable()) && examCacheBean.getEnable().intValue() == 1 && Objects.nonNull(t.getEnable()) && t.getEnable().intValue() == 1) {
|
|
@@ -657,6 +657,16 @@ public class ThemisCacheServiceImpl implements ThemisCacheService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取当天考试列表缓存
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, List<ExamListBean>> getTodayExamListCache() {
|
|
|
|
+ return redisUtil.getHashEntries(SystemConstant.TODAY_EXAM_LIST_MAP_CACHE);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 设置考试列表缓存
|
|
* 设置考试列表缓存
|
|
*/
|
|
*/
|
|
@@ -665,8 +675,8 @@ public class ThemisCacheServiceImpl implements ThemisCacheService {
|
|
//查询考试场次结束时间大于当前时间的所有考试
|
|
//查询考试场次结束时间大于当前时间的所有考试
|
|
List<TEExamActivity> teExamActivityList = teExamActivityService.list(new QueryWrapper<TEExamActivity>().lambda().gt(TEExamActivity::getFinishTime, System.currentTimeMillis()).eq(TEExamActivity::getEnable, 1));
|
|
List<TEExamActivity> teExamActivityList = teExamActivityService.list(new QueryWrapper<TEExamActivity>().lambda().gt(TEExamActivity::getFinishTime, System.currentTimeMillis()).eq(TEExamActivity::getEnable, 1));
|
|
if (!CollectionUtils.isEmpty(teExamActivityList)) {
|
|
if (!CollectionUtils.isEmpty(teExamActivityList)) {
|
|
- Map<Long, Set<Long>> orgMap = new LinkedHashMap<>();//机构id,考试批次id集合
|
|
|
|
- Map<Long, Set<Long>> examMap = new LinkedHashMap<>();//考试批次id,场次id集合
|
|
|
|
|
|
+ Map<Long, Set<Long>> orgMap = new HashMap<>();//机构id,考试批次id集合
|
|
|
|
+ Map<Long, Set<Long>> examMap = new HashMap<>();//考试批次id,场次id集合
|
|
for (TEExamActivity t : teExamActivityList) {
|
|
for (TEExamActivity t : teExamActivityList) {
|
|
ExamCacheBean examCacheBean = teExamService.getExamCacheBean(t.getExamId());
|
|
ExamCacheBean examCacheBean = teExamService.getExamCacheBean(t.getExamId());
|
|
if (Objects.nonNull(examCacheBean.getEnable()) && examCacheBean.getEnable().intValue() == 1) {
|
|
if (Objects.nonNull(examCacheBean.getEnable()) && examCacheBean.getEnable().intValue() == 1) {
|
|
@@ -714,7 +724,7 @@ public class ThemisCacheServiceImpl implements ThemisCacheService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Set<Long> getOrgExamListCache(String orgId, String examId) {
|
|
public Set<Long> getOrgExamListCache(String orgId, String examId) {
|
|
- Map<String, Set<Long>> map = redisUtil.getHashEntries(SystemConstant.ORG_EXAM_LIST_MAP_CACHE + orgId);
|
|
|
|
|
|
+ Map<String, Set<Long>> map = this.getOrgExamListCache(orgId);
|
|
return !CollectionUtils.isEmpty(map) ? map.get(examId) : null;
|
|
return !CollectionUtils.isEmpty(map) ? map.get(examId) : null;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -725,7 +735,7 @@ public class ThemisCacheServiceImpl implements ThemisCacheService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void updateOrgExamListCache(String orgId, String examId, Long examActivityId) {
|
|
public void updateOrgExamListCache(String orgId, String examId, Long examActivityId) {
|
|
- Map<String, Set<Long>> map = redisUtil.getHashEntries(SystemConstant.ORG_EXAM_LIST_MAP_CACHE + orgId);
|
|
|
|
|
|
+ Map<String, Set<Long>> map = this.getOrgExamListCache(orgId);
|
|
if (CollectionUtils.isEmpty(map)) {
|
|
if (CollectionUtils.isEmpty(map)) {
|
|
redisUtil.set(SystemConstant.ORG_EXAM_LIST_MAP_CACHE + orgId, examId, new HashSet<>(Arrays.asList(examActivityId)));
|
|
redisUtil.set(SystemConstant.ORG_EXAM_LIST_MAP_CACHE + orgId, examId, new HashSet<>(Arrays.asList(examActivityId)));
|
|
} else {
|
|
} else {
|
|
@@ -768,7 +778,7 @@ public class ThemisCacheServiceImpl implements ThemisCacheService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void removeOrgExamListCache(String orgId, String examId, Long examActivityId) {
|
|
public void removeOrgExamListCache(String orgId, String examId, Long examActivityId) {
|
|
- Map<String, Set<Long>> map = redisUtil.getHashEntries(SystemConstant.ORG_EXAM_LIST_MAP_CACHE + orgId);
|
|
|
|
|
|
+ Map<String, Set<Long>> map = this.getOrgExamListCache(orgId);
|
|
CopyOnWriteArraySet<Long> examActivityIdSet = new CopyOnWriteArraySet<>();
|
|
CopyOnWriteArraySet<Long> examActivityIdSet = new CopyOnWriteArraySet<>();
|
|
examActivityIdSet.addAll(map.get(examId));
|
|
examActivityIdSet.addAll(map.get(examId));
|
|
for (Long l : examActivityIdSet) {
|
|
for (Long l : examActivityIdSet) {
|
|
@@ -793,7 +803,7 @@ public class ThemisCacheServiceImpl implements ThemisCacheService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<ExamListBean> getTodayExamListCache(String examId) {
|
|
public List<ExamListBean> getTodayExamListCache(String examId) {
|
|
- Map<String, List<ExamListBean>> map = redisUtil.getHashEntries(SystemConstant.TODAY_EXAM_LIST_MAP_CACHE);
|
|
|
|
|
|
+ Map<String, List<ExamListBean>> map = this.getTodayExamListCache();
|
|
return !CollectionUtils.isEmpty(map) ? map.get(examId) : null;
|
|
return !CollectionUtils.isEmpty(map) ? map.get(examId) : null;
|
|
}
|
|
}
|
|
|
|
|