|
@@ -151,6 +151,28 @@ public class ApplyTaskCacheService implements CacheConstants {
|
|
|
atomic.decrementAndGet();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取某考生的 已完成预约次数
|
|
|
+ */
|
|
|
+ public int getStudentApplyFinishCount(Long studentId) {
|
|
|
+ String cacheKey = String.format(CACHE_STUDENT_APPLY_RECORD, studentId);
|
|
|
+ if (!redisClient.exist(cacheKey)) {
|
|
|
+ LambdaQueryWrapper<StudentApplyEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(StudentApplyEntity::getStudentId, studentId);
|
|
|
+ wrapper.eq(StudentApplyEntity::getCancel, Boolean.FALSE);
|
|
|
+ return studentApplyService.count(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, ApplyRecordCacheBean> maps = this.getStudentApplyRecords(studentId);
|
|
|
+ int studentApplyFinishCount = 0;
|
|
|
+ for (ApplyRecordCacheBean bean : maps.values()) {
|
|
|
+ if (!bean.getCancel()) {
|
|
|
+ studentApplyFinishCount++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return studentApplyFinishCount;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取某考生的 所有的“预约记录”缓存
|
|
|
*/
|
|
@@ -167,10 +189,13 @@ public class ApplyTaskCacheService implements CacheConstants {
|
|
|
bean.setTimePeriodId(entity.getTimePeriodId());
|
|
|
bean.setExamSiteId(entity.getExamSiteId());
|
|
|
bean.setCancel(entity.getCancel());
|
|
|
+ bean.setOperateId(entity.getOperateId());
|
|
|
+ bean.setOperateTime(entity.getUpdateTime());
|
|
|
this.saveStudentApplyRecord(studentId, bean);
|
|
|
}
|
|
|
+
|
|
|
+ redisClient.expire(cacheKey, 30, TimeUnit.DAYS);
|
|
|
}
|
|
|
- redisClient.expire(cacheKey, 30, TimeUnit.DAYS);
|
|
|
}
|
|
|
|
|
|
return redisClient.getEntriesForHash(cacheKey, ApplyRecordCacheBean.class);
|