|
@@ -1226,7 +1226,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
throw new BizException("获取用户信息失败");
|
|
|
}
|
|
|
if (Objects.isNull(vipGroupCourseAdjustInfo.getVipGroupId())) {
|
|
|
- throw new BizException("请指定小课");
|
|
|
+ throw new BizException("请指定课程");
|
|
|
}
|
|
|
if (Objects.isNull(vipGroupCourseAdjustInfo.getCourseCreateStartTime())) {
|
|
|
throw new BizException("请指定排课起始时间;");
|
|
@@ -1235,7 +1235,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
throw new BizException("请指定排课周期");
|
|
|
}
|
|
|
if (StringUtils.isBlank(vipGroupCourseAdjustInfo.getCourseScheduleIds())) {
|
|
|
- throw new BizException("请指定需要调整的小课课程");
|
|
|
+ throw new BizException("请指定需要调整的课程");
|
|
|
}
|
|
|
Date courseCreateStartTime = vipGroupCourseAdjustInfo.getCourseCreateStartTime();
|
|
|
Date now = new Date();
|
|
@@ -1250,17 +1250,31 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
throw new BizException("请设置教学点");
|
|
|
}
|
|
|
|
|
|
- VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
|
- if (Objects.isNull(vipGroup)) {
|
|
|
- throw new BizException("指定课程不存在");
|
|
|
+ int singleClassMinutes = 0;
|
|
|
+ int courseNum = 0;
|
|
|
+ GroupType groupType = vipGroupCourseAdjustInfo.getGroupType();
|
|
|
+ switch (vipGroupCourseAdjustInfo.getGroupType()){
|
|
|
+ case PRACTICE:
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
|
+ if (Objects.isNull(practiceGroup)) {
|
|
|
+ throw new BizException("指定课程不存在");
|
|
|
+ }
|
|
|
+ singleClassMinutes = practiceGroup.getSingleClassMinutes();
|
|
|
+ courseNum = courseScheduleDao.countVipGroupCourses(practiceGroup.getId().intValue(),groupType.getCode());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
|
+ if (Objects.isNull(vipGroup)) {
|
|
|
+ throw new BizException("指定课程不存在");
|
|
|
+ }
|
|
|
+ singleClassMinutes = vipGroup.getSingleClassMinutes();
|
|
|
+ courseNum = courseScheduleDao.countVipGroupCourses(vipGroup.getId().intValue(),groupType.getCode());
|
|
|
}
|
|
|
-
|
|
|
- int courseNum = courseScheduleDao.countVipGroupCourses(vipGroup.getId().intValue());
|
|
|
if (courseNum == 0) {
|
|
|
throw new BizException("未排课的课程不能进行调整");
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByGroupAndType(vipGroupCourseAdjustInfo.getVipGroupId().toString(), GroupType.VIP.getCode());
|
|
|
+ ClassGroup classGroup = classGroupDao.findByGroupAndType(vipGroupCourseAdjustInfo.getVipGroupId().toString(),groupType.getCode());
|
|
|
if (Objects.isNull(classGroup)) {
|
|
|
throw new BizException("对应班级不存在");
|
|
|
}
|
|
@@ -1330,7 +1344,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
String dateYmdStr = DateUtil.dateToString(calendar.getTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
|
|
|
dateYmdStr = dateYmdStr + " " + courseTime.getStartClassTime();
|
|
|
Date courseStartTime = DateUtil.stringToDate(dateYmdStr, "yyyy-MM-dd HH:mm");
|
|
|
- Date courseEndTime = DateUtil.addMinutes(courseStartTime, vipGroup.getSingleClassMinutes());
|
|
|
+ Date courseEndTime = DateUtil.addMinutes(courseStartTime, singleClassMinutes);
|
|
|
if(DateUtil.daysBetween(DateUtil.stringToDate(DateUtil.format(courseStartTime,DateUtil.DEFAULT_PATTERN),DateUtil.DEFAULT_PATTERN),
|
|
|
DateUtil.stringToDate(DateUtil.format(courseEndTime,DateUtil.DEFAULT_PATTERN),DateUtil.DEFAULT_PATTERN)) > 0){
|
|
|
throw new BizException("单节课时不允许跨天");
|