From fa9571e2c59dab7880810db9742281be4692b793 Mon Sep 17 00:00:00 2001 From: Alan <3052806735@qq.com> Date: Fri, 26 Jul 2024 17:39:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=95=99=E5=B8=88=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/model/vo/courses/TeacherInfVO.java | 2 +- .../service/impl/umsAdmin/UmsUserServiceImpl.java | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/teaching/backend/model/vo/courses/TeacherInfVO.java b/src/main/java/com/teaching/backend/model/vo/courses/TeacherInfVO.java index a99a24f..65f75ef 100644 --- a/src/main/java/com/teaching/backend/model/vo/courses/TeacherInfVO.java +++ b/src/main/java/com/teaching/backend/model/vo/courses/TeacherInfVO.java @@ -10,7 +10,7 @@ import lombok.Data; public class TeacherInfVO { /** - * 教师username + * 教师userId */ @ApiModelProperty("教师userId") private Long userId; diff --git a/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsUserServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsUserServiceImpl.java index 5ac3301..ef82ab9 100644 --- a/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsUserServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsUserServiceImpl.java @@ -381,15 +381,13 @@ public class UmsUserServiceImpl extends ServiceImpl impl } @Override public List getTeacherInfList() { - List umsUserTeachers = query().eq("role_id", TEACHER_ROLE).list(); + List umsTeachers = umsTeacherMapper.selectList(new LambdaQueryWrapper<>(UmsTeacher.class)); TeacherInfVO teacherInfVO = null; List teacherInfList = new ArrayList<>(); - for (UmsUser umsUserTeacher : umsUserTeachers) { + for (UmsTeacher umsTeacher : umsTeachers) { teacherInfVO = new TeacherInfVO(); - String teacherName = umsTeacherMapper.selectOne(new LambdaQueryWrapper<>(UmsTeacher.class) - .eq(UmsTeacher::getUserId, umsUserTeacher.getId())).getName(); - teacherInfVO.setName(teacherName); - teacherInfVO.setUserId(umsUserTeacher.getId()); + teacherInfVO.setName(umsTeacher.getName()); + teacherInfVO.setUserId(umsTeacher.getUserId()); teacherInfList.add(teacherInfVO); } return teacherInfList;