|
@@ -946,6 +946,20 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
if (multiply.compareTo(scheduleDto.getCoursePrice()) != 0) {
|
|
if (multiply.compareTo(scheduleDto.getCoursePrice()) != 0) {
|
|
throw new BizException("价格异常。预计价格:{},实际价格:{}", multiply, scheduleDto.getCoursePrice());
|
|
throw new BizException("价格异常。预计价格:{},实际价格:{}", multiply, scheduleDto.getCoursePrice());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //获取老师锁课缓存
|
|
|
|
+ RMap<Long, List<CourseTimeEntity>> map = courseGroupService.getExpireLiveLockTimeCache(scheduleDto.getTeacherId());
|
|
|
|
+ if (map.isExists()) {
|
|
|
|
+ List<CourseTimeEntity> courseTimeCache = map.get(scheduleDto.getTeacherId());
|
|
|
|
+ //校验缓存中的时间和当前自动生成的时间有没有重复
|
|
|
|
+ dateList.forEach(item ->
|
|
|
|
+ {
|
|
|
|
+ if (!checkCourseTime(courseTimeCache, CourseTimeEntity::getStartTime, CourseTimeEntity::getEndTime, item.getStartTime(), item.getEndTime())) {
|
|
|
|
+ throw new BizException("与缓存中时间存在中途");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
//批量检查老师课时在数据库是否重复
|
|
//批量检查老师课时在数据库是否重复
|
|
batchCheckTeacherCourseTime(scheduleDto.getTeacherId(), dateList, CourseScheduleDate::getStartTime, CourseScheduleDate::getEndTime);
|
|
batchCheckTeacherCourseTime(scheduleDto.getTeacherId(), dateList, CourseScheduleDate::getStartTime, CourseScheduleDate::getEndTime);
|
|
//批量检查学生课时在数据库是否重复
|
|
//批量检查学生课时在数据库是否重复
|