|
@@ -78,11 +78,16 @@ import com.fs.qw.mapper.*;
|
|
|
import com.fs.qw.param.FsUserCourseRedPageParam;
|
|
import com.fs.qw.param.FsUserCourseRedPageParam;
|
|
|
import com.fs.qw.service.IQwCompanyService;
|
|
import com.fs.qw.service.IQwCompanyService;
|
|
|
import com.fs.qw.service.IQwExternalContactService;
|
|
import com.fs.qw.service.IQwExternalContactService;
|
|
|
|
|
+import com.fs.qw.vo.QwSopCourseFinishTempSetting;
|
|
|
import com.fs.qwApi.Result.QwAddContactWayResult;
|
|
import com.fs.qwApi.Result.QwAddContactWayResult;
|
|
|
import com.fs.qwApi.param.QwAddContactWayParam;
|
|
import com.fs.qwApi.param.QwAddContactWayParam;
|
|
|
import com.fs.qwApi.service.QwApiService;
|
|
import com.fs.qwApi.service.QwApiService;
|
|
|
|
|
+import com.fs.sop.domain.QwSopLogs;
|
|
|
|
|
+import com.fs.sop.domain.QwSopTempVoice;
|
|
|
import com.fs.sop.domain.SopUserLogsInfo;
|
|
import com.fs.sop.domain.SopUserLogsInfo;
|
|
|
import com.fs.sop.mapper.SopUserLogsInfoMapper;
|
|
import com.fs.sop.mapper.SopUserLogsInfoMapper;
|
|
|
|
|
+import com.fs.sop.service.IQwSopLogsService;
|
|
|
|
|
+import com.fs.sop.service.IQwSopTempVoiceService;
|
|
|
import com.fs.sop.service.ISopUserLogsInfoService;
|
|
import com.fs.sop.service.ISopUserLogsInfoService;
|
|
|
import com.fs.system.mapper.SysDictDataMapper;
|
|
import com.fs.system.mapper.SysDictDataMapper;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
@@ -108,6 +113,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.time.*;
|
|
import java.time.*;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -276,6 +282,12 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FsDepVideoShowMapper fsDepVideoShowMapper;
|
|
private FsDepVideoShowMapper fsDepVideoShowMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IQwSopTempVoiceService sopTempVoiceService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IQwSopLogsService iQwSopLogsService;
|
|
|
|
|
+
|
|
|
@Value("${cloud_host.company_name}")
|
|
@Value("${cloud_host.company_name}")
|
|
|
private String companyName;
|
|
private String companyName;
|
|
|
|
|
|
|
@@ -3393,6 +3405,87 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public R createVoiceLink(FsCourseLinkMiniParam param,QwUser qwUser) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+
|
|
|
|
|
+ QwSopLogs sopLogs = new QwSopLogs();
|
|
|
|
|
+
|
|
|
|
|
+ sopLogs.setQwUserid(qwUser.getQwUserId());
|
|
|
|
|
+ sopLogs.setExternalUserId(param.getExternalContactId());
|
|
|
|
|
+ sopLogs.setExternalId(param.getExternalId());
|
|
|
|
|
+ sopLogs.setLogType(2);
|
|
|
|
|
+ sopLogs.setSendStatus(3L);
|
|
|
|
|
+ sopLogs.setSendTime(sdf.format(new Date()));
|
|
|
|
|
+ sopLogs.setCompanyId(qwUser.getCompanyId());
|
|
|
|
|
+ sopLogs.setReceivingStatus(0L);
|
|
|
|
|
+ sopLogs.setSopId("voiceSidebar");
|
|
|
|
|
+ sopLogs.setCorpId(qwUser.getCorpId());
|
|
|
|
|
+ sopLogs.setFsUserId(param.getFsUserId());
|
|
|
|
|
+ sopLogs.setSort(30000000);
|
|
|
|
|
+ sopLogs.setSendType(7);
|
|
|
|
|
+ sopLogs.setExternalUserName(param.getExternalContactName());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ QwSopCourseFinishTempSetting setting = new QwSopCourseFinishTempSetting();
|
|
|
|
|
+
|
|
|
|
|
+ List<QwSopCourseFinishTempSetting.Setting> list = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ QwSopCourseFinishTempSetting.Setting st=new QwSopCourseFinishTempSetting.Setting();
|
|
|
|
|
+
|
|
|
|
|
+ QwSopTempVoice qwSopTempVoice = sopTempVoiceService.selectQwSopTempVoiceByCompanyUserIdAndVoiceTxt(qwUser.getCompanyUserId(), param.getVoiceTxt());
|
|
|
|
|
+ if (qwSopTempVoice != null && qwSopTempVoice.getVoiceUrl() != null && qwSopTempVoice.getRecordType() == 1) {
|
|
|
|
|
+
|
|
|
|
|
+ FsUserCourseVideo fsUserCourseVideo=new FsUserCourseVideo();
|
|
|
|
|
+ fsUserCourseVideo.setIsDel(0);
|
|
|
|
|
+ fsUserCourseVideo.setIsPause(0);
|
|
|
|
|
+ fsUserCourseVideo.setIsFirst(0);
|
|
|
|
|
+
|
|
|
|
|
+ String sopVideo = "sopVoiceLink:video:" + fsUserCourseVideo.getVideoId();
|
|
|
|
|
+
|
|
|
|
|
+ Integer cacheValue = redisCache.getCacheObject("sopVoiceLink:video");
|
|
|
|
|
+
|
|
|
|
|
+ int isPause = (cacheValue != null) ? cacheValue : 0;
|
|
|
|
|
+
|
|
|
|
|
+ Long videoId;
|
|
|
|
|
+
|
|
|
|
|
+ if (isPause ==0 ){
|
|
|
|
|
+ FsUserCourseVideo courseVideo = fsUserCourseVideoMapper.selectFsUserCourseVideoByVoice(fsUserCourseVideo);
|
|
|
|
|
+ redisCache.setCacheObject(sopVideo, courseVideo.getVideoId());
|
|
|
|
|
+ videoId=courseVideo.getVideoId();
|
|
|
|
|
+ }else {
|
|
|
|
|
+ videoId= Long.valueOf(cacheValue);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ st.setContentType("7");
|
|
|
|
|
+ st.setValue(param.getVoiceTxt());
|
|
|
|
|
+ st.setVoiceUrl(qwSopTempVoice.getVoiceUrl());
|
|
|
|
|
+ st.setVoiceDuration(String.valueOf(qwSopTempVoice.getDuration()));
|
|
|
|
|
+ st.setVideoId(videoId);
|
|
|
|
|
+
|
|
|
|
|
+ setting.setVideoId(Math.toIntExact(videoId));
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return R.error("未查询到语音素材");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ list.add(st);
|
|
|
|
|
+
|
|
|
|
|
+ setting.setSetting(list);
|
|
|
|
|
+ setting.setType(2);
|
|
|
|
|
+ setting.setCourseType(0);
|
|
|
|
|
+
|
|
|
|
|
+ sopLogs.setContentJson(JSON.toJSONString(setting));
|
|
|
|
|
+ sopLogs.setQwUserKey(qwUser.getId());
|
|
|
|
|
+
|
|
|
|
|
+ iQwSopLogsService.insertQwSopLogs(sopLogs);
|
|
|
|
|
+
|
|
|
|
|
+ return R.ok();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//插入观看记录
|
|
//插入观看记录
|
|
|
private void addWatchLogIfNeeded(Long videoId, Long courseId,
|
|
private void addWatchLogIfNeeded(Long videoId, Long courseId,
|
|
|
Long fsUserId, QwUser qwUser, Long externalId,Integer watchType) {
|
|
Long fsUserId, QwUser qwUser, Long externalId,Integer watchType) {
|