From 53f7dc9bdaff04aca958cf0ede5d9ec1087d09fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=80=BB=E8=A3=81?= <14186472+wenyu441069198@user.noreply.gitee.com> Date: Wed, 14 Aug 2024 16:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=82=96=E6=B5=B7=E5=8D=97=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=A8=A1=E7=B3=8A=E5=88=86=E9=A1=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/umsAdmin/UmsStudentManageServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 5e5ae6c..23cff82 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 @@ -69,14 +69,20 @@ public class UmsStudentManageServiceImpl extends ServiceImpl umsStudentManageList = umsStudentManages.stream() - .filter(studentManage -> studentManage.getName().contains(umsStudentPageQueryDTO.getName())) + .filter(studentManage -> + studentManage != null && + studentManage.getName() != null && + studentManage.getName().contains(umsStudentPageQueryDTO.getName())) .skip((umsStudentPageQueryDTO.getPage() - 1) * umsStudentPageQueryDTO.getPageSize()) .limit(umsStudentPageQueryDTO.getPageSize()) .collect(Collectors.toList()); result.put("Records", umsStudentManageList); }else if (umsStudentPageQueryDTO.getNumber() != null){ List umsStudentManageList = umsStudentManages.stream() - .filter(studentManage -> studentManage.getNumber().contains(umsStudentPageQueryDTO.getNumber())) + .filter(studentManage -> + studentManage != null && + studentManage.getNumber() != null && + studentManage.getNumber().contains(umsStudentPageQueryDTO.getNumber())) .skip((umsStudentPageQueryDTO.getPage() - 1) * umsStudentPageQueryDTO.getPageSize()) .limit(umsStudentPageQueryDTO.getPageSize()) .collect(Collectors.toList());