deason 1 年之前
父節點
當前提交
e24d38048a
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      src/main/java/com/qmth/exam/reserve/service/impl/ExamReserveServiceImpl.java

+ 11 - 5
src/main/java/com/qmth/exam/reserve/service/impl/ExamReserveServiceImpl.java

@@ -141,7 +141,7 @@ public class ExamReserveServiceImpl implements ExamReserveService {
                         // 某考点某时段的“已预约数量” 累减1(释放1个被占数量)
                         applyTaskCacheService.decreaseApplyFinishCount(examSiteId, timePeriodId);
 
-                        log.warn("预约失败,当前时段已预约,请勿重复预约!examSiteId:{} timePeriodId:{}", examSiteId, timePeriodId);
+                        log.warn("当前时段已预约,请勿重复预约!examSiteId:{} timePeriodId:{}", examSiteId, timePeriodId);
                         throw new StatusException("当前时段已预约,请勿重复预约");
                     }
 
@@ -149,10 +149,12 @@ public class ExamReserveServiceImpl implements ExamReserveService {
                     existApply.setCancel(false);
                     existApply.setOperateId(student.getId());
                     existApply.setOperateTime(System.currentTimeMillis());
-                    applyTaskCacheService.saveStudentApplyRecord(existApply);
 
                     // 推送至预约队列
                     applyTaskCacheService.pushStudentApplyRecordQueue(existApply);
+
+                    // 保存至预约缓存
+                    applyTaskCacheService.saveStudentApplyRecord(existApply);
                 } else {
                     // 不存在则新增预约记录
                     ApplyRecordCacheBean newApply = new ApplyRecordCacheBean();
@@ -162,10 +164,12 @@ public class ExamReserveServiceImpl implements ExamReserveService {
                     newApply.setCancel(false);
                     newApply.setOperateId(student.getId());
                     newApply.setOperateTime(System.currentTimeMillis());
-                    applyTaskCacheService.saveStudentApplyRecord(newApply);
 
                     // 推送至预约队列
                     applyTaskCacheService.pushStudentApplyRecordQueue(newApply);
+
+                    // 保存至预约缓存
+                    applyTaskCacheService.saveStudentApplyRecord(newApply);
                 }
 
                 log.warn("预约成功!studentId:{} examSiteId:{} timePeriodId:{}", student.getId(), examSiteId, timePeriodId);
@@ -215,7 +219,7 @@ public class ExamReserveServiceImpl implements ExamReserveService {
         }
 
         if (existApply.getCancel()) {
-            log.warn("取消预约失败,当前时段已取消,忽略重复取消!examSiteId:{} timePeriodId:{}", examSiteId, timePeriodId);
+            log.warn("当前时段已取消,忽略重复取消!examSiteId:{} timePeriodId:{}", examSiteId, timePeriodId);
             return;
         }
 
@@ -253,11 +257,13 @@ public class ExamReserveServiceImpl implements ExamReserveService {
             existApply.setCancel(true);
             existApply.setOperateId(student.getId());
             existApply.setOperateTime(System.currentTimeMillis());
-            applyTaskCacheService.saveStudentApplyRecord(existApply);
 
             // 推送至预约队列
             applyTaskCacheService.pushStudentApplyRecordQueue(existApply);
 
+            // 保存至预约缓存
+            applyTaskCacheService.saveStudentApplyRecord(existApply);
+
             // 某考点某时段的“已预约数量” 累减1
             applyTaskCacheService.decreaseApplyFinishCount(examSiteId, timePeriodId);