|
@@ -286,17 +286,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
//获取最后一节课
|
|
//获取最后一节课
|
|
CourseSchedule latestCourseSchedule = vipGroup.getCourseSchedules().stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
|
|
CourseSchedule latestCourseSchedule = vipGroup.getCourseSchedules().stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
|
|
|
|
|
|
- if (firstCourseSchedule.getStartClassTime().before(new Date())) {
|
|
|
|
- throw new BizException("开课时间不能小于当前时间");
|
|
|
|
- }
|
|
|
|
|
|
+ if (!vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS)) {
|
|
|
|
+ if (firstCourseSchedule.getStartClassTime().before(new Date())) {
|
|
|
|
+ throw new BizException("开课时间不能小于当前时间");
|
|
|
|
+ }
|
|
|
|
|
|
- if (vipGroupApplyBaseInfoDto.getRegistrationStartTime().after(vipGroupApplyBaseInfoDto.getPaymentExpireDate())) {
|
|
|
|
- throw new BizException("报名开始时间必须在报名截至时间之前");
|
|
|
|
- }
|
|
|
|
|
|
+ if (vipGroupApplyBaseInfoDto.getRegistrationStartTime().after(vipGroupApplyBaseInfoDto.getPaymentExpireDate())) {
|
|
|
|
+ throw new BizException("报名开始时间必须在报名截至时间之前");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (vipGroupApplyBaseInfoDto.getPaymentExpireDate().after(firstCourseSchedule.getStartClassTime())
|
|
|
|
+ || DateUtil.isSameDay(vipGroupApplyBaseInfoDto.getPaymentExpireDate(), firstCourseSchedule.getEndClassTime())) {
|
|
|
|
+ throw new BizException("创建失败,报名截止时间必须在开课时间前一天");
|
|
|
|
+ }
|
|
|
|
|
|
- if (vipGroupApplyBaseInfoDto.getPaymentExpireDate().after(firstCourseSchedule.getStartClassTime())
|
|
|
|
- || DateUtil.isSameDay(vipGroupApplyBaseInfoDto.getPaymentExpireDate(), firstCourseSchedule.getEndClassTime())) {
|
|
|
|
- throw new BizException("创建失败,报名截止时间必须在开课时间前一天");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
VipGroupCategory vipGroupCategory = vipGroupCategoryService.get(vipGroupApplyBaseInfoDto.getVipGroupCategoryId());
|
|
VipGroupCategory vipGroupCategory = vipGroupCategoryService.get(vipGroupApplyBaseInfoDto.getVipGroupCategoryId());
|
|
@@ -361,7 +364,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
} else {
|
|
} else {
|
|
classGroup.setExpectStudentNum(vipGroupCategory.getStudentNum());
|
|
classGroup.setExpectStudentNum(vipGroupCategory.getStudentNum());
|
|
}
|
|
}
|
|
- classGroup.setStudentNum(0);
|
|
|
|
classGroup.setName(vipGroupApplyBaseInfoDto.getName());
|
|
classGroup.setName(vipGroupApplyBaseInfoDto.getName());
|
|
classGroup.setTotalClassTimes(totalClassTimes);
|
|
classGroup.setTotalClassTimes(totalClassTimes);
|
|
classGroup.setType(ClassGroupTypeEnum.valueOf(groupType));
|
|
classGroup.setType(ClassGroupTypeEnum.valueOf(groupType));
|
|
@@ -461,7 +463,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- courseScheduleService.checkNewCourseSchedules(courseSchedules, false, false);
|
|
|
|
|
|
+ if (!vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS)) {
|
|
|
|
+ courseScheduleService.checkNewCourseSchedules(courseSchedules, false, false);
|
|
|
|
+ }
|
|
vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(courseSchedules));
|
|
vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(courseSchedules));
|
|
vipGroupDao.update(vipGroupApplyBaseInfoDto);
|
|
vipGroupDao.update(vipGroupApplyBaseInfoDto);
|
|
return BaseController.succeed(vipGroupApplyBaseInfoDto.getAuditStatus().getCode());
|
|
return BaseController.succeed(vipGroupApplyBaseInfoDto.getAuditStatus().getCode());
|