From 9735c0e1bdfc692d70c7c36c357982891cc75d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=80=BB=E8=A3=81?= <14186472+wenyu441069198@user.noreply.gitee.com> Date: Tue, 13 Aug 2024 11:09:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=82=96=E6=B5=B7=E5=8D=97=E6=9F=A5=E8=80=81?= =?UTF-8?q?=E5=B8=88=E6=89=80=E6=95=99=E7=9A=84=E5=AD=A6=E7=94=9F=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/service/courses/ICoursesService.java | 1 + .../service/impl/courses/CoursesServiceImpl.java | 13 ++++++++----- .../impl/umsAdmin/UmsStudentManageServiceImpl.java | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/teaching/backend/service/courses/ICoursesService.java b/src/main/java/com/teaching/backend/service/courses/ICoursesService.java index 6a507d9..e08a348 100644 --- a/src/main/java/com/teaching/backend/service/courses/ICoursesService.java +++ b/src/main/java/com/teaching/backend/service/courses/ICoursesService.java @@ -4,6 +4,7 @@ package com.teaching.backend.service.courses; import com.baomidou.mybatisplus.extension.service.IService; import com.teaching.backend.model.dto.courses.CoursesDTO; import com.teaching.backend.model.dto.courses.PageDTO; +import com.teaching.backend.model.dto.umsAdmin.UmsStudentPageQueryDTO; import com.teaching.backend.model.entity.courses.Courses; import com.teaching.backend.model.entity.umsAdmin.UmsStudent; import com.teaching.backend.model.entity.umsAdmin.UmsStudentManage; diff --git a/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java index 7d5eab9..005414f 100644 --- a/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java @@ -20,6 +20,7 @@ import com.teaching.backend.mapper.umsAdmin.UmsTeacherMapper; import com.teaching.backend.mapper.umsAdmin.UmsUserMapper; import com.teaching.backend.model.dto.courses.CoursesDTO; import com.teaching.backend.model.dto.courses.PageDTO; +import com.teaching.backend.model.dto.umsAdmin.UmsStudentPageQueryDTO; import com.teaching.backend.model.entity.chapter.Chapter; import com.teaching.backend.model.entity.courses.*; import com.teaching.backend.model.entity.records.CourseLearningRecord; @@ -364,11 +365,13 @@ public class CoursesServiceImpl extends ServiceImpl impl List personalCenterStudentListVOList = new ArrayList<>(); PersonalCenterStudentListVO personalCenterStudentListVO = null; for (UmsStudentManage umsStudentManage : umsStudentManageList) { - personalCenterStudentListVO = new PersonalCenterStudentListVO(); - personalCenterStudentListVO.setIcon(umsStudentManage.getIcon()); - personalCenterStudentListVO.setName(umsStudentManage.getName()); - personalCenterStudentListVO.setNumber(umsStudentManage.getNumber()); - personalCenterStudentListVOList.add(personalCenterStudentListVO); + if (umsStudentManage != null){ + personalCenterStudentListVO = new PersonalCenterStudentListVO(); + personalCenterStudentListVO.setIcon(umsStudentManage.getIcon()); + personalCenterStudentListVO.setName(umsStudentManage.getName()); + personalCenterStudentListVO.setNumber(umsStudentManage.getNumber()); + personalCenterStudentListVOList.add(personalCenterStudentListVO); + } } return personalCenterStudentListVOList; } diff --git a/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java index 12eb47d..410f1bd 100644 --- a/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java @@ -53,7 +53,7 @@ public class UmsStudentManageServiceImpl extends ServiceImpl pageQuery(UmsStudentPageQueryDTO umsStudentPageQueryDTO) { - LinkedHashSet umsStudentManages = coursesService.queryTeacherByStudentList(umsStudentPageQueryDTO.getUserId()); + LinkedHashSet umsStudentManages = coursesService.queryTeacherByStudentList(umsStudentPageQueryDTO.getName()); //总记录数 int totalCount = umsStudentManages.size();