Explorar el Código

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan hace 5 años
padre
commit
434f5d7122

+ 2 - 22
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -700,6 +700,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         studentRegistrationDao.deleteClassGroup(classGroupId);
         //删除班级跟合奏班关系
         classGroupRelationDao.deleteBySubClassId(classGroupId);
+        //删除班级未开始课程
+
         //删除班级
         classGroupDao.delete(classGroupId);
         //删除im群组
@@ -1328,22 +1330,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         classGroupRelation.setCreateTime(date);
         classGroupRelationService.insert(classGroupRelation);
 
-        //6、添加学生未上合奏课课程
-        List<CourseSchedule> noStartCourses = courseScheduleDao.findNoStartCoursesByClassGroupId(classGroup4MixDto.getClassGroupId());
-        for (CourseSchedule noStartCourse : noStartCourses) {
-            for (StudentRegistration studentRegistration : studentList) {
-                CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
-                courseScheduleStudentPayment.setGroupType(classGroup.getGroupType());
-                courseScheduleStudentPayment.setMusicGroupId(classGroup.getMusicGroupId());
-                courseScheduleStudentPayment.setCourseScheduleId(noStartCourse.getId());
-                courseScheduleStudentPayment.setUserId(studentRegistration.getUserId());
-                courseScheduleStudentPayment.setExpectPrice(expectPrice);
-                courseScheduleStudentPayment.setCreateTime(date);
-                courseScheduleStudentPayment.setUpdateTime(date);
-                courseScheduleStudentPayment.setClassGroupId(noStartCourse.getClassGroupId());
-                courseScheduleStudentPaymentList.add(courseScheduleStudentPayment);
-            }
-        }
         //学生结算表
         courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPaymentList);
         return classGroup;
@@ -1529,12 +1515,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
             now = now.plusDays(1);
         }
-        //加入合奏班
-        ClassGroupRelation classGroupRelation = new ClassGroupRelation();
-        classGroupRelation.setClassGroupId(classGroup4MixDto.getMixClassGroupId());
-        classGroupRelation.setSubClassGroupId(classGroup.getId());
-        classGroupRelation.setCreateTime(date);
-        classGroupRelationService.insert(classGroupRelation);
 
         //老师结算表
         courseScheduleTeacherSalaryService.batchInsert(courseScheduleTeacherSalaryList);

+ 7 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -1005,13 +1005,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
 		musicGroupQuitDao.insert(musicGroupQuit);
 
-		classGroupStudentMapperDao.deleteStudentByMusicGroupId(musicGroupId, userId);
-
 		// 判断乐器是否是租赁
 		StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
 		if (studentRegistration == null) {
 			throw new BizException("用户注册信息不存在");
 		}
+		//更新学员在班级的状态
+		classGroupStudentMapperDao.deleteStudentByMusicGroupId(musicGroupId, userId);
+		
+		//更新班级人数
+		List<Integer> classGroupIdList = classGroupStudentMapperDao.queryClassGroupIdList(musicGroupId, userId, GroupType.MUSIC);
+		classGroupDao.batchUpdateStudentNumMinusOne(classGroupIdList);
+		
 		// 删除未上课
 		courseScheduleService.batchDeleteMusicGroupCourseWithStudent(musicGroupId, userId, GroupType.MUSIC);
 		

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -608,7 +608,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 waitPayOrder.setStatus(DealStatusEnum.CLOSE);
                 studentPaymentOrderService.update(waitPayOrder);
                 //添加学生
-                classGroupStudentMapperService.addStudents(waitPayOrder.getClassGroupId(), studentRegistration.getUserId().toString(), GroupType.MUSIC);
+                //classGroupStudentMapperService.addStudents(waitPayOrder.getClassGroupId(), studentRegistration.getUserId().toString(), GroupType.MUSIC);
             } else {
                 //获取当前月
                 Integer month = Integer.parseInt(DateUtil.getMonth(nowDate));