change 4 лет назад
Родитель
Сommit
f9abd92ad8

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanServiceImpl.java

@@ -300,7 +300,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
                     }
                     }
                     //更新当天学习节数是否已经完成
                     //更新当天学习节数是否已经完成
                     List<UserStudyRecord> collect = studyCount.stream().filter(v -> v.getCourseId().equals(s.getCourseId())).collect(Collectors.toList());
                     List<UserStudyRecord> collect = studyCount.stream().filter(v -> v.getCourseId().equals(s.getCourseId())).collect(Collectors.toList());
-                    if (collect.size() >= b.getStudyGoal()) {
+                    if (s.getStudyGoal() != null &&collect.size() >= b.getStudyGoal()) {
                         calendarStudyVos.stream().filter(c -> c.getMonth() == cal.get(Calendar.MONTH) + 1).forEach(c -> {
                         calendarStudyVos.stream().filter(c -> c.getMonth() == cal.get(Calendar.MONTH) + 1).forEach(c -> {
                             c.getDayStudyList().stream()
                             c.getDayStudyList().stream()
                                     .forEach(d -> {
                                     .forEach(d -> {
@@ -476,7 +476,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
                 }
                 }
                 //更新当天学习节数是否已经完成
                 //更新当天学习节数是否已经完成
                 List<UserStudyRecord> collect = studyCount.stream().filter(v -> v.getCourseId().equals(s.getCourseId())).collect(Collectors.toList());
                 List<UserStudyRecord> collect = studyCount.stream().filter(v -> v.getCourseId().equals(s.getCourseId())).collect(Collectors.toList());
-                if (collect.size() >= s.getStudyGoal()){
+                if (s.getStudyGoal() != null && collect.size() >= s.getStudyGoal()){
                     calendarStudyVos.stream().filter(c -> c.getMonth()==cal.get(Calendar.MONTH) + 1).forEach(c -> {
                     calendarStudyVos.stream().filter(c -> c.getMonth()==cal.get(Calendar.MONTH) + 1).forEach(c -> {
                         c.getDayStudyList().stream()
                         c.getDayStudyList().stream()
                                 .forEach(d -> {
                                 .forEach(d -> {