Browse Source

更新看课中的状态

yuhongqi 2 days ago
parent
commit
022cfba1c8

+ 0 - 3
fs-admin/src/main/java/com/fs/hisStore/task/MallStoreTask.java

@@ -222,9 +222,6 @@ public class MallStoreTask
     {
         List<FsStoreOrderScrm> list = fsStoreOrderMapper.selectUpdateExpress();
         Date nowDate = DateUtils.getNowDate();
-        for (FsStoreOrderScrm order : list) {
-            order.setUpdateTime(nowDate);
-        }
         for (FsStoreOrderScrm order : list){
             order.setUpdateTime(new Date());
             orderService.updateFsStoreOrder(order);

+ 5 - 5
fs-live-app/src/main/java/com/fs/live/websocket/service/WebSocketServer.java

@@ -187,14 +187,14 @@ public class WebSocketServer {
             LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveId, userId);
             // 如果用户连上了 socket,并且公司ID和销售ID大于0,更新 LiveWatchLog 的 logType
 
-            if ((companyId > 0 && companyUserId > 0) || (liveUserFirstEntry != null && liveUserFirstEntry.getCompanyId() > 0 && liveUserFirstEntry.getCompanyUserId() > 0 )) {
+            if ((qwUserId > 0 && externalContactId > 0) || (liveUserFirstEntry != null && liveUserFirstEntry.getCompanyId() > 0 && liveUserFirstEntry.getCompanyUserId() > 0 )) {
                 // 获取当前直播/回放状态
                 Map<String, Integer> flagMap = liveWatchUserService.getLiveFlagWithCache(liveId);
                 Integer currentLiveFlag = flagMap.get("liveFlag");
 
                 // 如果当前是直播状态(liveFlag = 1),更新 logType
                 if (currentLiveFlag != null && currentLiveFlag == 1) {
-                    updateLiveWatchLogTypeOnConnect(liveId, userId, companyId, companyUserId);
+                    updateLiveWatchLogTypeOnConnect(liveId, userId, qwUserId, externalContactId);
                 }
             }
 
@@ -1144,13 +1144,13 @@ public class WebSocketServer {
      * 在连接时更新 LiveWatchLog 的 logType
      * 如果 logType 类型不是 2,修改 logType 类型为 1(看课中)
      */
-    private void updateLiveWatchLogTypeOnConnect(Long liveId, Long userId, Long companyId, Long companyUserId) {
+    private void updateLiveWatchLogTypeOnConnect(Long liveId, Long userId, Long qwUserId, Long externalContactId) {
         try {
             LiveWatchLog queryLog = new LiveWatchLog();
             queryLog.setLiveId(liveId);
             queryLog.setUserId(userId);
-            queryLog.setCompanyId(companyId);
-            queryLog.setCompanyUserId(companyUserId);
+            queryLog.setQwUserId(String.valueOf(qwUserId));
+            queryLog.setExternalContactId(externalContactId);
             
             List<LiveWatchLog> logs = liveWatchLogService.selectLiveWatchLogList(queryLog);
             if (logs != null && !logs.isEmpty()) {