| 
					
				 | 
			
			
				@@ -5,8 +5,6 @@ import com.alibaba.fastjson.JSON; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.alibaba.fastjson.JSONArray; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.app.taskService.SopLogsTaskService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.common.core.domain.R; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.common.exception.base.BaseException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.common.utils.PubFun; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.common.utils.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.company.domain.Company; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -19,7 +17,6 @@ import com.fs.config.cloud.CloudHostProper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.course.config.CourseConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.course.domain.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.course.mapper.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.course.param.FsCourseLinkCreateParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.course.service.IFsCourseLinkService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.course.service.IFsUserCompanyBindService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.qw.domain.*; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -286,7 +283,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public void selectSopUserLogsListByTime(LocalDateTime currentTime) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void selectSopUserLogsListByTime(LocalDateTime currentTime, List<String> sopidList) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         long startTimeMillis = System.currentTimeMillis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         log.info("====== 开始选择和处理 SOP 用户日志 ======"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -296,7 +293,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             config = cachedCourseConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<SopUserLogsVo> sopUserLogsVos = sopUserLogsMapper.selectSopUserLogsListByTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<SopUserLogsVo> sopUserLogsVos = sopUserLogsMapper.selectSopUserLogsListByTime(sopidList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (sopUserLogsVos.isEmpty()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             log.info("没有需要处理的 SOP 用户日志。"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1002,8 +999,22 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //小程序单独 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 case "4": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    addWatchLogIfNeeded(sopLogs, videoId, courseId, sendTime, qwUserId, companyUserId, companyId, externalId,logVo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (isGroupChat) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            groupChat.getChatUserList().stream().filter(e -> e.getUserList() != null && !e.getUserList().isEmpty()).forEach(e -> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                Map<String, GroupUserExternalVo> userMap = PubFun.listToMapByGroupObject(e.getUserList(), GroupUserExternalVo::getUserId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                GroupUserExternalVo vo = userMap.get(groupChat.getOwner()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (vo != null && vo.getId() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    sopLogs.setFsUserId(vo.getFsUserId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    addWatchLogIfNeeded(sopLogs, videoId, courseId, sendTime, qwUserId, companyUserId, companyId, vo.getId().toString(), logVo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            log.error("群聊创建看课记录失败!", e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        addWatchLogIfNeeded(sopLogs, videoId, courseId, sendTime, qwUserId, companyUserId, companyId, externalId,logVo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     String sortLink = createLinkByMiniApp(setting, logVo, sendTime, courseId, videoId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             qwUserId, companyUserId, companyId, externalId,isOfficial,sopLogs.getFsUserId(), isGroupChat ? groupChat.getChatId() : null); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1075,6 +1086,12 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        clonedContent.getSetting().stream().filter(e -> "1".equals(e.getIsBindUrl())).forEach(e -> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            e.setIsBindUrl("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            e.setLinkDescribe(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            e.setLinkUrl(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            e.setLinkImageUrl(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sopLogs.setContentJson(JSON.toJSONString(clonedContent)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         enqueueQwSopLogs(sopLogs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1364,10 +1381,12 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         link.setCompanyId(Long.parseLong(companyId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         link.setQwUserId(Long.parseLong(qwUserId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         link.setCompanyUserId(Long.parseLong(companyUserId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        link.setVideoId(videoId.longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        link.setVideoId(videoId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         link.setCorpId(logVo.getCorpId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        link.setCourseId(courseId.longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        link.setQwExternalId(Long.parseLong(externalId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        link.setCourseId(courseId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(StringUtils.isEmpty(chatId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            link.setQwExternalId(Long.parseLong(externalId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         link.setProjectCode(cloudHostProper.getProjectCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         link.setChatId(chatId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |