|
@@ -174,9 +174,19 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
List<ClassGroup> classGroups = findClassGroupByIds(classGroupIds);
|
|
|
int studentNum = 0; //学生数
|
|
|
String subjectIds = "";
|
|
|
+ List<Integer> classGroupIdList = new ArrayList<>();
|
|
|
for (ClassGroup classGroup : classGroups) {
|
|
|
studentNum += classGroup.getStudentNum();
|
|
|
subjectIds += subjectIds.isEmpty() ? classGroup.getSubjectIdList() : "," + classGroup.getSubjectIdList();
|
|
|
+ classGroupIdList.add(classGroup.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
|
+ List<ClassGroupStudentMapper> classGroupStudentMappers = classGroupStudentMapperDao.findByClassGroups(classGroupIdList);
|
|
|
+
|
|
|
+ for (ClassGroupStudentMapper classGroupStudentMapper : classGroupStudentMappers) {
|
|
|
+ if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) continue;
|
|
|
+ imGroupMemberList.add(new ImGroupMember(classGroupStudentMapper.getUserId().toString()));
|
|
|
}
|
|
|
|
|
|
//1、插入班级
|
|
@@ -201,6 +211,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
classGroupRelationList.add(classGroupRelation);
|
|
|
}
|
|
|
classGroupRelationService.classGroupRelationsInsert(classGroupRelationList);
|
|
|
+
|
|
|
+ ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
|
|
|
+ // 创建群组
|
|
|
+ imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
|
|
|
return classGroup;
|
|
|
}
|
|
|
|
|
@@ -283,6 +297,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
}
|
|
|
}
|
|
|
courseScheduleDao.batchAddCourseSchedules(courseScheduleList);
|
|
|
+
|
|
|
+ ImGroupMember[] imGroupMembers = {new ImGroupMember(classGroupTeacherMapper.getUserId().toString())};
|
|
|
+ // 创建群组
|
|
|
+ imFeignService.groupCreate(new ImGroupModel(highClassGroup.getId().toString(), imGroupMembers, highClassGroup.getName()));
|
|
|
}
|
|
|
return highClassGroupList;
|
|
|
}
|