zouxuan 3 rokov pred
rodič
commit
c4b4498da6

+ 5 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -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());

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -306,7 +306,7 @@
 		FROM (SELECT activity_id_,MAX(vip_flag_) vip_flag_,MAX(practice_flag_) practice_flag_,
 					 MAX(give_vip_flag_) give_vip_flag_,MAX(give_practice_flag_) give_practice_flag_,user_id_,teacher_id_
 			  FROM activity_user_mapper
-			  WHERE aum.return_fee_ = 0 AND activity_id_ = #{activityId}
+			  WHERE return_fee_ = 0 AND activity_id_ = #{activityId}
 			<if test="userId != null">
 				AND teacher_id_ = #{userId}
 			</if>