|
|
@@ -99,6 +99,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
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 h5LiveShortLink = "/pages_course/livingInvite.html?s=";
|
|
|
+ private static final String appLiveShortLink = "/pages_live/livingList?link=";
|
|
|
private static final String h5miniappLink = "/pages_course/shortLink.html?s=";
|
|
|
// private static final String miniappRealLink = "/pages/index/index?course=";
|
|
|
|
|
|
@@ -381,64 +382,64 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
|
|
|
try {
|
|
|
|
|
|
- //用于查询
|
|
|
- SopUserLogs userLogs=new SopUserLogs();
|
|
|
- userLogs.setSopId(param.getSopId());
|
|
|
- userLogs.setQwUserId(param.getQwUserId());
|
|
|
- userLogs.setCorpId(param.getCorpId());
|
|
|
- userLogs.setStatus(1);
|
|
|
- userLogs.setStartTime(param.getParamTime());
|
|
|
-
|
|
|
- String unionSopStartId = sopUserLogsService.selectSopUserLogsByUpdate(userLogs);
|
|
|
-
|
|
|
- BatchSopUserLogsInfoParamU infoParamU=new BatchSopUserLogsInfoParamU();
|
|
|
- infoParamU.setIds(param.getIds());
|
|
|
- //查询sop任务开始时间营期表 是否有这个营期
|
|
|
- if (!StringUtil.strIsNullOrEmpty(unionSopStartId)){
|
|
|
- infoParamU.setUserLogsId(unionSopStartId);
|
|
|
+ //用于查询
|
|
|
+ SopUserLogs userLogs=new SopUserLogs();
|
|
|
+ userLogs.setSopId(param.getSopId());
|
|
|
+ userLogs.setQwUserId(param.getQwUserId());
|
|
|
+ userLogs.setCorpId(param.getCorpId());
|
|
|
+ userLogs.setStatus(1);
|
|
|
+ userLogs.setStartTime(param.getParamTime());
|
|
|
+
|
|
|
+ String unionSopStartId = sopUserLogsService.selectSopUserLogsByUpdate(userLogs);
|
|
|
+
|
|
|
+ BatchSopUserLogsInfoParamU infoParamU=new BatchSopUserLogsInfoParamU();
|
|
|
+ infoParamU.setIds(param.getIds());
|
|
|
+ //查询sop任务开始时间营期表 是否有这个营期
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(unionSopStartId)){
|
|
|
+ infoParamU.setUserLogsId(unionSopStartId);
|
|
|
+ if (param.getIds().length>0){
|
|
|
+ batchUpdateSopUserLogsInfoToTime(infoParamU);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ //如果查不出来营期 ,则新建营期
|
|
|
+ //查询sop的模板id
|
|
|
+ QwSop qwSop = qwSopService.selectQwSopById(param.getSopId());
|
|
|
+
|
|
|
+ //查询这个sop任务的员工的信息
|
|
|
+ QwUser qwUser = qwUserMapper.selectQwUserByQwUseridAndCorpId(param.getQwUserId(), param.getCorpId());
|
|
|
+
|
|
|
+ SopUserLogsParamByDate userLogsParamByDate = new SopUserLogsParamByDate();
|
|
|
+ userLogsParamByDate.setSopId(param.getSopId());
|
|
|
+ userLogsParamByDate.setSopTempId(qwSop.getTempId());
|
|
|
+ userLogsParamByDate.setQwUserId(param.getQwUserId());
|
|
|
+ userLogsParamByDate.setCorpId(param.getCorpId());
|
|
|
+ userLogsParamByDate.setStartTime(param.getParamTime());
|
|
|
+ userLogsParamByDate.setStatus(1);
|
|
|
+ userLogsParamByDate.setUserId(qwUser.getId()+"|"+qwUser.getCompanyUserId()+"|"+qwUser.getCompanyId());
|
|
|
+
|
|
|
+ //如果没有这个营期没有就先插入
|
|
|
+ int i1 = sopUserLogsService.insertSopUserLogsByDate(userLogsParamByDate);
|
|
|
+ if (i1>0){
|
|
|
+ userLogs.setSopTempId(qwSop.getTempId());
|
|
|
+ //获取新的
|
|
|
+ String unionSopStartIdNew = sopUserLogsService.selectSopUserLogsByUnionSopId(userLogs);
|
|
|
+ infoParamU.setUserLogsId(unionSopStartIdNew);
|
|
|
+
|
|
|
if (param.getIds().length>0){
|
|
|
batchUpdateSopUserLogsInfoToTime(infoParamU);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- else {
|
|
|
- //如果查不出来营期 ,则新建营期
|
|
|
- //查询sop的模板id
|
|
|
- QwSop qwSop = qwSopService.selectQwSopById(param.getSopId());
|
|
|
-
|
|
|
- //查询这个sop任务的员工的信息
|
|
|
- QwUser qwUser = qwUserMapper.selectQwUserByQwUseridAndCorpId(param.getQwUserId(), param.getCorpId());
|
|
|
-
|
|
|
- SopUserLogsParamByDate userLogsParamByDate = new SopUserLogsParamByDate();
|
|
|
- userLogsParamByDate.setSopId(param.getSopId());
|
|
|
- userLogsParamByDate.setSopTempId(qwSop.getTempId());
|
|
|
- userLogsParamByDate.setQwUserId(param.getQwUserId());
|
|
|
- userLogsParamByDate.setCorpId(param.getCorpId());
|
|
|
- userLogsParamByDate.setStartTime(param.getParamTime());
|
|
|
- userLogsParamByDate.setStatus(1);
|
|
|
- userLogsParamByDate.setUserId(qwUser.getId()+"|"+qwUser.getCompanyUserId()+"|"+qwUser.getCompanyId());
|
|
|
-
|
|
|
- //如果没有这个营期没有就先插入
|
|
|
- int i1 = sopUserLogsService.insertSopUserLogsByDate(userLogsParamByDate);
|
|
|
- if (i1>0){
|
|
|
- userLogs.setSopTempId(qwSop.getTempId());
|
|
|
- //获取新的
|
|
|
- String unionSopStartIdNew = sopUserLogsService.selectSopUserLogsByUnionSopId(userLogs);
|
|
|
- infoParamU.setUserLogsId(unionSopStartIdNew);
|
|
|
-
|
|
|
- if (param.getIds().length>0){
|
|
|
- batchUpdateSopUserLogsInfoToTime(infoParamU);
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
- } catch (ConstraintViolationException e) {
|
|
|
- return R.error().put("msg", "修改营期失败:目标营期已经有此客户,请检查客户信息 是否重复,重复请联系超管 删除此营期数据");
|
|
|
- } catch (Exception e) {
|
|
|
- return R.error().put("msg", "修改营期失败:" + e.getMessage());
|
|
|
+ }
|
|
|
+ } catch (ConstraintViolationException e) {
|
|
|
+ return R.error().put("msg", "修改营期失败:目标营期已经有此客户,请检查客户信息 是否重复,重复请联系超管 删除此营期数据");
|
|
|
+ } catch (Exception e) {
|
|
|
+ return R.error().put("msg", "修改营期失败:" + e.getMessage());
|
|
|
}
|
|
|
|
|
|
return R.ok();
|
|
|
@@ -746,7 +747,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
// miniAppId = String.valueOf(luckyBagConfig.get("appId"));
|
|
|
|
|
|
|
|
|
- if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
|
+ if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
|
Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
|
|
|
if (integerListMap != null) {
|
|
|
int listIndexNum = 1;
|
|
|
@@ -856,6 +857,51 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
log.error("浏览器看课模板解析失败:" + e);
|
|
|
}
|
|
|
break;
|
|
|
+ //跳转app看课
|
|
|
+ case "23":
|
|
|
+ try {
|
|
|
+ //生成看课记录
|
|
|
+ addWatchLogIfNeeded(
|
|
|
+ param.getSopId(),
|
|
|
+ param.getVideoId(), param.getCourseId(),
|
|
|
+ Long.valueOf(groupUser.getFsUserId()), qwUserId,
|
|
|
+ companyUserId, companyId,
|
|
|
+ groupUser.getId(), param.getStartTime(),
|
|
|
+ createTime, 2
|
|
|
+ );
|
|
|
+ //生成看课短链
|
|
|
+ String shortH5link = createH5LinkByMiniAppV2(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
|
|
|
+ String.valueOf(qwUser.getId()), companyUserId, companyId, groupUser.getId(), config);
|
|
|
+ st.setMiniprogramPage(shortH5link);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("跳转app看课模板解析失败:" + e);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //跳转app直播
|
|
|
+ case "24":
|
|
|
+ try{
|
|
|
+ sopLogs.setSendType(20);//直播
|
|
|
+ qwUserId = String.valueOf(qwUser.getId());
|
|
|
+ //生成直播短链
|
|
|
+ String shortH5Link = createH5LiveShortLinkV2(st, param.getCorpId(),
|
|
|
+ qwUser.getId(), companyUserId, companyId);
|
|
|
+ st.setMiniprogramPage(shortH5Link);
|
|
|
+ String json0 = configService.selectConfigByKey("his.config");
|
|
|
+ FSSysConfig sysConfig0 = JSON.parseObject(json0, FSSysConfig.class);
|
|
|
+ //直播观看记录
|
|
|
+ createLiveWatchLogAndInsert(
|
|
|
+ qwUser.getCompanyId().toString(),
|
|
|
+ qwUser.getCompanyUserId().toString(),
|
|
|
+ groupUser.getId().toString(),
|
|
|
+ Long.valueOf(st.getLiveId()),
|
|
|
+ sysConfig0.getAppId(),
|
|
|
+ 2,
|
|
|
+ String.valueOf(qwUser.getId()),
|
|
|
+ param.getCorpId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("跳转app直播模板解析失败:" + e);
|
|
|
+ }
|
|
|
+ break;
|
|
|
//群公告
|
|
|
case "11":
|
|
|
sopLogs.setSendType(21); // 设置为群公告类型
|
|
|
@@ -1043,7 +1089,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
// String luckyjson = configService.selectConfigByKey("luckyBag.config");
|
|
|
// Map<String, Object> luckyBagConfig = JSON.parseObject(luckyjson, Map.class);
|
|
|
// miniAppId = String.valueOf(luckyBagConfig.get("appId"));
|
|
|
- if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
|
+ if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
|
Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
|
|
|
if (integerListMap != null) {
|
|
|
int listIndexNum = 1;
|
|
|
@@ -1193,9 +1239,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
sopLogs.setSort(30000000);
|
|
|
sopLogs.setSendType(5);
|
|
|
sopLogs.setExternalUserName(item.getExternalUserName());
|
|
|
- if(sendLiveMsgFinal){
|
|
|
- sopLogs.setSendType(20);
|
|
|
- }
|
|
|
+ if(sendLiveMsgFinal){
|
|
|
+ sopLogs.setSendType(20);
|
|
|
+ }
|
|
|
|
|
|
Long msgNum = Long.valueOf(generateRandomNumberWithLock());
|
|
|
sopLogs.setSmsLogsId(msgNum);
|
|
|
@@ -1252,15 +1298,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
// log.warn("生成短链失败,跳过设置 URL。");
|
|
|
// }
|
|
|
// }else {
|
|
|
- if ("1".equals(st.getContentType())) {
|
|
|
- String defaultName = "同学";
|
|
|
- if(contact != null && StringUtils.isNotEmpty(contact.getName()) && !"待同步客户".equals(contact.getName())){
|
|
|
- defaultName = contact.getName();
|
|
|
- }
|
|
|
- st.setValue(st.getValue()
|
|
|
- .replaceAll("#销售称呼#",StringUtil.strIsNullOrEmpty(qwUser.getWelcomeText())?"":qwUser.getWelcomeText())
|
|
|
- .replaceAll("#客户称呼#",contact == null || StringUtil.strIsNullOrEmpty(contact.getStageStatus()) || "0".equals(contact.getStageStatus())?defaultName:contact.getStageStatus()));
|
|
|
+ if ("1".equals(st.getContentType())) {
|
|
|
+ String defaultName = "同学";
|
|
|
+ if(contact != null && StringUtils.isNotEmpty(contact.getName()) && !"待同步客户".equals(contact.getName())){
|
|
|
+ defaultName = contact.getName();
|
|
|
}
|
|
|
+ st.setValue(st.getValue()
|
|
|
+ .replaceAll("#销售称呼#",StringUtil.strIsNullOrEmpty(qwUser.getWelcomeText())?"":qwUser.getWelcomeText())
|
|
|
+ .replaceAll("#客户称呼#",contact == null || StringUtil.strIsNullOrEmpty(contact.getStageStatus()) || "0".equals(contact.getStageStatus())?defaultName:contact.getStageStatus()));
|
|
|
+ }
|
|
|
// }
|
|
|
|
|
|
break;
|
|
|
@@ -1344,7 +1390,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
FSSysConfig sysConfig= JSON.parseObject(js,FSSysConfig.class);
|
|
|
//发个人看课记录处理
|
|
|
try {
|
|
|
- createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),item.getExternalId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUserId,param.getCorpId());
|
|
|
+ createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),item.getExternalId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUserId,param.getCorpId());
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.error("群聊创建直播看课记录失败!", e);
|
|
|
@@ -1600,6 +1646,49 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
sopSmsLogsList.add(sopSmsLogs);
|
|
|
}
|
|
|
break;
|
|
|
+ //跳转app看课
|
|
|
+ case "23":
|
|
|
+ try {
|
|
|
+ //生成看课记录
|
|
|
+ addWatchLogIfNeeded(
|
|
|
+ item.getSopId(),
|
|
|
+ param.getVideoId(), param.getCourseId(),
|
|
|
+ item.getFsUserId(), String.valueOf(qwUser.getId()),
|
|
|
+ companyUserId, companyId,
|
|
|
+ item.getExternalId(), item.getStartTime(),
|
|
|
+ createTime, 2);
|
|
|
+ //生成看课短链
|
|
|
+ String shortH5link = createH5LinkByMiniAppV2(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
|
|
|
+ String.valueOf(qwUser.getId()), companyUserId, companyId, item.getExternalId(), config);
|
|
|
+ st.setMiniprogramPage(shortH5link);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("跳转app看课模板解析失败:" + e);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //跳转app直播
|
|
|
+ case "24":
|
|
|
+ try{
|
|
|
+ sopLogs.setSendType(20);//直播
|
|
|
+ //生成直播短链
|
|
|
+ String shortH5Link = createH5LiveShortLinkV2(st, param.getCorpId(),
|
|
|
+ qwUser.getId(), companyUserId, companyId);
|
|
|
+ st.setMiniprogramPage(shortH5Link);
|
|
|
+ String json1 = configService.selectConfigByKey("his.config");
|
|
|
+ FSSysConfig sysConfig0 = JSON.parseObject(json1, FSSysConfig.class);
|
|
|
+ //直播观看记录
|
|
|
+ createLiveWatchLogAndInsert(
|
|
|
+ qwUser.getCompanyId().toString(),
|
|
|
+ qwUser.getCompanyUserId().toString(),
|
|
|
+ item.getExternalId().toString(),
|
|
|
+ Long.valueOf(st.getLiveId()),
|
|
|
+ sysConfig0.getAppId(),
|
|
|
+ 2,
|
|
|
+ String.valueOf(qwUser.getId()),
|
|
|
+ param.getCorpId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("跳转app直播模板解析失败:" + e);
|
|
|
+ }
|
|
|
+ break;
|
|
|
//群公告(仅用于一键群发,个人不应该有群公告)
|
|
|
case "11":
|
|
|
log.warn("群公告不能发给个人,跳过处理,sopId:{}, externalId:{}", param.getSopId(), item.getExternalId());
|
|
|
@@ -1695,7 +1784,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
param.setIds(ids);
|
|
|
log.info("一键群发操作日志1:{}", JSON.toJSONString(param));
|
|
|
processQwSopLogsBySendMsg(param,param.getDraftStrategy());
|
|
|
- return null;
|
|
|
+ return R.ok();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -2003,15 +2092,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
// log.warn("生成短链失败,跳过设置 URL。");
|
|
|
// }
|
|
|
// }else {
|
|
|
- if ("1".equals(st.getContentType())) {
|
|
|
- String defaultName = "同学";
|
|
|
- if(contact != null && StringUtils.isNotEmpty(contact.getName()) && !"待同步客户".equals(contact.getName())){
|
|
|
- defaultName = contact.getName();
|
|
|
- }
|
|
|
- st.setValue(st.getValue()
|
|
|
- .replaceAll("#销售称呼#",StringUtil.strIsNullOrEmpty(qwUser.getWelcomeText())?"":qwUser.getWelcomeText())
|
|
|
- .replaceAll("#客户称呼#",contact == null || StringUtil.strIsNullOrEmpty(contact.getStageStatus()) || "0".equals(contact.getStageStatus())?defaultName:contact.getStageStatus()));
|
|
|
+ if ("1".equals(st.getContentType())) {
|
|
|
+ String defaultName = "同学";
|
|
|
+ if(contact != null && StringUtils.isNotEmpty(contact.getName()) && !"待同步客户".equals(contact.getName())){
|
|
|
+ defaultName = contact.getName();
|
|
|
}
|
|
|
+ st.setValue(st.getValue()
|
|
|
+ .replaceAll("#销售称呼#",StringUtil.strIsNullOrEmpty(qwUser.getWelcomeText())?"":qwUser.getWelcomeText())
|
|
|
+ .replaceAll("#客户称呼#",contact == null || StringUtil.strIsNullOrEmpty(contact.getStageStatus()) || "0".equals(contact.getStageStatus())?defaultName:contact.getStageStatus()));
|
|
|
+ }
|
|
|
// }
|
|
|
|
|
|
break;
|
|
|
@@ -2359,12 +2448,55 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
sopSmsLogsList.add(sopSmsLogs);
|
|
|
}
|
|
|
break;
|
|
|
+ //跳转app看课
|
|
|
+ case "23":
|
|
|
+ try {
|
|
|
+ //生成看课记录
|
|
|
+ addWatchLogIfNeeded(
|
|
|
+ item.getSopId(),
|
|
|
+ param.getVideoId(), param.getCourseId(),
|
|
|
+ item.getFsUserId(), String.valueOf(qwUser.getId()),
|
|
|
+ companyUserId, companyId,
|
|
|
+ item.getExternalId(), item.getStartTime(),
|
|
|
+ dataTime, 2);
|
|
|
+ //生成看课短链
|
|
|
+ String shortH5link = createH5LinkByMiniAppV2(st, param.getCorpId(), dataTime, param.getCourseId(), param.getVideoId(),
|
|
|
+ String.valueOf(qwUser.getId()), companyUserId, companyId, item.getExternalId(), config);
|
|
|
+ st.setMiniprogramPage(shortH5link);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("跳转app看课模板解析失败:" + e);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //跳转app直播
|
|
|
+ case "24":
|
|
|
+ try{
|
|
|
+ sopLogs.setSendType(20);//直播
|
|
|
+ qwUserId = qwUser.getId();
|
|
|
+ corpId = param.getCorpId();
|
|
|
+ //生成直播短链
|
|
|
+ shortH5Link = createH5LiveShortLinkV2(st, corpId,
|
|
|
+ qwUserId, companyUserId, companyId);
|
|
|
+ st.setMiniprogramPage(shortH5Link);
|
|
|
+ String json0 = configService.selectConfigByKey("his.config");
|
|
|
+ FSSysConfig sysConfig0 = JSON.parseObject(json0, FSSysConfig.class);
|
|
|
+ //直播观看记录
|
|
|
+ createLiveWatchLogAndInsert(
|
|
|
+ qwUser.getCompanyId().toString(),
|
|
|
+ qwUser.getCompanyUserId().toString(),
|
|
|
+ item.getExternalId().toString(),
|
|
|
+ Long.valueOf(st.getLiveId()),
|
|
|
+ sysConfig0.getAppId(),
|
|
|
+ 2,
|
|
|
+ String.valueOf(qwUser.getId()),
|
|
|
+ param.getCorpId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("跳转app直播模板解析失败:" + e);
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@@ -2404,6 +2536,38 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
return link.getRealLink();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 创建看课短链
|
|
|
+ * @param setting
|
|
|
+ * @param corpId
|
|
|
+ * @param sendTime
|
|
|
+ * @param courseId
|
|
|
+ * @param videoId
|
|
|
+ * @param qwUserId
|
|
|
+ * @param companyUserId
|
|
|
+ * @param companyId
|
|
|
+ * @param externalId
|
|
|
+ * @param config
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ String createH5LinkByMiniAppV2(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 = appRealLink + courseJson;
|
|
|
+ link.setRealLink(realLinkFull);
|
|
|
+ Date updateTime = createUpdateTime(setting, sendTime, config);
|
|
|
+ link.setUpdateTime(updateTime);
|
|
|
+ link.setCreateTime(new Date());
|
|
|
+ //存短链-
|
|
|
+ fsCourseLinkMapper.insertFsCourseLink(link);
|
|
|
+ return link.getRealLink();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 创建直播短链
|
|
|
* @param setting
|
|
|
@@ -2447,6 +2611,42 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 创建直播短链
|
|
|
+ * @param setting
|
|
|
+ * @param corpId
|
|
|
+ * @param qwUserId
|
|
|
+ * @param companyUserId
|
|
|
+ * @param companyId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String createH5LiveShortLinkV2(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);
|
|
|
+ }
|
|
|
+ link.setCreateTime(new Date());
|
|
|
+ FsCourseRealLink courseMap = new FsCourseRealLink();
|
|
|
+ BeanUtils.copyProperties(link, courseMap);
|
|
|
+ String courseJson = JSON.toJSONString(link);
|
|
|
+ String realLinkFull = appLiveShortLink + 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) {
|
|
|
FsCourseLink link = createFsCourseLink(corpId, sendTime, courseId, videoId, Long.valueOf(qwUserId),
|
|
|
companyUserId, companyId, null, 3, chatId);
|
|
|
@@ -2643,8 +2843,8 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
|
|
|
//插入观看记录
|
|
|
public void addWatchLogIfNeeded(String sopId, Integer videoId, Integer courseId,
|
|
|
- Long fsUserId, String qwUserId, String companyUserId,
|
|
|
- String companyId, Long externalId, String startTime,Date createTime, Integer watchType) {
|
|
|
+ Long fsUserId, String qwUserId, String companyUserId,
|
|
|
+ String companyId, Long externalId, String startTime,Date createTime, Integer watchType) {
|
|
|
|
|
|
try {
|
|
|
FsCourseWatchLog watchLog = new FsCourseWatchLog();
|
|
|
@@ -2702,11 +2902,11 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
}
|
|
|
|
|
|
public String createLinkByMiniApp(QwSopCourseFinishTempSetting.Setting setting, String corpId, Date sendTime,
|
|
|
- Integer courseId, Integer videoId, Long qwUserId,
|
|
|
- String companyUserId, String companyId, Long externalId,CourseConfig config, String chatId) {
|
|
|
+ Integer courseId, Integer videoId, Long qwUserId,
|
|
|
+ String companyUserId, String companyId, Long externalId,CourseConfig config, String chatId) {
|
|
|
|
|
|
FsCourseLink link = createFsCourseLink(corpId, sendTime, courseId, videoId, qwUserId,
|
|
|
- companyUserId, companyId, externalId,3,chatId);
|
|
|
+ companyUserId, companyId, externalId,3,chatId);
|
|
|
|
|
|
FsCourseRealLink courseMap = new FsCourseRealLink();
|
|
|
BeanUtils.copyProperties(link,courseMap);
|
|
|
@@ -2791,7 +2991,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
byAppVO.setSortLink(sortLink);
|
|
|
byAppVO.setAppMsgLink(appMsgLink);
|
|
|
|
|
|
- //异步生成app链接记录
|
|
|
+ //异步生成app链接记录
|
|
|
asyncSopTestService.createFsCourseSopAppLink(link.getLink(),sendTime,updateTime,companyId,companyUserId,String.valueOf(qwUserId),
|
|
|
qwUserName,corpId,courseId,setting.getLinkTitle(),setting.getLinkImageUrl(),videoId,
|
|
|
setting.getLinkDescribe(),appMsgLink,externalId);
|