|
@@ -154,7 +154,6 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
}
|
|
}
|
|
|
|
|
|
try {
|
|
try {
|
|
- // StudentApplyEntity existApply = applyTaskCacheService.getStudentApplyRecordFormDB(student.getId(), examSiteId, timePeriodId);
|
|
|
|
ApplyRecordCacheBean existApply = applyTaskCacheService.getStudentApplyRecord(student.getId(), examSiteId, timePeriodId);
|
|
ApplyRecordCacheBean existApply = applyTaskCacheService.getStudentApplyRecord(student.getId(), examSiteId, timePeriodId);
|
|
if (existApply != null) {
|
|
if (existApply != null) {
|
|
if (!existApply.getCancel()) {
|
|
if (!existApply.getCancel()) {
|
|
@@ -169,12 +168,14 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
existApply.setCancel(false);
|
|
existApply.setCancel(false);
|
|
existApply.setOperateId(student.getId());
|
|
existApply.setOperateId(student.getId());
|
|
existApply.setOperateTime(System.currentTimeMillis());
|
|
existApply.setOperateTime(System.currentTimeMillis());
|
|
|
|
+
|
|
// 推送至预约队列
|
|
// 推送至预约队列
|
|
- applyTaskCacheService.pushStudentApplyRecordQueue(existApply);
|
|
|
|
|
|
+ boolean pushSuccess = applyTaskCacheService.pushStudentApplyRecordQueue(existApply);
|
|
|
|
+ if (!pushSuccess) {
|
|
|
|
+ throw new RuntimeException("预约消息推送失败,请稍后再试!");
|
|
|
|
+ }
|
|
// 保存至预约缓存
|
|
// 保存至预约缓存
|
|
applyTaskCacheService.saveStudentApplyRecord(existApply);
|
|
applyTaskCacheService.saveStudentApplyRecord(existApply);
|
|
-
|
|
|
|
- // this.updateStudentApplyForCancel(existApply.getId(), false, student.getId());
|
|
|
|
} else {
|
|
} else {
|
|
// 不存在则新增预约记录
|
|
// 不存在则新增预约记录
|
|
ApplyRecordCacheBean newApply = new ApplyRecordCacheBean();
|
|
ApplyRecordCacheBean newApply = new ApplyRecordCacheBean();
|
|
@@ -184,12 +185,14 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
newApply.setCancel(false);
|
|
newApply.setCancel(false);
|
|
newApply.setOperateId(student.getId());
|
|
newApply.setOperateId(student.getId());
|
|
newApply.setOperateTime(System.currentTimeMillis());
|
|
newApply.setOperateTime(System.currentTimeMillis());
|
|
|
|
+
|
|
// 推送至预约队列
|
|
// 推送至预约队列
|
|
- applyTaskCacheService.pushStudentApplyRecordQueue(newApply);
|
|
|
|
|
|
+ boolean pushSuccess = applyTaskCacheService.pushStudentApplyRecordQueue(newApply);
|
|
|
|
+ if (!pushSuccess) {
|
|
|
|
+ throw new RuntimeException("预约消息推送失败,请稍后再试!");
|
|
|
|
+ }
|
|
// 保存至预约缓存
|
|
// 保存至预约缓存
|
|
applyTaskCacheService.saveStudentApplyRecord(newApply);
|
|
applyTaskCacheService.saveStudentApplyRecord(newApply);
|
|
-
|
|
|
|
- // this.addStudentApply(newApply);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
log.warn("预约成功!studentId:{} examSiteId:{} timePeriodId:{}", student.getId(), examSiteId, timePeriodId);
|
|
log.warn("预约成功!studentId:{} examSiteId:{} timePeriodId:{}", student.getId(), examSiteId, timePeriodId);
|
|
@@ -282,15 +285,17 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
existApply.setCancel(true);
|
|
existApply.setCancel(true);
|
|
existApply.setOperateId(student.getId());
|
|
existApply.setOperateId(student.getId());
|
|
existApply.setOperateTime(System.currentTimeMillis());
|
|
existApply.setOperateTime(System.currentTimeMillis());
|
|
|
|
+
|
|
// 推送至预约队列
|
|
// 推送至预约队列
|
|
- applyTaskCacheService.pushStudentApplyRecordQueue(existApply);
|
|
|
|
|
|
+ boolean pushSuccess = applyTaskCacheService.pushStudentApplyRecordQueue(existApply);
|
|
|
|
+ if (!pushSuccess) {
|
|
|
|
+ throw new RuntimeException("预约消息推送失败,请稍后再试!");
|
|
|
|
+ }
|
|
// 保存至预约缓存
|
|
// 保存至预约缓存
|
|
applyTaskCacheService.saveStudentApplyRecord(existApply);
|
|
applyTaskCacheService.saveStudentApplyRecord(existApply);
|
|
-
|
|
|
|
- // this.updateStudentApplyForCancel(existApply.getId(), true, student.getId());
|
|
|
|
-
|
|
|
|
// 某考点某时段的“剩余可约数量” 累加1(归还1个被占数量)
|
|
// 某考点某时段的“剩余可约数量” 累加1(归还1个被占数量)
|
|
applyTaskCacheService.increaseApplyAvailableCount(examSiteId, timePeriodId);
|
|
applyTaskCacheService.increaseApplyAvailableCount(examSiteId, timePeriodId);
|
|
|
|
+
|
|
log.warn("取消预约成功!studentId:{} examSiteId:{} timePeriodId:{}", student.getId(), examSiteId, timePeriodId);
|
|
log.warn("取消预约成功!studentId:{} examSiteId:{} timePeriodId:{}", student.getId(), examSiteId, timePeriodId);
|
|
} finally {
|
|
} finally {
|
|
try {
|
|
try {
|