|
@@ -4078,16 +4078,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("选择的学生中存在此课程中已存在的学生");
|
|
|
}
|
|
|
|
|
|
- Integer studentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
|
|
|
- if(studentNum.compareTo(classGroup.getExpectStudentNum()) >= 0){
|
|
|
- throw new BizException("该班级人数已达上限");
|
|
|
- }
|
|
|
-
|
|
|
VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId());
|
|
|
-
|
|
|
+
|
|
|
if(vipGroupCategory == null){
|
|
|
throw new BizException("请修改VIP课课程形式");
|
|
|
}
|
|
|
+ Integer studentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
|
|
|
+ if(studentNum.compareTo(vipGroupCategory.getStudentNum()) >= 0){
|
|
|
+ throw new BizException("该班级人数已达上限");
|
|
|
+ }
|
|
|
|
|
|
if(vipGroupCategory.getStudentNum() < (studentCoursePriceMap.size() + studentNum)){
|
|
|
throw new BizException("学生人数超过{}人,请调整", vipGroupCategory.getStudentNum());
|