|
|
|
@ -32,11 +32,11 @@ import static cn.teammodel.utils.SchoolDateUtil.calculateWeekNum;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
public class TeacherServiceImpl implements TeacherService {
|
|
|
|
|
@Resource
|
|
|
|
|
private SchoolGroupListRepository schoolGroupListRepository;
|
|
|
|
|
@Resource
|
|
|
|
|
private SchoolTeacherRepository schoolTeacherRepository;
|
|
|
|
|
@Resource
|
|
|
|
|
private SchoolGroupListRepository schoolGroupListRepository;
|
|
|
|
|
@Resource
|
|
|
|
|
private SchoolRepository schoolRepository;
|
|
|
|
|
@Resource
|
|
|
|
|
private LessonRecordRepository lessonRecordRepository;
|
|
|
|
@ -46,6 +46,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
|
public List<Map<String, Integer>> getTeacherList(TeacherDto teacherDto) {
|
|
|
|
|
List<Map<String, Integer>> result = new ArrayList<>();
|
|
|
|
|
Map<String, Integer> teacherCountMap = new HashMap<>();
|
|
|
|
|
Map<String, Integer> groupCountMap = new HashMap<>();
|
|
|
|
|
List<GroupList> groupLists = schoolGroupListRepository.findAllByCode("GroupList-" + teacherDto.getCode());
|
|
|
|
|
List<SchoolTeacher> schoolTeachers = schoolTeacherRepository.findAllByCode("Teacher-" + teacherDto.getCode());
|
|
|
|
|
teacherCountMap.put("教师总人数", schoolTeachers.size());
|
|
|
|
@ -83,13 +84,16 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
|
}
|
|
|
|
|
jobCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
|
|
Map<String, Integer> periodCountMap = getPeriodCountMap(periods,schoolTeachers);
|
|
|
|
|
|
|
|
|
|
for (GroupList groupList : groupLists) {
|
|
|
|
|
groupCountMap.put(groupList.getName(), groupList.getMembers().size());
|
|
|
|
|
}
|
|
|
|
|
periodCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
|
|
updatedSubjectCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
|
|
result.add(updatedSubjectCountMap);
|
|
|
|
|
result.add(jobCountMap);
|
|
|
|
|
result.add(periodCountMap);
|
|
|
|
|
result.add(teacherCountMap);
|
|
|
|
|
result.add(groupCountMap);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -267,7 +271,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
|
return updatedPeriodCountMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static @NotNull Map<String, Integer> getStringIntegerMap(List<GroupList> groupLists) {
|
|
|
|
|
/*private static @NotNull Map<String, Integer> getStringIntegerMap(List<GroupList> groupLists) {
|
|
|
|
|
Map<String, Integer> periodCountMap = new HashMap<>();
|
|
|
|
|
// 遍历所有 GroupList 对象
|
|
|
|
|
for (GroupList group : groupLists) {
|
|
|
|
@ -282,5 +286,5 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return periodCountMap;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|