|
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.exception.base.BaseException;
|
|
import com.fs.common.exception.base.BaseException;
|
|
|
|
|
+import com.fs.common.utils.CloudHostUtils;
|
|
|
import com.fs.common.utils.PubFun;
|
|
import com.fs.common.utils.PubFun;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.date.DateUtil;
|
|
import com.fs.common.utils.date.DateUtil;
|
|
@@ -58,6 +59,7 @@ import com.fs.sop.vo.QwCreateLinkByAppVO;
|
|
|
import com.fs.sop.vo.SopUserLogsInfoVOE;
|
|
import com.fs.sop.vo.SopUserLogsInfoVOE;
|
|
|
import com.fs.sop.vo.SopUserLogsVo;
|
|
import com.fs.sop.vo.SopUserLogsVo;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
|
|
+import com.fs.utils.ShortCodeGeneratorUtils;
|
|
|
import com.fs.voice.utils.StringUtil;
|
|
import com.fs.voice.utils.StringUtil;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -88,6 +90,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
private static final String SHORT_LINK_PREFIX = "/courseH5/pages/course/learning?s=";
|
|
private static final String SHORT_LINK_PREFIX = "/courseH5/pages/course/learning?s=";
|
|
|
private static final String miniappRealLink = "/pages_course/video.html?course=";
|
|
private static final String miniappRealLink = "/pages_course/video.html?course=";
|
|
|
private static final String appRealLink = "/pages/courseAnswer/index?link=";
|
|
private static final String appRealLink = "/pages/courseAnswer/index?link=";
|
|
|
|
|
+ private static final String registeredRealLink = "/pages_course/register.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 miniappRealLink = "/pages/index/index?course=";
|
|
// private static final String miniappRealLink = "/pages/index/index?course=";
|
|
|
|
|
|
|
@@ -935,6 +938,26 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "21":
|
|
|
|
|
+ if (sopLogs.getFsUserId() != null && !Long.valueOf(0L).equals(sopLogs.getFsUserId())) {
|
|
|
|
|
+ addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(), item.getFsUserId(), qwUserId, companyUserId, companyId,
|
|
|
|
|
+ item.getExternalId(), item.getStartTime(), createTime);
|
|
|
|
|
+ String link = createSmsShortLink(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
|
|
|
|
|
+ String.valueOf(qwUser.getId()), companyUserId, companyId, item.getExternalId(), config);
|
|
|
|
|
+ if (StringUtils.isNotBlank(link)) {
|
|
|
|
|
+ if(StringUtils.isNotBlank(st.getSmsTemplateContent()) && st.getSmsTemplateContent().contains("${sms.courseUrl}")){
|
|
|
|
|
+ st.setValue(st.getSmsTemplateContent()
|
|
|
|
|
+ .replaceAll("【(.*?)】", "【" + config.getSmsDomain() + "】")
|
|
|
|
|
+ .replace("${sms.courseUrl}", link));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ log.error("生成看课短链时检测到短信模板选择错误,跳过设置 URL。");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.error("生成看课短链失败,跳过设置 URL。");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
@@ -1180,7 +1203,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
switch (finalSendType){
|
|
switch (finalSendType){
|
|
|
case 5:
|
|
case 5:
|
|
|
List<QwSopCourseFinishTempSetting.Setting> list = processSetting(item,qwUser, param, words, config, qwCompany,companyUserId,companyId,
|
|
List<QwSopCourseFinishTempSetting.Setting> list = processSetting(item,qwUser, param, words, config, qwCompany,companyUserId,companyId,
|
|
|
- contact,dataTime, finalDomainName,miniMap,companies);
|
|
|
|
|
|
|
+ contact,dataTime, finalDomainName,miniMap,companies,sopLogs);
|
|
|
setting.setSetting(list);
|
|
setting.setSetting(list);
|
|
|
break;
|
|
break;
|
|
|
case 9:
|
|
case 9:
|
|
@@ -1244,7 +1267,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
CourseConfig config,QwCompany qwCompany,String companyUserId, String companyId,
|
|
CourseConfig config,QwCompany qwCompany,String companyUserId, String companyId,
|
|
|
QwExternalContact contact,Date dataTime,String domainName,
|
|
QwExternalContact contact,Date dataTime,String domainName,
|
|
|
Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
|
|
Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
|
|
|
- List<Company> companies ){
|
|
|
|
|
|
|
+ List<Company> companies,QwSopLogs sopLogs ){
|
|
|
List<QwSopCourseFinishTempSetting.Setting> list = JSONArray.parseArray(param.getSetting(),QwSopCourseFinishTempSetting.Setting.class);
|
|
List<QwSopCourseFinishTempSetting.Setting> list = JSONArray.parseArray(param.getSetting(),QwSopCourseFinishTempSetting.Setting.class);
|
|
|
|
|
|
|
|
for (QwSopCourseFinishTempSetting.Setting st : list) {
|
|
for (QwSopCourseFinishTempSetting.Setting st : list) {
|
|
@@ -1377,6 +1400,26 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
|
|
+
|
|
|
|
|
+ case "21":
|
|
|
|
|
+ if (sopLogs.getFsUserId() != null && !Long.valueOf(0L).equals(sopLogs.getFsUserId())) {
|
|
|
|
|
+ addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(), item.getFsUserId(), String.valueOf(qwUser.getId()), companyUserId, companyId,
|
|
|
|
|
+ item.getExternalId(), item.getStartTime(), dataTime);
|
|
|
|
|
+ String link = createSmsShortLink(st, param.getCorpId(), dataTime, param.getCourseId(), param.getVideoId(),
|
|
|
|
|
+ String.valueOf(qwUser.getId()), companyUserId, companyId, item.getExternalId(), config);
|
|
|
|
|
+ if (StringUtils.isNotBlank(link)) {
|
|
|
|
|
+ if(StringUtils.isNotBlank(st.getSmsTemplateContent()) && st.getSmsTemplateContent().contains("${sms.courseUrl}")){
|
|
|
|
|
+ st.setValue(st.getSmsTemplateContent()
|
|
|
|
|
+ .replaceAll("【(.*?)】", "【" + config.getSmsDomain() + "】")
|
|
|
|
|
+ .replace("${sms.courseUrl}", link));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ log.error("生成看课短链时检测到短信模板选择错误,跳过设置 URL。");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.error("生成看课短链失败,跳过设置 URL。");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
@@ -1386,6 +1429,46 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ private String createSmsShortLink(QwSopCourseFinishTempSetting.Setting setting, String corpId, Date sendTime,
|
|
|
|
|
+ Integer courseId, Integer videoId, String qwUserId,
|
|
|
|
|
+ String companyUserId, String companyId, Long externalId, CourseConfig config) {
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseLink link = new FsCourseLink();
|
|
|
|
|
+ link.setCompanyId(Long.parseLong(companyId));
|
|
|
|
|
+ link.setQwUserId(Long.valueOf(qwUserId));
|
|
|
|
|
+ link.setCompanyUserId(Long.parseLong(companyUserId));
|
|
|
|
|
+ link.setVideoId(videoId.longValue());
|
|
|
|
|
+ link.setCorpId(corpId);
|
|
|
|
|
+ link.setCourseId(courseId.longValue());
|
|
|
|
|
+ link.setQwExternalId(externalId);
|
|
|
|
|
+ link.setLinkType(0); //正常链接
|
|
|
|
|
+ link.setUNo(UUID.randomUUID().toString());
|
|
|
|
|
+ String randomString = ShortCodeGeneratorUtils.generate8();
|
|
|
|
|
+ if (StringUtil.strIsNullOrEmpty(randomString)) {
|
|
|
|
|
+ link.setLink(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ link.setLink(randomString);
|
|
|
|
|
+ }
|
|
|
|
|
+ link.setCreateTime(sendTime);;
|
|
|
|
|
+ Date updateTime = createUpdateTime(setting, sendTime, config);
|
|
|
|
|
+ link.setUpdateTime(updateTime);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseRealLink courseMap = new FsCourseRealLink();
|
|
|
|
|
+ BeanUtils.copyProperties(link, courseMap);
|
|
|
|
|
+
|
|
|
|
|
+ String realLinkFull = registeredRealLink + JSON.toJSONString(courseMap);
|
|
|
|
|
+ link.setRealLink(realLinkFull);
|
|
|
|
|
+ fsCourseLinkMapper.insertFsCourseLink(link);
|
|
|
|
|
+ if(StringUtils.isEmpty(config.getSmsDomainName())){
|
|
|
|
|
+ log.error("检测到未配置看课短信链接域名");
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ return config.getSmsDomainName() + "/" + link.getLink();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
private List<QwSopCourseFinishTempSetting.Setting> parseSettings(String jsonData) {
|
|
private List<QwSopCourseFinishTempSetting.Setting> parseSettings(String jsonData) {
|
|
|
try {
|
|
try {
|
|
|
if (jsonData.startsWith("[") && jsonData.endsWith("]")) {
|
|
if (jsonData.startsWith("[") && jsonData.endsWith("]")) {
|