|
@@ -318,6 +318,9 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
|
Date now=new Date();
|
|
|
|
|
|
ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(courseGroupId.toString(), GroupType.COMM.getCode());
|
|
|
+ if(classGroup.getStudentNum()>=classGroup.getExpectStudentNum()){
|
|
|
+ throw new BizException("此课程组人数已达上限");
|
|
|
+ }
|
|
|
|
|
|
BigDecimal amount = coursesGroup.getTotalCoursesPrice();
|
|
|
if(Objects.isNull(amount)){
|
|
@@ -516,7 +519,11 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
|
classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
|
|
|
List<ClassGroupStudentMapper> classGroupStudents = classGroupStudentMapperDao.findByClassGroup(classGroup.getId());
|
|
|
- if(!CollectionUtils.isEmpty(classGroupStudents)&&classGroupStudents.size()==classGroup.getExpectStudentNum()){
|
|
|
+ if(!CollectionUtils.isEmpty(classGroupStudents)){
|
|
|
+ classGroup.setStudentNum(classGroupStudents.size());
|
|
|
+ classGroupDao.update(classGroup);
|
|
|
+ }
|
|
|
+ if(!CollectionUtils.isEmpty(classGroupStudents)&&classGroupStudents.size()>=classGroup.getExpectStudentNum()){
|
|
|
coursesGroup.setStatus(GroupStatusEnum.NORMAL);
|
|
|
coursesGroupDao.update(coursesGroup);
|
|
|
}
|