|
@@ -17,12 +17,11 @@ import com.fs.course.service.IFsUserCourseVideoRedPackageService;
|
|
|
import com.fs.course.utils.TimeCalculator;
|
|
|
import com.fs.fastGpt.domain.FastGptChatReplaceWords;
|
|
|
import com.fs.fastGpt.mapper.FastGptChatReplaceWordsMapper;
|
|
|
+import com.fs.qw.service.IQwUserService;
|
|
|
import com.fs.qw.vo.QwSopTempSetting2;
|
|
|
+import com.fs.qw.vo.QwUserVO;
|
|
|
import com.fs.qw.vo.SortDayVo;
|
|
|
-import com.fs.sop.domain.QwSopTemp;
|
|
|
-import com.fs.sop.domain.QwSopTempContent;
|
|
|
-import com.fs.sop.domain.QwSopTempDay;
|
|
|
-import com.fs.sop.domain.QwSopTempRules;
|
|
|
+import com.fs.sop.domain.*;
|
|
|
import com.fs.sop.mapper.QwSopTempMapper;
|
|
|
import com.fs.sop.params.QwSopShareTempParam;
|
|
|
import com.fs.sop.service.*;
|
|
@@ -32,6 +31,7 @@ import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.apache.commons.beanutils.ConvertUtils;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -66,6 +66,8 @@ public class QwSopTempServiceImpl implements IQwSopTempService
|
|
|
private final IFsUserCourseVideoRedPackageService fsUserCourseVideoRedPackageService;
|
|
|
private final FsUserCourseVideoMapper fsUserCourseVideoMapper;
|
|
|
private final FsUserCourseMapper fsUserCourseMapper;
|
|
|
+ private final IQwSopService qwSopService;
|
|
|
+ private final IQwUserService qwUserService;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -211,9 +213,9 @@ public class QwSopTempServiceImpl implements IQwSopTempService
|
|
|
List<QwSopTempRules> list = day.getList();
|
|
|
List<QwSopTempContent> collect = list.stream().flatMap(e -> e.getSettingList().stream()).collect(Collectors.toList());
|
|
|
List<QwSopTempContent> voiceList = collect.stream().filter(e -> e.getContentType() == 7).collect(Collectors.toList());
|
|
|
- if(!voiceList.isEmpty()){
|
|
|
-// day.setVoice(1);
|
|
|
- }
|
|
|
+// if(!voiceList.isEmpty()){
|
|
|
+//// day.setVoice(1);
|
|
|
+// }
|
|
|
qwSopTempDayService.saveOrUpdate(day);
|
|
|
qwSopTempRulesService.removeByDayId(day.getId());
|
|
|
qwSopTempContentService.removeByDayId(day.getId());
|
|
@@ -237,8 +239,47 @@ public class QwSopTempServiceImpl implements IQwSopTempService
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("id", day.getId());
|
|
|
if(!voiceList.isEmpty()){
|
|
|
- rocketMQTemplate.syncSend("voice-generation", JSON.toJSONString(VoiceVo.builder().type(0).id(day.getId().toString()).build()));
|
|
|
+ for (QwSopTempContent qwSopTempContent : voiceList) {
|
|
|
+ String content = qwSopTempContent.getContent();
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(content);
|
|
|
+ String text = jsonObject.getString("value");
|
|
|
+ List<QwSop> qwSopList = qwSopService.selectQwSopByTempId(tempId);//通过tempId查询出所有sop
|
|
|
+ if(qwSopList != null && !qwSopList.isEmpty()){
|
|
|
+ for (QwSop qwSop : qwSopList) {
|
|
|
+ if(qwSop != null && qwSop.getQwUserIds() != null){
|
|
|
+ //查询出所有的tempContent来筛选文字
|
|
|
+ List<QwSopTempContent> qwSopTempContentList = qwSopTempContentService.selectQwSopTempContentByTempId(tempId);
|
|
|
+ if(qwSopTempContentList != null && !qwSopTempContentList.isEmpty()){
|
|
|
+ for (QwSopTempContent qwSopTemp : qwSopTempContentList) {
|
|
|
+ if(qwSopTemp != null && qwSopTemp.getContentType() == 7){
|
|
|
+ String[] split = qwSop.getQwUserIds().split(",");
|
|
|
+ Long[] qwUserIds = (Long[]) ConvertUtils.convert(split, Long.class);
|
|
|
+ List<QwUserVO> qwUserVOS = qwUserService.selectQwUserVOByIds(qwUserIds);
|
|
|
+ if(qwUserVOS != null){
|
|
|
+ for (QwUserVO qwUserVO : qwUserVOS) {
|
|
|
+ Long companyUserId = qwUserVO.getCompanyUserId();
|
|
|
+ QwSopTempVoice qwSopTempVoice = qwSopTempVoiceService.selectQwSopTempVoiceByCompanyUserIdAndVoiceTxt(companyUserId,text);
|
|
|
+ if(qwSopTempVoice == null){
|
|
|
+ QwSopTempVoice sopTempVoice = new QwSopTempVoice();
|
|
|
+ sopTempVoice.setCompanyUserId(companyUserId);
|
|
|
+ sopTempVoice.setVoiceTxt(text);
|
|
|
+ sopTempVoice.setTempId(tempId);
|
|
|
+ sopTempVoice.setRecordType(0);
|
|
|
+ qwSopTempVoiceService.insertQwSopTempVoice(sopTempVoice);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+// if(!voiceList.isEmpty()){
|
|
|
+// rocketMQTemplate.syncSend("voice-generation", JSON.toJSONString(VoiceVo.builder().type(0).id(day.getId().toString()).build()));
|
|
|
+// }
|
|
|
return map;
|
|
|
}
|
|
|
|