|
@@ -674,11 +674,40 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
if(content.getSetting() == null){
|
|
if(content.getSetting() == null){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ List<QwSopTempSetting.Content.Setting> setting = content.getSetting().stream().filter(e -> "7".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
|
+ if (!setting.isEmpty()) {
|
|
|
|
+ List<String> valuesList = PubFun.listToNewList(setting, QwSopTempSetting.Content.Setting::getValue);
|
|
|
|
+ if (valuesList != null && !valuesList.isEmpty()) {
|
|
|
|
+ try {
|
|
|
|
+ List<QwSopTempVoice> voiceList = qwSopTempVoiceService.getVoiceByText(Long.parseLong(companyUserId), valuesList);
|
|
|
|
+ if (voiceList != null && !voiceList.isEmpty()) {
|
|
|
|
+ Map<String, QwSopTempVoice> collect = voiceList.stream().collect(Collectors.toMap(QwSopTempVoice::getVoiceTxt, e -> e));
|
|
|
|
+ setting.parallelStream().filter(e -> "7".equals(e.getContentType())).forEach(st -> {
|
|
|
|
+ QwSopTempVoice voice = collect.get(st.getValue());
|
|
|
|
+ if (voice.getVoiceUrl() == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ st.setVoiceUrl(voice.getVoiceUrl());
|
|
|
|
+ st.setVoiceDuration(voice.getDuration() + "");
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// // 发送语音 end
|
|
// // 发送语音 end
|
|
if (content.getType()==5){
|
|
if (content.getType()==5){
|
|
sopAddTag(logVo,content,sendTime);
|
|
sopAddTag(logVo,content,sendTime);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //当语音模板的qw_sop_temp_voice中无对应语音,就不生成qw_sop_logs记录
|
|
|
|
+ if (content.getType() == 7 && content.getSetting() != null && !content.getSetting().isEmpty()) {
|
|
|
|
+ if (content.getSetting().get(0).getVoiceUrl() == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (StringUtils.isNotEmpty(logVo.getChatId())) {
|
|
if (StringUtils.isNotEmpty(logVo.getChatId())) {
|
|
QwGroupChat groupChat = groupChatMap.get(logVo.getChatId());
|
|
QwGroupChat groupChat = groupChatMap.get(logVo.getChatId());
|
|
ruleTimeVO.setSendType(6);
|
|
ruleTimeVO.setSendType(6);
|
|
@@ -839,11 +868,18 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
case 5:
|
|
case 5:
|
|
// handleTagMessage(sopLogs, content);
|
|
// handleTagMessage(sopLogs, content);
|
|
break;
|
|
break;
|
|
|
|
+ case 7:
|
|
|
|
+ handleVoiceMessage(sopLogs, content, companyUserId);
|
|
|
|
+ break;
|
|
default:
|
|
default:
|
|
log.error("未知的消息类型 {},跳过处理。", type);
|
|
log.error("未知的消息类型 {},跳过处理。", type);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ private void handleVoiceMessage(QwSopLogs sopLogs, QwSopTempSetting.Content content, String companyUserId) {
|
|
|
|
+ sopLogs.setContentJson(JSON.toJSONString(content));
|
|
|
|
+ enqueueQwSopLogs(sopLogs);
|
|
|
|
+ }
|
|
|
|
|
|
private void handleNormalMessage(QwSopLogs sopLogs, QwSopTempSetting.Content content,String companyUserId) {
|
|
private void handleNormalMessage(QwSopLogs sopLogs, QwSopTempSetting.Content content,String companyUserId) {
|
|
|
|
|