|
@@ -3482,16 +3482,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if(Objects.isNull(vipGroup)){
|
|
|
throw new BizException("未找到指定的vip课程");
|
|
|
}
|
|
|
-
|
|
|
- VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId());
|
|
|
-
|
|
|
- if(vipGroupCategory == null){
|
|
|
- throw new BizException("请修改VIP课课程形式");
|
|
|
- }
|
|
|
-
|
|
|
- if(vipGroupCategory.getStudentNum() < studentCoursePriceMap.size()){
|
|
|
- throw new BizException("学生人数超过{}人,请调整", vipGroupCategory.getStudentNum());
|
|
|
- }
|
|
|
|
|
|
ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
|
|
@@ -3513,14 +3503,24 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("当前课程组已经停止,无法进行添加学员操作。");
|
|
|
}
|
|
|
|
|
|
+ Integer exitStudentNum = classGroupStudentMapperDao.countClassGroupExitStudentNum(classGroup.getId(), studentIds);
|
|
|
+ if(exitStudentNum>0){
|
|
|
+ throw new BizException("选择的学生中存在此课程中已存在的学生");
|
|
|
+ }
|
|
|
+
|
|
|
Integer studentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
|
|
|
if(studentNum.compareTo(classGroup.getExpectStudentNum())>=0){
|
|
|
throw new BizException("该班级人数已达上限");
|
|
|
}
|
|
|
-
|
|
|
- Integer exitStudentNum = classGroupStudentMapperDao.countClassGroupExitStudentNum(classGroup.getId(), studentIds);
|
|
|
- if(exitStudentNum>0){
|
|
|
- throw new BizException("选择的学生中存在此课程中已存在的学生");
|
|
|
+
|
|
|
+ VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId());
|
|
|
+
|
|
|
+ if(vipGroupCategory == null){
|
|
|
+ throw new BizException("请修改VIP课课程形式");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(vipGroupCategory.getStudentNum() < (studentCoursePriceMap.size() + studentNum)){
|
|
|
+ throw new BizException("学生人数超过{}人,请调整", vipGroupCategory.getStudentNum());
|
|
|
}
|
|
|
|
|
|
VipGroupActivity vipGroupActivity = null;
|