From b9c4503aaa50f62d82f7ea434f78b29690d049e9 Mon Sep 17 00:00:00 2001 From: lu Date: Wed, 31 Jul 2024 16:55:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=AF=BC=E5=87=BA=E5=88=A4?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xboe/module/course/api/CoursePortalApi.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CoursePortalApi.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CoursePortalApi.java index 5f809603..c06882f5 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CoursePortalApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CoursePortalApi.java @@ -369,7 +369,11 @@ public class CoursePortalApi extends ApiBaseController{ public void export(String courseName,String courseId,String contentId,String name,Integer status,HttpServletResponse response) throws IOException { Mapmap=new HashMap<>(); try { - studyService.getList(courseId, contentId, name, status).stream().filter(Objects::nonNull).forEach(s->{ + List list = studyService.getList(courseId, contentId, name, status); + if(list.isEmpty()){ + throw new RuntimeException("暂无数据"); + } + list.stream().filter(Objects::nonNull).forEach(s->{ shomeworkService.getByStudyIdAndContentId(s.getStudyId(),contentId).stream().filter(Objects::nonNull).filter(e->e.getFilePath()!=null).forEach(e->{ //取作业后缀名 int dotIndex = e.getFilePath().lastIndexOf('/'); // 查找最后一个'.'的位置