he2802 1 год назад
Родитель
Сommit
39f6c9ef0f

+ 12 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -880,7 +880,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
                 CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
                 menuQueryBo.setCourseId(courseVo.getCourseId());
                 List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(menuQueryBo);
-                courseMenuVoList.forEach(courseMenuVo -> {
+                for(CourseMenuVo courseMenuVo:courseMenuVoList){
                     if(courseMenuVo.getType()==1){
                         SyncUserChapterList syncUserChapterItem = new SyncUserChapterList();
                         syncUserChapterItem.setChapterId(courseMenuVo.getMenuId());
@@ -888,7 +888,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
                         List<SyncUserChapterList> ChildChapList = new ArrayList<>();
                         //获取章信息
                         List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
-                        courseModuleChapterVoList.forEach(courseModuleChapterVo -> {
+                        for(CourseModuleChapterVo courseModuleChapterVo:courseModuleChapterVoList){
                             SyncUserChapterList syncUserChapterChildItem = new SyncUserChapterList();
                             syncUserChapterChildItem.setChapterId(courseModuleChapterVo.getChapterId());
                             syncUserChapterChildItem.setChapterName(courseModuleChapterVo.getName());
@@ -943,6 +943,12 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
                                     List<UserStudyRecordPhoto> videoPhoto2 = userStudyRecordPhotoService.list(lqw);
                                     syncUserStudyRec.setCreateTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
                                     syncUserStudyRec.setEndTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    if(Validator.isEmpty(studyStartTime)||(studyStartTime.longValue()>userPeriodStatusVo.getRecordStartTime().longValue())){
+                                        studyStartTime = userPeriodStatusVo.getRecordStartTime();
+                                    }
+                                    if(Validator.isEmpty(studyEndTime)||(studyEndTime.longValue()<userPeriodStatusVo.getRecordEndTime().longValue())){
+                                        studyEndTime = userPeriodStatusVo.getRecordEndTime();
+                                    }
                                     syncUserStudyRec.setStudyIP(userPeriodStatusVo.getIp());
                                     List<SyncUserImageRc> ImgList = new ArrayList<>();
                                     for (UserStudyRecordPhoto videoPhoto : videoPhoto2) {
@@ -958,12 +964,14 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
                             }
                             syncUserChapterChildItem.setRecList(RecList);
                             ChildChapList.add(syncUserChapterChildItem);
-                        });
+                        }
                         syncUserChapterItem.setChildChapList(ChildChapList);
                         ChapterList.add(syncUserChapterItem);
                     }
-                });
+                }
             }
+            studyRec.setBeginTime(DateUtils.timestampToDateFormat(studyStartTime));
+            studyRec.setEndTime(DateUtils.timestampToDateFormat(studyEndTime));
             studyRec.setChapterList(ChapterList);
         }
         //学习记录推送到旧系统