소스 검색

update logs

deason 1 년 전
부모
커밋
fe80b5af4f

+ 4 - 0
src/main/java/com/qmth/exam/reserve/service/impl/ExamReserveServiceImpl.java

@@ -107,6 +107,8 @@ public class ExamReserveServiceImpl implements ExamReserveService {
                 throw new StatusException(Constants.SYSTEM_BUSY);
             }
 
+            log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
+
             if (concurrentService.isLocked(CacheConstants.LOCK_AUTO_APPLY)) {
                 // 系统自动预约“任务执行期间”不允许预约
                 log.warn("系统自动预约中,不允许考生操作预约!lockKey:{}", CacheConstants.LOCK_AUTO_APPLY);
@@ -248,6 +250,8 @@ public class ExamReserveServiceImpl implements ExamReserveService {
                 throw new StatusException(Constants.SYSTEM_BUSY);
             }
 
+            log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
+
             if (concurrentService.isLocked(CacheConstants.LOCK_AUTO_APPLY)) {
                 // 系统自动预约“任务执行期间”不允许取消预约
                 log.warn("系统自动预约中,不允许考生操作预约!lockKey:{}", CacheConstants.LOCK_AUTO_APPLY);

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

@@ -156,6 +156,9 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
                 log.warn("获取锁失败,同一个考生不允许同时操作预约!lockKey:{}", studentApplyLockKey);
                 throw new StatusException(Constants.SYSTEM_BUSY);
             }
+
+            log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
+
             if (studentApplyLock.tryLock()) {
                 studentApply.setCancel(Boolean.TRUE);
                 this.baseMapper.updateById(studentApply);
@@ -477,6 +480,8 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
             if (!studentApplyLock.tryLock()) {
                 log.warn("获取锁失败,考生在同时操作预约!lockKey:{}", studentApplyLockKey);
             } else {
+                log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
+
                 for (AgentAndTimeVO agentTime : agentTimeList) {
                     // 已经预约的容量和考点的容量从redis中获取
                     int haveApplyCount = cacheService.getApplyFinishCount(agentTime.getAgentId(),
@@ -675,6 +680,8 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
                     log.warn("获取锁失败,考生在同时操作预约!lockKey:{}", studentApplyLockKey);
                     iterator.remove();
                 } else {
+                    log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
+
                     List<StudentApplyEntity> studentApplyList = listStudentApply(student.getId(), Boolean.FALSE);
                     int toApplyNum = student.getApplyNumber() - studentApplyList.size();
                     if (toApplyNum > 0 && !haveApplySameTimePeriod(siteId, timeId, student.getId())) {