|
@@ -98,6 +98,8 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
private static final String appActivitlLink = "/pages_course/activity.html?link=";
|
|
private static final String appActivitlLink = "/pages_course/activity.html?link=";
|
|
|
private static final String appLink = "https://jump.ylrztop.com/jumpapp/pages/index/index?link=";
|
|
private static final String appLink = "https://jump.ylrztop.com/jumpapp/pages/index/index?link=";
|
|
|
private static final String registeredRealLink = "/pages_course/register.html?link=";
|
|
private static final String registeredRealLink = "/pages_course/register.html?link=";
|
|
|
|
|
+ private static final String h5LiveShortLink = "/pages_course/livingInvite.html?s=";
|
|
|
|
|
+ private static final String h5miniappLink = "/pages_course/shortLink.html?s=";
|
|
|
// private static final String miniappRealLink = "/pages/index/index?course=";
|
|
// private static final String miniappRealLink = "/pages/index/index?course=";
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -578,6 +580,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
if (vo == null) return null;
|
|
if (vo == null) return null;
|
|
|
QwSopLogs sopLogs = new QwSopLogs();
|
|
QwSopLogs sopLogs = new QwSopLogs();
|
|
|
|
|
|
|
|
|
|
+ String qwUserId = qwUser.getQwUserId();
|
|
|
sopLogs.setQwUserid(qwUser.getQwUserId());
|
|
sopLogs.setQwUserid(qwUser.getQwUserId());
|
|
|
sopLogs.setExternalUserId(vo.getExternalUserId());
|
|
sopLogs.setExternalUserId(vo.getExternalUserId());
|
|
|
sopLogs.setLogType(2);
|
|
sopLogs.setLogType(2);
|
|
@@ -803,6 +806,49 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
createVoiceUrl(st, companyUserId, qwSop);
|
|
createVoiceUrl(st, companyUserId, qwSop);
|
|
|
sopLogs.setAppSendStatus(0);
|
|
sopLogs.setAppSendStatus(0);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "17": //h5看课
|
|
|
|
|
+ try {
|
|
|
|
|
+ addWatchLogIfNeeded(param.getSopId(), param.getVideoId(), param.getCourseId(), Long.valueOf(groupUser.getFsUserId()), qwUserId, companyUserId, companyId, groupUser.getId(), param.getStartTime(), createTime,2);
|
|
|
|
|
+
|
|
|
|
|
+ String sroth5link = createH5LinkByMiniApp(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
|
|
|
|
|
+ qwUserId, companyUserId, companyId, groupUser.getId(), config);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ miniAppId = null;
|
|
|
|
|
+ if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
|
|
|
+ Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
|
|
|
|
|
+ if (integerListMap != null) {
|
|
|
|
|
+ int listIndexTemp = 1;
|
|
|
|
|
+ List<CompanyMiniapp> miniapps = integerListMap.get(listIndexTemp);
|
|
|
|
|
+ if (miniapps != null && !miniapps.isEmpty()) {
|
|
|
|
|
+ CompanyMiniapp companyMiniapp = miniapps.get(0);
|
|
|
|
|
+ if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
|
|
|
|
|
+ miniAppId = companyMiniapp.getAppId();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtil.strIsNullOrEmpty(miniAppId) && !StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
|
|
|
|
|
+ miniAppId = qwCompany.getMiniAppId();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(miniAppId)) {
|
|
|
|
|
+ st.setMiniprogramAppid(miniAppId);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.error("公司的小程序id为空:采用了前端传的固定值" + sopLogs.getSopId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ st.setMiniprogramTitle("邀请链接");
|
|
|
|
|
+ st.setMiniprogramPage(sroth5link);
|
|
|
|
|
+
|
|
|
|
|
+ st.setMiniprogramPicUrl(StringUtil.strIsNullOrEmpty(st.getMiniprogramPicUrl()) ? "https://cos.his.cdwjyyh.com/fs/20250331/ec2b4e73be8048afbd526124a655ad56.png" : st.getMiniprogramPicUrl());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("浏览器看课模板解析失败:" + e);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
//群公告
|
|
//群公告
|
|
|
case "11":
|
|
case "11":
|
|
|
sopLogs.setSendType(21); // 设置为群公告类型
|
|
sopLogs.setSendType(21); // 设置为群公告类型
|
|
@@ -831,6 +877,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
}
|
|
}
|
|
|
QwSopLogs sopLogs = new QwSopLogs();
|
|
QwSopLogs sopLogs = new QwSopLogs();
|
|
|
|
|
|
|
|
|
|
+ String qwUserId = qwUser.getQwUserId();
|
|
|
sopLogs.setQwUserid(qwUser.getQwUserId());
|
|
sopLogs.setQwUserid(qwUser.getQwUserId());
|
|
|
sopLogs.setExternalUserId(groupChat.getChatId());
|
|
sopLogs.setExternalUserId(groupChat.getChatId());
|
|
|
sopLogs.setLogType(2);
|
|
sopLogs.setLogType(2);
|
|
@@ -1454,6 +1501,50 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
|
sopLogs.setAppSendStatus(0);
|
|
sopLogs.setAppSendStatus(0);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "17":
|
|
|
|
|
+ try {
|
|
|
|
|
+ addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), qwUserId, companyUserId, companyId, item.getExternalId(),item.getStartTime(),createTime,2 );
|
|
|
|
|
+
|
|
|
|
|
+ String sroth5link = createH5LinkByMiniApp(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
|
|
|
|
|
+ qwUserId, companyUserId, companyId, item.getExternalId(), config);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ miniAppId = null;
|
|
|
|
|
+ if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
|
|
|
+ Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
|
|
|
|
|
+ if (integerListMap != null) {
|
|
|
|
|
+ int listIndexTemp = 1;
|
|
|
|
|
+ List<CompanyMiniapp> miniapps = integerListMap.get(listIndexTemp);
|
|
|
|
|
+ if (miniapps != null && !miniapps.isEmpty()) {
|
|
|
|
|
+ CompanyMiniapp companyMiniapp = miniapps.get(0);
|
|
|
|
|
+ if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
|
|
|
|
|
+ miniAppId = companyMiniapp.getAppId();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtil.strIsNullOrEmpty(miniAppId) && !StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
|
|
|
|
|
+ miniAppId = qwCompany.getMiniAppId();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(miniAppId)) {
|
|
|
|
|
+ st.setMiniprogramAppid(miniAppId);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.error("公司的小程序id为空:采用了前端传的固定值" + sopLogs.getSopId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ st.setMiniprogramTitle("邀请链接");
|
|
|
|
|
+ st.setMiniprogramPage(sroth5link);
|
|
|
|
|
+
|
|
|
|
|
+ st.setMiniprogramPicUrl(StringUtil.strIsNullOrEmpty(st.getMiniprogramPicUrl()) ? "https://cos.his.cdwjyyh.com/fs/20250331/ec2b4e73be8048afbd526124a655ad56.png" : st.getMiniprogramPicUrl());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("浏览器看课模板解析失败:" + e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
break;
|
|
break;
|
|
|
//群公告(仅用于一键群发,个人不应该有群公告)
|
|
//群公告(仅用于一键群发,个人不应该有群公告)
|
|
|
case "11":
|
|
case "11":
|
|
@@ -2076,6 +2167,79 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
|
|
|
|
|
st.setMiniprogramPage(linkByMiniApp);
|
|
st.setMiniprogramPage(linkByMiniApp);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "17": //h5看课
|
|
|
|
|
+ try {
|
|
|
|
|
+ addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(), item.getFsUserId(), String.valueOf(qwUser.getId()), companyUserId, companyId,
|
|
|
|
|
+ item.getExternalId(), item.getStartTime(), dataTime,2);
|
|
|
|
|
+ String sroth5link = createH5LinkByMiniApp(st, param.getCorpId(), dataTime, param.getCourseId(), param.getVideoId(),
|
|
|
|
|
+ String.valueOf(qwUser.getId()), companyUserId, companyId, item.getExternalId(), config);
|
|
|
|
|
+
|
|
|
|
|
+ miniAppId = null;
|
|
|
|
|
+ if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
|
|
|
+ Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
|
|
|
|
|
+ if (integerListMap != null) {
|
|
|
|
|
+ int listIndexTemp = 1;
|
|
|
|
|
+ List<CompanyMiniapp> miniapps = integerListMap.get(listIndexTemp);
|
|
|
|
|
+ if (miniapps != null && !miniapps.isEmpty()) {
|
|
|
|
|
+ CompanyMiniapp companyMiniapp = miniapps.get(0);
|
|
|
|
|
+ if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
|
|
|
|
|
+ miniAppId = companyMiniapp.getAppId();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtil.strIsNullOrEmpty(miniAppId) && !StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
|
|
|
|
|
+ miniAppId = qwCompany.getMiniAppId();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(miniAppId)) {
|
|
|
|
|
+ st.setMiniprogramAppid(miniAppId);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.error("公司的小程序id为空:采用了前端传的固定值" + sopLogs.getSopId());
|
|
|
|
|
+ }
|
|
|
|
|
+ st.setMiniprogramTitle("邀请链接");
|
|
|
|
|
+ st.setMiniprogramPage(sroth5link);
|
|
|
|
|
+
|
|
|
|
|
+ st.setMiniprogramPicUrl(StringUtil.strIsNullOrEmpty(st.getMiniprogramPicUrl()) ? "https://cos.his.cdwjyyh.com/fs/20250331/ec2b4e73be8048afbd526124a655ad56.png" : st.getMiniprogramPicUrl());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("浏览器看课模板解析失败:" + e);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ //直播h5跳转卡片
|
|
|
|
|
+ case "18":
|
|
|
|
|
+ //直播h5跳转短链
|
|
|
|
|
+ case "19":
|
|
|
|
|
+ sopLogs.setSendType(Integer.valueOf(st.getContentType()));
|
|
|
|
|
+ Long qwUserId = qwUser.getId();
|
|
|
|
|
+ String corpId = param.getCorpId();
|
|
|
|
|
+ String shortH5Link = createH5LiveShortLink(st, corpId,
|
|
|
|
|
+ qwUserId, companyUserId, companyId);
|
|
|
|
|
+
|
|
|
|
|
+ miniprogramLiveTitle = st.getMiniprogramTitle();
|
|
|
|
|
+ maxLiveLength = 17;
|
|
|
|
|
+ st.setMiniprogramTitle(miniprogramLiveTitle.length() > maxLiveLength ? miniprogramLiveTitle.substring(0, maxLiveLength) + "..." : miniprogramLiveTitle);
|
|
|
|
|
+
|
|
|
|
|
+ json = configService.selectConfigByKey("his.config");
|
|
|
|
|
+ sysConfig= JSON.parseObject(json,FSSysConfig.class);
|
|
|
|
|
+ //todo 发个人看课记录处理
|
|
|
|
|
+ try {
|
|
|
|
|
+ createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),item.getExternalId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, String.valueOf(qwUser.getId()),param.getCorpId());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("群聊创建直播看课记录失败!", e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ st.setMiniprogramAppid(sysConfig.getAppId());
|
|
|
|
|
+ st.setMiniprogramPage(shortH5Link);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ st.setMiniprogramPicUrl(StringUtil.strIsNullOrEmpty(st.getMiniprogramPicUrl()) ? "https://cos.his.cdwjyyh.com/fs/20250331/ec2b4e73be8048afbd526124a655ad56.png" : st.getMiniprogramPicUrl());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("赋值-小程序封面地址失败-" + e);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
@@ -2086,6 +2250,85 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 创建看课短链
|
|
|
|
|
+ * @param setting
|
|
|
|
|
+ * @param corpId
|
|
|
|
|
+ * @param sendTime
|
|
|
|
|
+ * @param courseId
|
|
|
|
|
+ * @param videoId
|
|
|
|
|
+ * @param qwUserId
|
|
|
|
|
+ * @param companyUserId
|
|
|
|
|
+ * @param companyId
|
|
|
|
|
+ * @param externalId
|
|
|
|
|
+ * @param config
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ String createH5LinkByMiniApp(QwSopCourseFinishTempSetting.Setting setting, String corpId, Date sendTime,
|
|
|
|
|
+ Integer courseId, Integer videoId, String qwUserId,
|
|
|
|
|
+ String companyUserId, String companyId, Long externalId, CourseConfig config) {
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseLink link = createFsCourseLink(corpId, sendTime, courseId, videoId, Long.valueOf(qwUserId),
|
|
|
|
|
+ companyUserId, companyId, externalId, 3, null);
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseRealLink courseMap = new FsCourseRealLink();
|
|
|
|
|
+ BeanUtils.copyProperties(link, courseMap);
|
|
|
|
|
+
|
|
|
|
|
+ String courseJson = JSON.toJSONString(courseMap);
|
|
|
|
|
+ String realLinkFull = h5miniappLink + courseJson;
|
|
|
|
|
+ link.setRealLink(realLinkFull);
|
|
|
|
|
+
|
|
|
|
|
+ Date updateTime = createUpdateTime(setting, sendTime, config);
|
|
|
|
|
+
|
|
|
|
|
+ link.setUpdateTime(updateTime);
|
|
|
|
|
+ //存短链-
|
|
|
|
|
+ fsCourseLinkMapper.insertFsCourseLink(link);
|
|
|
|
|
+ return link.getRealLink();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 创建直播短链
|
|
|
|
|
+ * @param setting
|
|
|
|
|
+ * @param corpId
|
|
|
|
|
+ * @param qwUserId
|
|
|
|
|
+ * @param companyUserId
|
|
|
|
|
+ * @param companyId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private String createH5LiveShortLink(QwSopCourseFinishTempSetting.Setting setting, String corpId, Long qwUserId, String companyUserId, String companyId) {
|
|
|
|
|
+
|
|
|
|
|
+ // 手动创建 FsCourseLink 对象,避免使用 BeanUtils.copyProperties
|
|
|
|
|
+ FsCourseLink link = new FsCourseLink();
|
|
|
|
|
+ link.setCompanyId(Long.parseLong(companyId));
|
|
|
|
|
+ link.setQwUserId(Long.valueOf(qwUserId));
|
|
|
|
|
+ link.setCompanyUserId(Long.parseLong(companyUserId));
|
|
|
|
|
+ link.setLiveId(Long.valueOf(setting.getLiveId()));
|
|
|
|
|
+ link.setCorpId(corpId);
|
|
|
|
|
+ link.setUNo(UUID.randomUUID().toString());
|
|
|
|
|
+
|
|
|
|
|
+ String randomString = generateRandomStringWithLock();
|
|
|
|
|
+ if (StringUtil.strIsNullOrEmpty(randomString)) {
|
|
|
|
|
+ link.setLink(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ link.setLink(randomString);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseRealLink courseMap = new FsCourseRealLink();
|
|
|
|
|
+ BeanUtils.copyProperties(link, courseMap);
|
|
|
|
|
+
|
|
|
|
|
+ String courseJson = JSON.toJSONString(link);
|
|
|
|
|
+ String realLinkFull = h5LiveShortLink + courseJson;
|
|
|
|
|
+ link.setRealLink(realLinkFull);
|
|
|
|
|
+
|
|
|
|
|
+ //存短链-
|
|
|
|
|
+ fsCourseLinkMapper.insertFsCourseLink(link);
|
|
|
|
|
+
|
|
|
|
|
+ return link.getRealLink();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public String createActivityLinkByMiniApp(QwSopCourseFinishTempSetting.Setting st, QwSopLogs sopLogs, String corpId, Date sendTime, Integer courseId, Integer videoId, String qwUserId, String companyUserId, String companyId, Long externalId, CourseConfig config, String chatId) {
|
|
public String createActivityLinkByMiniApp(QwSopCourseFinishTempSetting.Setting st, QwSopLogs sopLogs, String corpId, Date sendTime, Integer courseId, Integer videoId, String qwUserId, String companyUserId, String companyId, Long externalId, CourseConfig config, String chatId) {
|
|
|
FsCourseLink link = createFsCourseLink(corpId, sendTime, courseId, videoId, Long.valueOf(qwUserId),
|
|
FsCourseLink link = createFsCourseLink(corpId, sendTime, courseId, videoId, Long.valueOf(qwUserId),
|
|
|
companyUserId, companyId, null, 3, chatId);
|
|
companyUserId, companyId, null, 3, chatId);
|