Browse Source

bug修改

zouxuan 5 months ago
parent
commit
b478a38d5c

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -229,9 +229,11 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
         //获取课程规划
         MusicGroupTrainPlanSaveDto schoolTerm = musicGroupTrainPlanService.getSchoolTerm(courseSchedule);
         int courseNumNo = courseScheduleDao.getCourseNumNo(schoolTerm);
-        List<MusicGroupTrainPlan> planList = musicGroupTrainPlanService.queryPlan(schoolTerm);
-        if(planList.size() >= courseNumNo){
-            musicGroupTrainPlan = planList.get(courseNumNo - 1);
+        if(courseNumNo > 0){
+            List<MusicGroupTrainPlan> planList = musicGroupTrainPlanService.queryPlan(schoolTerm);
+            if(planList.size() >= courseNumNo){
+                musicGroupTrainPlan = planList.get(courseNumNo - 1);
+            }
         }
 
         CourseHomeworkStudentDetailDto courseHomeworkStudentDetail = studentCourseHomeworkDao.findCourseHomeworkStudentDetail(courseScheduleID, userId);