ソースを参照

feat:进行中加学员限制线上基础技能班班级人数

Joburgess 4 年 前
コミット
6385e3eafa

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1221,6 +1221,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         BigDecimal originUnitPrice = new BigDecimal(0);
         CourseScheduleType courseType = null;
         for (ClassGroup classGroup : classGroupList) {
+            if(HIGH_ONLINE.equals(classGroup.getType())){
+                Integer studentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
+                if(Objects.nonNull(studentNum)&&studentNum>=6){
+                    throw new BizException("线上基础技能班班级最大人数为6人");
+                }
+            }
+
             // 1、增加班级人数
             classGroupDao.addStudentNum(classGroup);