|
@@ -2097,10 +2097,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
List<ClassGroupTeacherMapper> classGroupTeacherMapperList = classGroup4MixDto.getClassGroupTeacherMapperList();
|
|
|
|
|
|
MusicGroupStudentClassAdjust classAdjust = musicGroupStudentClassAdjustDao.get(classGroup4MixDto.getMusicGroupStudentClassAdjustId());
|
|
|
- //获取默认的排课时长
|
|
|
-// String courseDefaultMinutes = sysConfigDao.findConfigValue("music_course_default_minutes");
|
|
|
- JSONObject jsonObject = JSON.parseObject(classAdjust.getDefaultCourseTypeMinute());
|
|
|
- long classCourseDuration = Integer.parseInt(jsonObject.get(classGroup4MixDto.getCourseType().getCode()).toString());
|
|
|
ClassGroup classGroup = classGroup4MixDto.getClassGroup();
|
|
|
if (classGroup == null) {
|
|
|
//建班
|
|
@@ -2136,6 +2132,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
}
|
|
|
//3、将老师加入关联关系
|
|
|
classGroupTeacherMapperDao.classGroupTeachersInsert(classGroupTeacherMapperList);
|
|
|
+ Set<Integer> collect = classGroupTeacherMapperList.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
+ for (Integer integer : collect) {
|
|
|
+ //班级老师通讯录
|
|
|
+ imUserFriendService.classGroupChangeTeacher(classGroup.getId(),integer);
|
|
|
+ }
|
|
|
//创建IM群组
|
|
|
addImGroup(classGroup, userIds);
|
|
|
}
|
|
@@ -2148,15 +2149,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
//冲突校验
|
|
|
courseScheduleList = autoAdjust(classGroup4MixDto, courseScheduleList, classAdjust);
|
|
|
|
|
|
- List<Integer> allTeacherIds = classGroupTeacherMapperList.stream()
|
|
|
- .map(ClassGroupTeacherMapper::getUserId)
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- //所有教师列表
|
|
|
- List<Teacher> teachers = teacherDao.findByTeacherIds(allTeacherIds);
|
|
|
- Map<Integer, Teacher> teacherMap = teachers.stream()
|
|
|
- .collect(Collectors.toMap(Teacher::getId, teacher -> teacher));
|
|
|
-
|
|
|
courseScheduleDao.batchAddCourseSchedules(courseScheduleList);
|
|
|
|
|
|
//计算每节课的课酬
|
|
@@ -3463,6 +3455,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
for (Map<Integer, String> classGroupStudent : classGroupStudents) {
|
|
|
Set<Integer> integers = classGroupStudent.keySet();
|
|
|
for (Integer integer : integers) {
|
|
|
+ List<Integer> collect = Arrays.asList(classGroupStudent.get(integer).split(",")).stream().map(e -> Integer.parseInt(e)).collect(Collectors.toList());
|
|
|
+ //学员退出群聊
|
|
|
+ imGroupMemberService.quit(integer.longValue(),collect);
|
|
|
classGroupStudentMapperDao.deleteByClassGroupIdAndStudents(integer, classGroupStudent.get(integer));
|
|
|
}
|
|
|
}
|
|
@@ -3546,9 +3541,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
@Override
|
|
|
public Map<String, Long> findClassCourseMinuteMap(List<Integer> classGroupIds, Map<String, Long> classCourseMinuteMap) {
|
|
|
Map<String, Long> resultMap = new HashMap<>();
|
|
|
- //获取默认的排课时长
|
|
|
-// String courseDefaultMinutes = sysConfigDao.findConfigValue("music_course_default_minutes");
|
|
|
-// JSONObject jsonObject = JSON.parseObject(courseDefaultMinutes);
|
|
|
//获取所选班级最大剩余课时
|
|
|
Map<String, Long> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
|
|
|
Set<String> courseTypes = map.keySet();
|
|
@@ -3809,23 +3801,27 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
List<Map<String, String>> classGroupStudents,
|
|
|
List<Long> allLockCourseIds,
|
|
|
String batchNo,BigDecimal masterTotalPrice){
|
|
|
- //将学员加进班级未开始的课程,以及班级关联、加群
|
|
|
- classGroupStudentMapperService.updateClassGroupStudents1(masterClassGroupId.longValue(),studentIds,allLockCourseIds,batchNo,masterTotalPrice);
|
|
|
- //删除学员课程
|
|
|
- if(courseIds.size() > 0){
|
|
|
- courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, studentIds);
|
|
|
- }
|
|
|
//删除班级关联的学员
|
|
|
List<Integer> classGroupIds = new ArrayList<>();
|
|
|
if (classGroupStudents != null && classGroupStudents.size() > 0) {
|
|
|
for (Map<String, String> classGroupStudent : classGroupStudents) {
|
|
|
Set<String> integers = classGroupStudent.keySet();
|
|
|
for (String integer : integers) {
|
|
|
+ List<Integer> collect = Arrays.asList(classGroupStudent.get(integer).split(",")).stream().map(e -> Integer.parseInt(e)).collect(Collectors.toList());
|
|
|
+ //学员退出群聊
|
|
|
+ imGroupMemberService.quit(Long.parseLong(integer),collect);
|
|
|
classGroupIds.add(Integer.parseInt(integer));
|
|
|
classGroupStudentMapperDao.deleteByClassGroupIdAndStudents(Integer.parseInt(integer), classGroupStudent.get(integer));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //将学员加进班级未开始的课程,以及班级关联、加群
|
|
|
+ classGroupStudentMapperService.updateClassGroupStudents1(masterClassGroupId.longValue(),studentIds,allLockCourseIds,batchNo,masterTotalPrice);
|
|
|
+ //删除学员课程
|
|
|
+ if(courseIds.size() > 0){
|
|
|
+ courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, studentIds);
|
|
|
+ }
|
|
|
//解冻课程
|
|
|
courseScheduleDao.batchUpdateLockByCourseIds(allLockCourseIds,0);
|
|
|
//解冻班级
|