haogh 7 months ago
parent
commit
15ea34bc10

+ 8 - 0
src/main/java/com/qmth/exam/reserve/service/impl/StudentApplyServiceImpl.java

@@ -756,6 +756,9 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
 
     private void checkOpenTime(Long orgId) {
         CurrentApplyTaskVO task = cacheService.currentApplyTask(orgId);
+        if(task == null) {
+            throw new StatusException("未有开启的任务");
+        }
         Date startTime = new Date(task.getSelfApplyStartTime());
         Date endTime = new Date(task.getOpenApplyEndTime());
         Date now = new Date();
@@ -834,6 +837,11 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
     public void autoLayout(Long teachingId) {
         OrgInfo org = orgCacheService.currentOrg();
         CurrentApplyTaskVO applyTask = cacheService.currentApplyTask(org.getOrgId());
+        if(applyTask == null) {
+            log.warn("[autoLayout] 未有开启的任务");
+            return;
+        }
+
         String autoLayoutLockKey = String.format(CacheConstants.LOCK_ARRANGE_EXAM, DateUtil.formatShortDateString(new Date()));
         RLock autoLayoutLock = (RLock) concurrentService.getLock(autoLayoutLockKey);