Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

yfh 1 день назад
Родитель
Сommit
226fd08dff

+ 7 - 7
fs-live-app/src/main/java/com/fs/live/task/Task.java

@@ -947,13 +947,13 @@ public class Task {
                 boolean needUpdate = false;
                 Integer newLogType = log.getLogType();
 
-                // ① 如果在线时长 <= 3分钟,修改 logType 为 4(看课中断)
-                if (onlineSeconds <= 180) { // 3分钟 = 180秒
-                    newLogType = 4;
-                    needUpdate = true;
-                }
-                // ③ 如果直播视频 >= 40分钟,在线时长 >= 30分钟,logType 设置为 2(完课)
-                else if (totalVideoDuration >= 2400 && onlineSeconds >= 1800) { // 40分钟 = 2400秒,30分钟 = 1800秒
+                // ① 如果在线时长 <= 3分钟,修改 logType 为 4(看课中断) lmx-这个逻辑不合理,不能这样判定看课中断
+//                if (onlineSeconds <= 180) { // 3分钟 = 180秒
+//                    newLogType = 4;
+//                    needUpdate = true;
+//                } else
+                    // ③ 如果直播视频 >= 40分钟,在线时长 >= 30分钟,logType 设置为 2(完课)
+                if (totalVideoDuration >= 2400 && onlineSeconds >= 1800) { // 40分钟 = 2400秒,30分钟 = 1800秒
                     newLogType = 2;
                     log.setFinishTime(now);
                     needUpdate = true;

+ 9 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCoursePeriodServiceImpl.java

@@ -146,6 +146,15 @@ public class FsUserCoursePeriodServiceImpl implements IFsUserCoursePeriodService
             coursePeriodDays.setStartDateTime(startDateTime);
             coursePeriodDays.setEndDateTime(endDateTime);
             coursePeriodDays.setLastJoinTime(lastJsonTime);
+
+            if(LocalDate.now().isBefore(coursePeriodDays.getStartDateTime().toLocalDate())){
+                coursePeriodDays.setStatus(0);
+            } else if(LocalDate.now().isAfter(coursePeriodDays.getStartDateTime().toLocalDate())){
+                coursePeriodDays.setStatus(2);
+            } else{
+                coursePeriodDays.setStatus(1);
+            }
+
             fsUserCoursePeriodDaysMapper.updateFsUserCoursePeriodDays(coursePeriodDays); // 更新数据库中的课程日期
         }
 

+ 6 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveWatchUserServiceImpl.java

@@ -875,6 +875,12 @@ public class LiveWatchUserServiceImpl implements ILiveWatchUserService {
     @Override
     @Async
     public void qwTagMarkByLiveWatchLog(Long liveId) {
+        //休眠2分钟 等待看课中断的所有看课记录状态被正确处理标记
+        try {
+            Thread.sleep(120000L);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
         log.info("处理直播间打标签: liveId={}", liveId);
         //查询直播间的标签配置
         List<LiveTagItemVO> liveTagConfig = liveTagConfigMapper.getLiveTagListByliveId(liveId);