dzx 7 månader sedan
förälder
incheckning
360e275950

+ 6 - 0
src/main/java/com/xjrsoft/module/courseTable/service/impl/CourseTableServiceImpl.java

@@ -1290,6 +1290,9 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
                             .in(BaseClass::getGradeId, dto.getGradeIds())
                             .in(BaseClass::getOrgId, dto.getDeptIds())
             );
+            if(classList.isEmpty()){
+                throw new MyException("未查询到班级,无法导出");
+            }
 
             Map<String, List<CourseDetailVo>> classDataMap = tableVo.getCourseList().stream().filter(x -> x.getClassName() != null).collect(Collectors.groupingBy(CourseDetailVo::getClassName));
 
@@ -1433,6 +1436,9 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
                             .in(BaseClass::getOrgId, dto.getDeptIds())
                             .orderByAsc(BaseClass::getName)
             );
+            if(classList.isEmpty()){
+                throw new MyException("未查询到班级,无法导出");
+            }
             Map<String, List<CourseDetailVo>> classDataMap = tableVo.getCourseList().stream().collect(Collectors.groupingBy(CourseDetailVo::getClassName));
             ArrayList<ArrayList<String>> dataList = new ArrayList<>();
             for (BaseClass baseClass : classList) {