diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java index d5d529c..826882b 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java @@ -257,6 +257,7 @@ public class TeacherServiceImpl implements TeacherService { TeacherGradeVo teacher = new TeacherGradeVo(); teacher.setName((String) map.get("name")); teacher.setId((String) map.get("tmdId")); + teacher.setPeriodId((String) map.get("periodId")); // 处理 grade 字段 List> gradeList = (List>) map.get("grade"); if (gradeList != null) { @@ -548,6 +549,9 @@ public class TeacherServiceImpl implements TeacherService { } for (TeacherGradeVo grade : gradeList) { if(teacher.getId().equals(grade.getId())) { + if(StringUtils.isNotEmpty(grade.getPeriodId())) { + teacher.setPeriodId(grade.getPeriodId()); + } List grades = grade.getGrade(); for (TeacherGradeVo.IdAndName gg : grades) { String id = String.valueOf(teacherDto.year - gg.getGrade()); @@ -561,6 +565,9 @@ public class TeacherServiceImpl implements TeacherService { } } + teachersList = teachersList.stream() + .filter(teacher -> teacherDto.periodId.equals(teacher.getPeriodId())) + .collect(Collectors.toList()); Map gradeCount = new HashMap<>(); Map degreeCount = new HashMap<>(); Map subjectCount = new HashMap<>(); diff --git a/src/main/java/cn/teammodel/model/vo/admin/GpTeacherVo.java b/src/main/java/cn/teammodel/model/vo/admin/GpTeacherVo.java index 526c5ee..efd5d6b 100644 --- a/src/main/java/cn/teammodel/model/vo/admin/GpTeacherVo.java +++ b/src/main/java/cn/teammodel/model/vo/admin/GpTeacherVo.java @@ -22,6 +22,7 @@ public class GpTeacherVo { public Long practiceTime ; public String gender ; public List grade; + public String periodId ; @Data public static class IdNameCode{ public String id ; diff --git a/src/main/java/cn/teammodel/model/vo/admin/TeacherGradeVo.java b/src/main/java/cn/teammodel/model/vo/admin/TeacherGradeVo.java index cf279c9..6efb10e 100644 --- a/src/main/java/cn/teammodel/model/vo/admin/TeacherGradeVo.java +++ b/src/main/java/cn/teammodel/model/vo/admin/TeacherGradeVo.java @@ -9,6 +9,7 @@ public class TeacherGradeVo { private List grade; private String id; private String name; + private String periodId; @Data public static class IdAndName{ public Integer grade;