From cd421db42b8b7b1af3870e801261427fb67f7bfa Mon Sep 17 00:00:00 2001 From: "hhb@hotmail.com" Date: Tue, 3 Dec 2024 17:09:32 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=95=99=E5=B8=88=E5=88=86=E5=B8=83?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=BF=94=E5=9B=9E=E5=80=BC=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/service/impl/TeacherServiceImpl.java | 7 +++++++ src/main/java/cn/teammodel/model/vo/admin/GpTeacherVo.java | 1 + .../java/cn/teammodel/model/vo/admin/TeacherGradeVo.java | 1 + 3 files changed, 9 insertions(+) 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;