فهرست منبع

fix:会员看课记录添加课程所属项目

caoliqin 1 ماه پیش
والد
کامیت
d39dcaa84b

+ 3 - 0
fs-service-system/src/main/java/com/fs/course/domain/FsCourseWatchLog.java

@@ -85,4 +85,7 @@ public class FsCourseWatchLog extends BaseEntity
     /** 营期id */
     private Long periodId;
 
+    /** 项目id */
+    private Long project;
+
 }

+ 13 - 0
fs-service-system/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -134,6 +134,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
     @Autowired
     private FsVideoResourceMapper fsVideoResourceMapper;
 
+    @Autowired
+    private FsUserCourseMapper fsUserCourseMapper;
+
     /**
      * 查询课堂视频
      *
@@ -918,9 +921,18 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             log.setCompanyUserId(param.getCompanyUserId());
             log.setVideoId(param.getVideoId());
             List<FsCourseWatchLog> fsCourseWatchLogs = courseWatchLogMapper.selectFsCourseWatchLogList(log);
+
+            // 获取课程所属项目id
+            FsUserCourse fsUserCourse = fsUserCourseMapper.selectFsUserCourseByCourseId(param.getCourseId());
+            Long courseProject = null;
+            if(fsUserCourse != null){
+                courseProject = fsUserCourse.getProject();
+            }
             //如果存在,则更新
             if (fsCourseWatchLogs != null && !fsCourseWatchLogs.isEmpty()){
                 FsCourseWatchLog updateLog = new FsCourseWatchLog();
+                updateLog.setPeriodId(param.getPeriodId());
+                updateLog.setProject(courseProject);
                 updateLog.setUpdateTime(new Date());
                 courseWatchLogMapper.updateFsCourseWatchLog(updateLog);
             } else {
@@ -931,6 +943,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
                 fsCourseWatchLog.setDuration(0L);
                 fsCourseWatchLog.setCreateTime(new Date());
                 fsCourseWatchLog.setLogType(1);
+                fsCourseWatchLog.setProject(courseProject);
                 courseWatchLogMapper.insertFsCourseWatchLog(fsCourseWatchLog);
             }
         } else {