|
|
@@ -32,6 +32,9 @@ import com.fs.his.service.IFsShareMaterialService;
|
|
|
import com.fs.his.service.IFsSignArticleService;
|
|
|
import com.fs.ipad.IpadSendUtils;
|
|
|
import com.fs.ipad.vo.*;
|
|
|
+import com.fs.notion.dto.NotionPageRequest;
|
|
|
+import com.fs.notion.dto.NotionPageResponse;
|
|
|
+import com.fs.notion.service.INotionService;
|
|
|
import com.fs.qw.domain.*;
|
|
|
import com.fs.qw.mapper.BindPhoneRedPacketRecordMapper;
|
|
|
import com.fs.qw.mapper.QwCompanyMapper;
|
|
|
@@ -70,6 +73,7 @@ import java.util.regex.Pattern;
|
|
|
@Service
|
|
|
@AllArgsConstructor
|
|
|
public class IpadSendServer {
|
|
|
+ private static final String notionLink = "https://notion.hcdyfa.top/pages_course/videoDetail?logId=";
|
|
|
private static final Pattern LINK_PATTERN = Pattern.compile("link=([^&]+)");
|
|
|
private final QwUserMapper qwUserMapper;
|
|
|
private final IQwUserService qwUserService;
|
|
|
@@ -113,6 +117,9 @@ public class IpadSendServer {
|
|
|
@Autowired
|
|
|
private QwCompanyMapper qwCompanyMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private INotionService notionService;
|
|
|
+
|
|
|
//销售的个人飞书应用账户缓存的key
|
|
|
private static final String FEISHU_COMPANY_USER_KEY = "feishu:account_company_user:";
|
|
|
|
|
|
@@ -338,11 +345,7 @@ public class IpadSendServer {
|
|
|
// 新飞书逻辑
|
|
|
completeFeishuCourseLink(vo, content,qwSopLogs, externalId,qwUserId);
|
|
|
} else if ("19".equals(content.getContentType())){
|
|
|
- String linkUrl = content.getLinkUrl();
|
|
|
- if (linkUrl == null || StringUtils.isEmpty(linkUrl)) {
|
|
|
- linkUrl = redisCache.getCacheObject("notion_course:"+content.getVideoId()+"_"+externalId+"_"+qwUserId);
|
|
|
- content.setLinkUrl(linkUrl);
|
|
|
- }
|
|
|
+ completeNotionCourseLink(vo, content,qwSopLogs, externalId,qwUserId);
|
|
|
}
|
|
|
// 文本
|
|
|
LinkVo linkVo = LinkVo.builder()
|
|
|
@@ -360,6 +363,20 @@ public class IpadSendServer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void completeNotionCourseLink(BaseVo vo, QwSopCourseFinishTempSetting.Setting content,QwSopLogs qwSopLogs,Long externalId,Long qwUserId) {
|
|
|
+ String linkUrl = content.getLinkUrl();
|
|
|
+ if (StringUtils.isEmpty(linkUrl)) {
|
|
|
+ Long logId = fsCourseWatchLogMapper.selectFsCourseWatchLogIdByVideoIdAndExternalIdAndQwUserId(content.getVideoId(), externalId, String.valueOf(qwUserId));
|
|
|
+ NotionPageRequest request = new NotionPageRequest();
|
|
|
+ request.setTitle(content.getLinkDescribe());
|
|
|
+ request.setIframeUrl(notionLink + logId);
|
|
|
+ NotionPageResponse page = notionService.createPage(request);
|
|
|
+ content.setLinkUrl(page.getPublicUrl());
|
|
|
+ redisCache.setCacheObject("notion_course:"+content.getVideoId()+"_"+externalId+"_"+qwUserId,content.getLinkUrl(),3,TimeUnit.DAYS);
|
|
|
+ qwSopLogsService.updateLinkUrlInContentJson(qwSopLogs, page.getPublicUrl());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 完善飞书课程链接
|
|
|
* */
|
|
|
@@ -811,6 +828,7 @@ public class IpadSendServer {
|
|
|
case "8":
|
|
|
// 语音
|
|
|
sendWxVideo(vo, content);
|
|
|
+
|
|
|
break;
|
|
|
case "14":
|
|
|
log.info("===============进入授权手机号红包=============");
|