|
|
@ -82,7 +82,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
jobCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
|
jobCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
|
Map<String, Integer> periodCountMap = getPeriodCountMap(groupLists, periods);
|
|
|
|
Map<String, Integer> periodCountMap = getPeriodCountMap(periods,schoolTeachers);
|
|
|
|
|
|
|
|
|
|
|
|
periodCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
|
periodCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
|
updatedSubjectCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
|
updatedSubjectCountMap.entrySet().removeIf(entry -> entry.getKey().isEmpty());
|
|
|
@ -230,15 +230,25 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
return updatedSubjectCountMap;
|
|
|
|
return updatedSubjectCountMap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static @NotNull Map<String, Integer> getPeriodCountMap(List<GroupList> groupLists,List<School.Period> periods) {
|
|
|
|
private static @NotNull Map<String, Integer> getPeriodCountMap(List<School.Period> periods,List<SchoolTeacher> schoolTeachers) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Integer> periodCountMap = new HashMap<>();
|
|
|
|
|
|
|
|
for (School.Period period : periods) {
|
|
|
|
|
|
|
|
for ( School.Subject subject : period.getSubjects()) {
|
|
|
|
|
|
|
|
for (SchoolTeacher schoolTeacher : schoolTeachers) {
|
|
|
|
|
|
|
|
if (schoolTeacher.getSubjectIds().contains(subject.getId())) {
|
|
|
|
|
|
|
|
periodCountMap.put(period.getId(), periodCountMap.getOrDefault(period.getId(), 0) + 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
Map<String, String> periodNameMap = new HashMap<>();
|
|
|
|
Map<String, String> periodNameMap = new HashMap<>();
|
|
|
|
List<String> periodNames = new ArrayList<>();
|
|
|
|
List<String> periodNames = new ArrayList<>();
|
|
|
|
for (School.Period period : periods) {
|
|
|
|
for (School.Period period : periods) {
|
|
|
|
periodNameMap.put(period.getId(), period.getName());
|
|
|
|
periodNameMap.put(period.getId(), period.getName());
|
|
|
|
periodNames.add(period.getName());
|
|
|
|
periodNames.add(period.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Map<String, Integer> periodCountMap = getStringIntegerMap(groupLists);
|
|
|
|
//Map<String, Integer> periodCountMap = getStringIntegerMap(groupLists);
|
|
|
|
// 更新 periodCountMap 的 key 为 period 名称
|
|
|
|
// 更新 periodCountMap 的 key 为 period 名称
|
|
|
|
Map<String, Integer> updatedPeriodCountMap = new HashMap<>();
|
|
|
|
Map<String, Integer> updatedPeriodCountMap = new HashMap<>();
|
|
|
|
for (Map.Entry<String, Integer> entry : periodCountMap.entrySet()) {
|
|
|
|
for (Map.Entry<String, Integer> entry : periodCountMap.entrySet()) {
|
|
|
@ -249,14 +259,10 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
updatedPeriodCountMap.put(periodName, count);
|
|
|
|
updatedPeriodCountMap.put(periodName, count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for(Map.Entry<String, Integer> entry : updatedPeriodCountMap.entrySet()) {
|
|
|
|
for (String periodName : periodNames) {
|
|
|
|
String name = entry.getKey();
|
|
|
|
if(!updatedPeriodCountMap.containsKey(periodName)) {
|
|
|
|
for (String periodName : periodNames) {
|
|
|
|
updatedPeriodCountMap.put(periodName, 0);
|
|
|
|
if(!name.equals(periodName)){
|
|
|
|
}
|
|
|
|
updatedPeriodCountMap.put(periodName, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return updatedPeriodCountMap;
|
|
|
|
return updatedPeriodCountMap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|