|
@@ -1,6 +1,5 @@
|
|
|
package com.fs.sop.service.impl;
|
|
package com.fs.sop.service.impl;
|
|
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.fs.common.annotation.DataSource;
|
|
import com.fs.common.annotation.DataSource;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
@@ -36,7 +35,6 @@ import com.fs.sop.params.*;
|
|
|
import com.fs.sop.service.*;
|
|
import com.fs.sop.service.*;
|
|
|
import com.fs.sop.vo.QwSopTask;
|
|
import com.fs.sop.vo.QwSopTask;
|
|
|
import com.fs.sop.vo.SopVoiceListVo;
|
|
import com.fs.sop.vo.SopVoiceListVo;
|
|
|
-import com.fs.sop.vo.VoiceVo;
|
|
|
|
|
import com.fs.store.param.h5.UserStatisticsCommonParam;
|
|
import com.fs.store.param.h5.UserStatisticsCommonParam;
|
|
|
import com.fs.store.vo.h5.*;
|
|
import com.fs.store.vo.h5.*;
|
|
|
import com.fs.voice.utils.StringUtil;
|
|
import com.fs.voice.utils.StringUtil;
|
|
@@ -44,7 +42,6 @@ import com.fs.wxUser.mapper.CompanyWxUserMapper;
|
|
|
import com.fs.wxUser.param.CompanyWxUserSopParam;
|
|
import com.fs.wxUser.param.CompanyWxUserSopParam;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
-import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -127,9 +124,6 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IQwSopTempRulesService qwSopTempRulesService;
|
|
private IQwSopTempRulesService qwSopTempRulesService;
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private RocketMQTemplate rocketMQTemplate;
|
|
|
|
|
-
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IQwExternalContactService qwExternalContactService;
|
|
private IQwExternalContactService qwExternalContactService;
|
|
|
|
|
|
|
@@ -230,7 +224,7 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
if (i > 0) {
|
|
if (i > 0) {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- rocketMQTemplate.syncSend("voice-generation", JSON.toJSONString(VoiceVo.builder().type(1).id(qwSop.getId()).build()));
|
|
|
|
|
|
|
+ syncSopTempVoice(qwSop.getId());
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
log.error("修改模板-异步同步临时语音失败:",e);
|
|
log.error("修改模板-异步同步临时语音失败:",e);
|
|
|
}
|
|
}
|
|
@@ -716,9 +710,8 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
));
|
|
));
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- rocketMQTemplate.syncSend("voice-generation", JSON.toJSONString(VoiceVo.builder().type(1).id(ruleTimeVO.getId()).build()));
|
|
|
|
|
- // new Thread(() -> HttpUtils.sendGet("http://118.24.209.192:8009/qw/voice/synchronousSop", "sopId=" + ruleTimeVO.getId())).start();
|
|
|
|
|
- // qwSopTempVoiceService.synchronous(ruleTimeVO.getId(), companyUserIds);
|
|
|
|
|
|
|
+ List<List<Long>> companyUserIds = PubFun.listToNewList(qwFilterSopCustomersResults.stream().filter(e -> e.getCuCompanyId() != null && e.getCompanyId() != null).collect(Collectors.toList()), e -> Arrays.asList(e.getCuCompanyUserId(), e.getCuCompanyId()));
|
|
|
|
|
+ qwSopTempVoiceService.synchronous(ruleTimeVO.getId(), companyUserIds);
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
log.error("异步同步临时语音失败:",e);
|
|
log.error("异步同步临时语音失败:",e);
|
|
|
}
|
|
}
|
|
@@ -956,7 +949,7 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- rocketMQTemplate.syncSend("voice-generation", JSON.toJSONString(VoiceVo.builder().type(1).id(sop.getId()).build()));
|
|
|
|
|
|
|
+ syncSopTempVoice(sop.getId());
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
log.error("修改员工-异步同步临时语音失败:",e);
|
|
log.error("修改员工-异步同步临时语音失败:",e);
|
|
|
}
|
|
}
|
|
@@ -1379,4 +1372,31 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
return contact;
|
|
return contact;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 无 RocketMQ 时直调同步临时语音
|
|
|
|
|
+ */
|
|
|
|
|
+ private void syncSopTempVoice(String sopId) {
|
|
|
|
|
+ QwSop qwSop = qwSopMapper.selectQwSopById(sopId);
|
|
|
|
|
+ if (qwSop == null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ QwSopTagsParam qwSopTagsParam = new QwSopTagsParam();
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(qwSop.getQwUserIds())) {
|
|
|
|
|
+ qwSopTagsParam.setUserIdsSelectList(Arrays.asList(qwSop.getQwUserIds().split(",")));
|
|
|
|
|
+ }
|
|
|
|
|
+ qwSopTagsParam.setFilterType(qwSop.getFilterType());
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(qwSop.getTags())) {
|
|
|
|
|
+ qwSopTagsParam.setTagsIdsSelectList(Arrays.asList(qwSop.getTags().split(",")));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(qwSop.getExcludeTags())) {
|
|
|
|
|
+ qwSopTagsParam.setOutTagsIdsSelectList(Arrays.asList(qwSop.getExcludeTags().split(",")));
|
|
|
|
|
+ }
|
|
|
|
|
+ qwSopTagsParam.setCropId(qwSop.getCorpId());
|
|
|
|
|
+ List<QwFilterSopCustomersResult> results = qwSopMapper.selectFilterQwSopCustomers(qwSopTagsParam);
|
|
|
|
|
+ List<List<Long>> companyUserIds = PubFun.listToNewList(
|
|
|
|
|
+ results.stream().filter(e -> e.getCuCompanyId() != null && e.getCompanyId() != null).collect(Collectors.toList()),
|
|
|
|
|
+ e -> Arrays.asList(e.getCuCompanyUserId(), e.getCuCompanyId()));
|
|
|
|
|
+ qwSopTempVoiceService.synchronous(sopId, companyUserIds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|