|
@@ -878,13 +878,14 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
Map<Long, Integer> vipGroupOverCourseMaps = MapUtil.convertIntegerMap(vipGroupOverCourses);
|
|
|
|
|
|
List<ClassGroup> byClassGroupIds = classGroupDao.findByClassGroupIds(classGroupIds);
|
|
|
- Map<Integer, ClassGroup> classGorupIdMap = byClassGroupIds.stream()
|
|
|
- .collect(Collectors.toMap(ClassGroup::getId, classGroup -> classGroup));
|
|
|
+ Map<Integer, ClassGroup> classGorupIdMap = byClassGroupIds.stream().collect(Collectors.toMap(ClassGroup::getId, classGroup -> classGroup));
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//统计班级人数
|
|
|
List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds);
|
|
|
Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
|
|
|
-
|
|
|
+ Map<Integer, Long> currentClassTimes = MapUtil.convertIntegerMap(courseScheduleDao.countCurrentNumByClassGroupId(classGroupIds,null));
|
|
|
teacherMusicClassGroup.forEach(teacherClassGroupDto -> {
|
|
|
|
|
|
if (teacherClassGroupDto.getType() == ClassGroupTypeEnum.VIP) {
|
|
@@ -917,8 +918,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
}
|
|
|
|
|
|
ClassGroup classGroup = classGorupIdMap.get(teacherClassGroupDto.getClassGroupId().intValue());
|
|
|
-
|
|
|
- teacherClassGroupDto.setSurplusClassTimes(classGroup.getTotalClassTimes() - classGroup.getCurrentClassTimes());
|
|
|
+// teacherClassGroupDto.setSurplusClassTimes(classGroup.getTotalClassTimes() - classGroup.getCurrentClassTimes());
|
|
|
+ Long aLong = currentClassTimes.get(teacherClassGroupDto.getClassGroupId().intValue());
|
|
|
+ teacherClassGroupDto.setSurplusClassTimes(aLong==null?0:aLong.intValue());
|
|
|
Long studentNum = classGroupStudentNumMap.get(teacherClassGroupDto.getClassGroupId().intValue());
|
|
|
teacherClassGroupDto.setStudentNum(Objects.isNull(studentNum) ? 0 : studentNum.intValue());
|
|
|
|
|
@@ -1790,7 +1792,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = classGroupDao.queryMusicGroupClassGroup(params);
|
|
|
- Set<Integer> classGroups = dataList.stream().map(e -> e.getClassGroupId()).collect(Collectors.toSet());
|
|
|
+ List<Integer> classGroups = dataList.stream().map(e -> e.getClassGroupId()).collect(Collectors.toList());
|
|
|
Map<Integer, Long> totalNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalNumByClassGroupId(classGroups, null));
|
|
|
Map<Integer, Long> currentNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countCurrentNumByClassGroupId(classGroups, null));
|
|
|
String join = StringUtils.join(classGroups, ",");
|
|
@@ -2011,7 +2013,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
return null;
|
|
|
}
|
|
|
String classGroupIds = classGroups.stream().map(classGroup -> classGroup.getId().toString()).collect(Collectors.joining(","));
|
|
|
- Set<Integer> classGroupSet = classGroups.stream().map(classGroup -> classGroup.getId()).collect(Collectors.toSet());
|
|
|
+ List<Integer> classGroupSet = classGroups.stream().map(classGroup -> classGroup.getId()).collect(Collectors.toList());
|
|
|
|
|
|
List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperDao.findClassGroupTeachers(classGroupIds);
|
|
|
Map<Integer, Integer> studyNums = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(classGroupDao.countStudyNum(classGroupIds))), HashMap.class);
|