|
|
@@ -1782,29 +1782,28 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
|
|
|
switch (setting.getContentType()) {
|
|
|
|
|
|
-// case "18" :
|
|
|
-// FsUserCourseVideo video = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
|
|
|
-// //飞书看课链接
|
|
|
-// Long companyIdLong = Long.parseLong(companyId);
|
|
|
-// Long companyUserIdLong = Long.parseLong(companyUserId);
|
|
|
-// long externalIdLong = Long.parseLong(externalId);
|
|
|
-//
|
|
|
-//
|
|
|
-// String key = "fei_shu_doc_id:" + externalIdLong + "_" + videoId;
|
|
|
-// String feiShuDocId = redisCache.getCacheObject(key);
|
|
|
-// if (org.apache.commons.lang3.StringUtils.isBlank(feiShuDocId)) {
|
|
|
-// feiShuDocId = getFeiShuDocId(video, companyIdLong, companyUserIdLong);
|
|
|
-// if (org.apache.commons.lang3.StringUtils.isNotBlank(feiShuDocId)) {
|
|
|
-// redisCache.setCacheObject("fei_shu_doc_id:" + externalIdLong + "_" + video.getVideoId(), feiShuDocId,2,TimeUnit.DAYS);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// break;
|
|
|
+ case "18" :
|
|
|
+ FsUserCourseVideo video = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
|
|
|
+ //飞书看课链接
|
|
|
+ Long companyIdLong = Long.parseLong(companyId);
|
|
|
+ Long companyUserIdLong = Long.parseLong(companyUserId);
|
|
|
+ long externalIdLong = Long.parseLong(externalId);
|
|
|
+
|
|
|
+
|
|
|
+ String key = "fei_shu_doc_id:" + externalIdLong + "_" + videoId;
|
|
|
+ String feiShuDocId = redisCache.getCacheObject(key);
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(feiShuDocId)) {
|
|
|
+ feiShuDocId = getFeiShuDocId(video, companyIdLong, companyUserIdLong);
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotBlank(feiShuDocId)) {
|
|
|
+ redisCache.setCacheObject("fei_shu_doc_id:" + externalIdLong + "_" + video.getVideoId(), feiShuDocId,2,TimeUnit.DAYS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
case "19" :
|
|
|
log.info("生成notion看课记录参数:sopId:{},videoId:{},senTime:{},startTime:{}",sopLogs.getSopId(),videoId,sopLogs.getSendTime(),logVo.getStartTime());
|
|
|
Long notionWatchLogId = addNotionWatchLog(sopLogs.getSopId(), videoId, courseId,
|
|
|
sopLogs.getFsUserId(), qwUserId, companyUserId, companyId,
|
|
|
Long.valueOf(externalId), sopLogs.getSendTime(), logVo.getStartTime());
|
|
|
- log.info("看课记录id:{}",notionWatchLogId);
|
|
|
//2.创建课程短链
|
|
|
createNotionLinkByMiniApp(setting, sopLogs.getCorpId(), sendTime, courseId, videoId,
|
|
|
qwUserId, companyUserId, companyId, Long.valueOf(externalId), cachedCourseConfig);
|
|
|
@@ -1812,7 +1811,6 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
request.setTitle(setting.getLinkDescribe());
|
|
|
request.setIframeUrl(notionLink + notionWatchLogId);
|
|
|
NotionPageResponse page = notionService.createPage(request);
|
|
|
- log.info("notion页面数据:{}",page.toString());
|
|
|
redisCache.setCacheObject("notion_course:"+videoId+"_"+externalId+"_"+qwUserId,page.getPublicUrl(),3,TimeUnit.DAYS);
|
|
|
break;
|
|
|
default:
|
|
|
@@ -1884,7 +1882,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
Client client = buildClient(account);
|
|
|
try {
|
|
|
String docId = docApiService.createDocument(client, video.getTitle() + "-注册");
|
|
|
- redisCache.setCacheObject("fei_shu_client:" + docId, account,1,TimeUnit.DAYS);
|
|
|
+ redisCache.setCacheObject("fei_shu_client:" + docId, account,2,TimeUnit.DAYS);
|
|
|
return docId;
|
|
|
|
|
|
} catch (CustomException e) {
|
|
|
@@ -3250,7 +3248,6 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
watchLog.setLogType(3);
|
|
|
watchLog.setUserId(fsUserId);
|
|
|
watchLog.setCampPeriodTime(convertStringToDate(createTime,"yyyy-MM-dd"));
|
|
|
- log.info("生成看课记录watchLog:{}",watchLog);
|
|
|
//存看课记录
|
|
|
fsCourseWatchLogMapper.insertOrUpdateFsCourseWatchLog(watchLog);
|
|
|
return watchLog.getLogId();
|