|
@@ -15,6 +15,7 @@ import com.qmth.exam.reserve.cache.CacheConstants;
|
|
import com.qmth.exam.reserve.cache.impl.ApplyTaskCacheService;
|
|
import com.qmth.exam.reserve.cache.impl.ApplyTaskCacheService;
|
|
import com.qmth.exam.reserve.cache.impl.ExamSiteCacheService;
|
|
import com.qmth.exam.reserve.cache.impl.ExamSiteCacheService;
|
|
import com.qmth.exam.reserve.dao.StudentApplyDao;
|
|
import com.qmth.exam.reserve.dao.StudentApplyDao;
|
|
|
|
+import com.qmth.exam.reserve.dao.TimePeriodExamSiteDao;
|
|
import com.qmth.exam.reserve.entity.ApplyTaskEntity;
|
|
import com.qmth.exam.reserve.entity.ApplyTaskEntity;
|
|
import com.qmth.exam.reserve.entity.ExamSiteEntity;
|
|
import com.qmth.exam.reserve.entity.ExamSiteEntity;
|
|
import com.qmth.exam.reserve.entity.StudentApplyEntity;
|
|
import com.qmth.exam.reserve.entity.StudentApplyEntity;
|
|
@@ -56,6 +57,9 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
@Autowired
|
|
@Autowired
|
|
private TimePeriodService timePeriodService;
|
|
private TimePeriodService timePeriodService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TimePeriodExamSiteService timePeriodExamSiteService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private StudentApplyService studentApplyService;
|
|
private StudentApplyService studentApplyService;
|
|
|
|
|
|
@@ -499,10 +503,8 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
return dateList;
|
|
return dateList;
|
|
}
|
|
}
|
|
|
|
|
|
- LambdaQueryWrapper<TimePeriodEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
- wrapper.select(TimePeriodEntity::getStartTime);// 只查询startTime等字段
|
|
|
|
- wrapper.eq(TimePeriodEntity::getApplyTaskId, curApplyTask.getTaskId());
|
|
|
|
- List<TimePeriodEntity> timePeriods = timePeriodService.list(wrapper);
|
|
|
|
|
|
+ TimePeriodExamSiteDao baseMapper = (TimePeriodExamSiteDao) timePeriodExamSiteService.getBaseMapper();
|
|
|
|
+ List<ExamSiteTimePeriodInfo> timePeriods = baseMapper.allTimePeriods(curApplyTask.getTaskId(), examSiteId);
|
|
if (CollectionUtils.isEmpty(timePeriods)) {
|
|
if (CollectionUtils.isEmpty(timePeriods)) {
|
|
return dateList;
|
|
return dateList;
|
|
}
|
|
}
|
|
@@ -511,7 +513,12 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
Date allowDate = DateUtil.changeDateAndTimeEnd(new Date(), curApplyTask.getAllowApplyDays());
|
|
Date allowDate = DateUtil.changeDateAndTimeEnd(new Date(), curApplyTask.getAllowApplyDays());
|
|
Set<String> dates = new HashSet<>();
|
|
Set<String> dates = new HashSet<>();
|
|
FastDateFormat fdf = FastDateFormat.getInstance("yyyyMMdd");
|
|
FastDateFormat fdf = FastDateFormat.getInstance("yyyyMMdd");
|
|
- for (TimePeriodEntity timePeriod : timePeriods) {
|
|
|
|
|
|
+ for (ExamSiteTimePeriodInfo timePeriod : timePeriods) {
|
|
|
|
+ if (!timePeriod.getEnable()) {
|
|
|
|
+ // 跳过未启用的时段
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
Date curDate = new Date(timePeriod.getStartTime());
|
|
Date curDate = new Date(timePeriod.getStartTime());
|
|
if (curDate.before(allowDate)) {
|
|
if (curDate.before(allowDate)) {
|
|
// 跳过过期时段,“当前时段开始时间”在“允许预约时间”之前,则禁止预约
|
|
// 跳过过期时段,“当前时段开始时间”在“允许预约时间”之前,则禁止预约
|