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('/'); // 查找最后一个'.'的位置