wangliang 1 anno fa
parent
commit
fb71c7ea00

+ 7 - 9
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -418,18 +418,16 @@ public class TEExamController {
                     s.setUpdateId(null);
                     s.setUpdateTime(null);
                     s.setCode(String.valueOf(redisUtil.getRedisActivityCodeSequence(teExam.getId())));
-                });
-                teExamActivityService.saveOrUpdateBatch(teExamActivityList);
 
-                for (TEExamActivity t : teExamActivityList) {
-                    if (Objects.nonNull(t) && Objects.nonNull(t.getEnable()) && t.getEnable().intValue() == 1 && Objects.nonNull(teExam.getEnable()) && teExam.getEnable().intValue() == 1 && (Objects.nonNull(teExam.getEndTime()) && teExam.getEndTime().longValue() > System.currentTimeMillis())) {
-                        themisCacheService.updateCurrentExamListCache(t.getExamId().toString(), t.getId());
-                        themisCacheService.updateOrgExamListCache(teExam.getOrgId().toString(), t.getExamId().toString(), t.getId());
+                    if (Objects.nonNull(s) && Objects.nonNull(s.getEnable()) && s.getEnable().intValue() == 1 && Objects.nonNull(teExam.getEnable()) && teExam.getEnable().intValue() == 1 && (Objects.nonNull(teExam.getEndTime()) && teExam.getEndTime().longValue() > System.currentTimeMillis())) {
+                        themisCacheService.updateCurrentExamListCache(s.getExamId().toString(), s.getId());
+                        themisCacheService.updateOrgExamListCache(teExam.getOrgId().toString(), s.getExamId().toString(), s.getId());
                     } else {
-                        themisCacheService.removeCurrentExamListCache(t.getExamId().toString(), t.getId());
-                        themisCacheService.removeOrgExamListCache(teExam.getOrgId().toString(), t.getExamId().toString(), t.getId());
+                        themisCacheService.removeCurrentExamListCache(s.getExamId().toString(), s.getId());
+                        themisCacheService.removeOrgExamListCache(teExam.getOrgId().toString(), s.getExamId().toString(), s.getId());
                     }
-                }
+                });
+                teExamActivityService.saveOrUpdateBatch(teExamActivityList);
 
                 if (Objects.nonNull(teExam.getForceFinish()) && teExam.getForceFinish().intValue() == 1) {
                     //新增quartz任务,发送mq消息start