|
|
@@ -2354,7 +2354,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
Date createTime = DateUtils.getNowDate();
|
|
|
Long externalUserId = param.getExternalUserId();
|
|
|
Long videoId = param.getVideoId();
|
|
|
- Long companyId = qwCompany.getId();
|
|
|
+ Long companyId = qwUser.getCompanyId();
|
|
|
Long companyUserId = qwUser.getCompanyUserId();
|
|
|
|
|
|
addWatchLogIfNeeded(param.getVideoId(), param.getCourseId(),param.getFsUserId(),qwUser , param.getExternalUserId());
|
|
|
@@ -3858,65 +3858,6 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
|
|
|
return R.ok().put("data",news);
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public R createRoomLinkByFeishu(FsCourseLinkMiniParam param, Long companyUserId) {
|
|
|
- String json = configService.selectConfigByKey("course.config");
|
|
|
- CourseConfig config = JSON.parseObject(json, CourseConfig.class);
|
|
|
-
|
|
|
- QwUser qwUser = qwExternalContactService.getQwUserByRedis(param.getCorpId().trim(), param.getQwUserId().trim());
|
|
|
-
|
|
|
- if (qwUser==null||qwUser.getCompanyId()==null||qwUser.getCompanyUserId()==null){
|
|
|
- return R.error("员工未绑定 销售公司 或 销售 请先绑定");
|
|
|
- }
|
|
|
-
|
|
|
- QwCompany qwCompany = iQwCompanyService.getQwCompanyByRedis(param.getCorpId());
|
|
|
-
|
|
|
- if (qwCompany == null ) {
|
|
|
- return R.error().put("msg","企业不存在,请联系管理员");
|
|
|
- }
|
|
|
- String corpId = param.getCorpId();
|
|
|
- Long courseId = param.getCourseId();
|
|
|
- //qw_user表的主键id
|
|
|
- Long qwUserId = qwUser.getId();
|
|
|
- Date createTime = DateUtils.getNowDate();
|
|
|
- Long externalUserId = param.getExternalUserId();
|
|
|
- Long videoId = param.getVideoId();
|
|
|
- Long companyId = qwCompany.getId();
|
|
|
-
|
|
|
- if (videoId == null) {
|
|
|
- log.error("飞书链接生成失败:视频ID为空");
|
|
|
- return R.error().put("msg","飞书链接生成失败:视频ID为空");
|
|
|
- }
|
|
|
-
|
|
|
- //2.创建课程短链
|
|
|
- Map<String, String> feishuH5Link = createFeishuH5Link(param.getCorpId(), createTime, courseId.intValue(), videoId.intValue(), String.valueOf(qwUserId), companyUserId, companyId, externalUserId, config);
|
|
|
- //获取生成的课程短链码
|
|
|
- String shortCode = feishuH5Link.get("link");
|
|
|
-
|
|
|
- //3.调用生成飞书注册授权链接
|
|
|
- String feishuLink = feiShuService.getFeishuRegisterLink(videoId, companyId, courseId, companyUserId,shortCode);
|
|
|
-
|
|
|
- if (StringUtils.isEmpty(feishuLink)) {
|
|
|
- throw new CustomException("生成飞书注册链接失败");
|
|
|
- }
|
|
|
- JSONObject news = new JSONObject(true);
|
|
|
- // 获取配置的小程序id
|
|
|
- QwAppMiniProgramRelation qwAppMiniProgramRelation = qwAppMiniProgramRelationMapper.selectQwAppMiniProgramRelationByAgentIdAndCorpId(param.getAppAgentId(), param.getCorpId());
|
|
|
- if (qwAppMiniProgramRelation == null){
|
|
|
- log.error("createRoomLinkByFeishu()未找到侧边栏配置的小程序,appAgentId:{},corpId:{}", param.getAppAgentId(), param.getCorpId());
|
|
|
- news.put("miniprogramAppid", qwCompany.getMiniAppId());
|
|
|
- }else{
|
|
|
- news.put("miniprogramAppid", qwAppMiniProgramRelation.getMiniAppId());
|
|
|
- }
|
|
|
- news.put("miniprogramTitle", param.getTitle());
|
|
|
- news.put("miniprogramPicUrl", config.getSidebarImageUrl());
|
|
|
- news.put("miniprogramPage", feishuLink);
|
|
|
-
|
|
|
- return R.ok().put("data",news);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 生成课程链接
|
|
|
* */
|