|
@@ -12,6 +12,7 @@ import com.qmth.exam.reserve.service.StudentApplyService;
|
|
import com.qmth.exam.reserve.service.StudentService;
|
|
import com.qmth.exam.reserve.service.StudentService;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.redisson.api.RAtomicLong;
|
|
import org.redisson.api.RAtomicLong;
|
|
|
|
+import org.redisson.api.RBlockingQueue;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -186,8 +187,9 @@ public class ApplyTaskCacheService implements CacheConstants {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
for (StudentApplyEntity entity : list) {
|
|
for (StudentApplyEntity entity : list) {
|
|
ApplyRecordCacheBean bean = new ApplyRecordCacheBean();
|
|
ApplyRecordCacheBean bean = new ApplyRecordCacheBean();
|
|
- bean.setTimePeriodId(entity.getTimePeriodId());
|
|
|
|
|
|
+ bean.setStudentId(entity.getStudentId());
|
|
bean.setExamSiteId(entity.getExamSiteId());
|
|
bean.setExamSiteId(entity.getExamSiteId());
|
|
|
|
+ bean.setTimePeriodId(entity.getTimePeriodId());
|
|
bean.setCancel(entity.getCancel());
|
|
bean.setCancel(entity.getCancel());
|
|
bean.setOperateId(entity.getOperateId());
|
|
bean.setOperateId(entity.getOperateId());
|
|
bean.setOperateTime(entity.getUpdateTime());
|
|
bean.setOperateTime(entity.getUpdateTime());
|
|
@@ -220,4 +222,29 @@ public class ApplyTaskCacheService implements CacheConstants {
|
|
log.info("SET cacheKey:{} hashKey:{}", cacheKey, hashKey);
|
|
log.info("SET cacheKey:{} hashKey:{}", cacheKey, hashKey);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 推送至考生预约记录队列
|
|
|
|
+ */
|
|
|
|
+ public void pushStudentApplyRecordQueue(ApplyRecordCacheBean value) {
|
|
|
|
+ if (value == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ RBlockingQueue<ApplyRecordCacheBean> queue = redisClient.getRedissonClient()
|
|
|
|
+ .getBlockingQueue(QUEUE_STUDENT_APPLY_RECORD);
|
|
|
|
+ boolean success = queue.offer(value);
|
|
|
|
+ if (!success) {
|
|
|
|
+ throw new RuntimeException("推送至考生预约记录队列失败");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取考生预约记录队列数量
|
|
|
|
+ */
|
|
|
|
+ public int getStudentApplyRecordQueueSize() {
|
|
|
|
+ RBlockingQueue<ApplyRecordCacheBean> queue = redisClient.getRedissonClient()
|
|
|
|
+ .getBlockingQueue(QUEUE_STUDENT_APPLY_RECORD);
|
|
|
|
+ return queue.size();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|