|
@@ -34,6 +34,7 @@ import com.fs.core.config.TenantConfigContext;
|
|
|
import com.fs.crm.domain.CrmCustomer;
|
|
import com.fs.crm.domain.CrmCustomer;
|
|
|
import com.fs.crm.mapper.CrmCustomerMapper;
|
|
import com.fs.crm.mapper.CrmCustomerMapper;
|
|
|
import com.fs.crm.param.SmsSendBatchParam;
|
|
import com.fs.crm.param.SmsSendBatchParam;
|
|
|
|
|
+import com.fs.crm.service.ICrmCustomerAnalyzeService;
|
|
|
import com.fs.crm.service.impl.CrmCustomerServiceImpl;
|
|
import com.fs.crm.service.impl.CrmCustomerServiceImpl;
|
|
|
import com.fs.enums.ExecutionStatusEnum;
|
|
import com.fs.enums.ExecutionStatusEnum;
|
|
|
import com.fs.enums.NodeTypeEnum;
|
|
import com.fs.enums.NodeTypeEnum;
|
|
@@ -61,6 +62,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
import java.lang.reflect.Method;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
+import java.time.temporal.ChronoField;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -68,6 +70,7 @@ import java.util.stream.Stream;
|
|
|
|
|
|
|
|
import static com.fs.company.service.impl.call.node.AbstractWorkflowNode.companyVoiceRoboticCallLogCallphoneMapper;
|
|
import static com.fs.company.service.impl.call.node.AbstractWorkflowNode.companyVoiceRoboticCallLogCallphoneMapper;
|
|
|
import static com.fs.company.service.impl.call.node.AiCallTaskNode.EASYCALL_WORKFLOW_REDIS_KEY;
|
|
import static com.fs.company.service.impl.call.node.AiCallTaskNode.EASYCALL_WORKFLOW_REDIS_KEY;
|
|
|
|
|
+import static java.time.LocalTime.now;
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -133,12 +136,20 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
|
|
|
|
|
private final IAsyncCalleeProcessorService asyncCalleeProcessorService;
|
|
private final IAsyncCalleeProcessorService asyncCalleeProcessorService;
|
|
|
|
|
|
|
|
|
|
+ private final ICrmCustomerAnalyzeService crmCustomerAnalyzeService;
|
|
|
|
|
+
|
|
|
/** EasyCall intent 意向度重试队列 Redis key 前缀,value 为已重试次数 */
|
|
/** EasyCall intent 意向度重试队列 Redis key 前缀,value 为已重试次数 */
|
|
|
private static final String EASYCALL_INTENT_RETRY_KEY = "easycall:intent:retry:";
|
|
private static final String EASYCALL_INTENT_RETRY_KEY = "easycall:intent:retry:";
|
|
|
/** intent 意向度等待重试最大次数(每次间隔约30秒,最多等待 5*30=150秒) */
|
|
/** intent 意向度等待重试最大次数(每次间隔约30秒,最多等待 5*30=150秒) */
|
|
|
private static final int EASYCALL_INTENT_MAX_RETRY = 5;
|
|
private static final int EASYCALL_INTENT_MAX_RETRY = 5;
|
|
|
/** 每次重试等待时长(毫秒) */
|
|
/** 每次重试等待时长(毫秒) */
|
|
|
private static final long EASYCALL_INTENT_RETRY_INTERVAL_MS = 30000L;
|
|
private static final long EASYCALL_INTENT_RETRY_INTERVAL_MS = 30000L;
|
|
|
|
|
+ /** EasyCall dialogue 对话内容重试队列 Redis key 前缀,value 为已重试次数 */
|
|
|
|
|
+ private static final String EASYCALL_DIALOGUE_RETRY_KEY = "easycall:dialogue:retry:";
|
|
|
|
|
+ /** dialogue 对话内容等待重试最大次数(每次间隔约30秒,最多等待 5*30=150秒) */
|
|
|
|
|
+ private static final int EASYCALL_DIALOGUE_MAX_RETRY = 5;
|
|
|
|
|
+ /** dialogue 每次重试等待时长(毫秒) */
|
|
|
|
|
+ private static final long EASYCALL_DIALOGUE_RETRY_INTERVAL_MS = 30000L;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询机器人外呼任务
|
|
* 查询机器人外呼任务
|
|
@@ -217,6 +228,7 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
client.setRoboticId(companyVoiceRobotic.getId());
|
|
client.setRoboticId(companyVoiceRobotic.getId());
|
|
|
client.setCustomerId(Long.parseLong(e));
|
|
client.setCustomerId(Long.parseLong(e));
|
|
|
client.setIsWeCom(isWeCom);
|
|
client.setIsWeCom(isWeCom);
|
|
|
|
|
+ client.setCreateTime(new Date());
|
|
|
return client;
|
|
return client;
|
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
|
companyWxClientServiceImpl.saveBatch(clients);
|
|
companyWxClientServiceImpl.saveBatch(clients);
|
|
@@ -845,7 +857,7 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
@Async("cidWorkFlowExecutor")
|
|
@Async("cidWorkFlowExecutor")
|
|
|
public void callerResult4EasyCall(CdrDetailVo result) {
|
|
public void callerResult4EasyCall(CdrDetailVo result) {
|
|
|
try {
|
|
try {
|
|
|
- Thread.sleep(20000L);
|
|
|
|
|
|
|
+ Thread.sleep(5000L);
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
@@ -889,27 +901,49 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("callerResult4EasyCall 切换租户数据源失败: tenantId={}", TenantHelper.getTenantId(), e);
|
|
log.error("callerResult4EasyCall 切换租户数据源失败: tenantId={}", TenantHelper.getTenantId(), e);
|
|
|
}
|
|
}
|
|
|
- // intent(意向度)由对方异步评估写入,回调时可能尚未赋值,进入延迟重试队列等待
|
|
|
|
|
- if (StringUtils.isBlank(callPhoneRes.getIntent())) {
|
|
|
|
|
- String retryKey = EASYCALL_INTENT_RETRY_KEY + result.getUuid();
|
|
|
|
|
|
|
+// // intent(意向度)由对方异步评估写入,回调时可能尚未赋值,进入延迟重试队列等待
|
|
|
|
|
+// if (StringUtils.isBlank(callPhoneRes.getIntent())) {
|
|
|
|
|
+// String retryKey = EASYCALL_INTENT_RETRY_KEY + result.getUuid();
|
|
|
|
|
+// Integer retryCount = redisCache2.getCacheObject(retryKey);
|
|
|
|
|
+// if (retryCount == null) {
|
|
|
|
|
+// retryCount = 0;
|
|
|
|
|
+// }
|
|
|
|
|
+// if (retryCount < EASYCALL_INTENT_MAX_RETRY) {
|
|
|
|
|
+// redisCache2.setCacheObject(retryKey, retryCount + 1, 10, java.util.concurrent.TimeUnit.MINUTES);
|
|
|
|
|
+// log.info("easyCall外呼回调intent意向度暂未评估完成,uuid={},第{}次放入延迟重试队列", result.getUuid(), retryCount + 1);
|
|
|
|
|
+// doRetryCallerResult4EasyCall(result, retryCount + 1);
|
|
|
|
|
+// } else {
|
|
|
|
|
+// // 超过最大重试次数,以 intent 为空(意向未知)兜底继续处理
|
|
|
|
|
+// log.warn("easyCall外呼回调intent意向度在{}次重试后仍为空,uuid={},以意向未知兜底处理", EASYCALL_INTENT_MAX_RETRY, result.getUuid());
|
|
|
|
|
+// redisCache2.deleteObject(retryKey);
|
|
|
|
|
+// doHandleEasyCallResult(callPhoneRes);
|
|
|
|
|
+// }
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+// // intent 已有值,直接正常处理
|
|
|
|
|
+// redisCache2.deleteObject(EASYCALL_INTENT_RETRY_KEY + result.getUuid());
|
|
|
|
|
+// doHandleEasyCallResult(callPhoneRes);
|
|
|
|
|
+ // dialogue(对话内容)由对方异步写入,回调时可能尚未赋值,进入延迟重试队列等待
|
|
|
|
|
+ if (isDialogueEmpty(callPhoneRes.getDialogue()) && !"未接通".equals(callPhoneRes.getIntent())) {
|
|
|
|
|
+ String retryKey = EASYCALL_DIALOGUE_RETRY_KEY + result.getUuid();
|
|
|
Integer retryCount = redisCache2.getCacheObject(retryKey);
|
|
Integer retryCount = redisCache2.getCacheObject(retryKey);
|
|
|
if (retryCount == null) {
|
|
if (retryCount == null) {
|
|
|
retryCount = 0;
|
|
retryCount = 0;
|
|
|
}
|
|
}
|
|
|
- if (retryCount < EASYCALL_INTENT_MAX_RETRY) {
|
|
|
|
|
|
|
+ if (retryCount < EASYCALL_DIALOGUE_MAX_RETRY) {
|
|
|
redisCache2.setCacheObject(retryKey, retryCount + 1, 10, java.util.concurrent.TimeUnit.MINUTES);
|
|
redisCache2.setCacheObject(retryKey, retryCount + 1, 10, java.util.concurrent.TimeUnit.MINUTES);
|
|
|
- log.info("easyCall外呼回调intent意向度暂未评估完成,uuid={},第{}次放入延迟重试队列", result.getUuid(), retryCount + 1);
|
|
|
|
|
- doRetryCallerResult4EasyCall(result, retryCount + 1);
|
|
|
|
|
|
|
+ log.info("easyCall外呼回调dialogue对话内容暂未写入,uuid={},第{}次放入延迟重试队列", result.getUuid(), retryCount + 1);
|
|
|
|
|
+ doRetryDialogue4EasyCall(result, retryCount + 1);
|
|
|
} else {
|
|
} else {
|
|
|
- // 超过最大重试次数,以 intent 为空(意向未知)兜底继续处理
|
|
|
|
|
- log.warn("easyCall外呼回调intent意向度在{}次重试后仍为空,uuid={},以意向未知兜底处理", EASYCALL_INTENT_MAX_RETRY, result.getUuid());
|
|
|
|
|
|
|
+ // 超过最大重试次数,以 dialogue 为空兜底继续处理
|
|
|
|
|
+ log.warn("easyCall外呼回调dialogue对话内容在{}次重试后仍为空,uuid={},以对话为空兜底处理", EASYCALL_DIALOGUE_MAX_RETRY, result.getUuid());
|
|
|
redisCache2.deleteObject(retryKey);
|
|
redisCache2.deleteObject(retryKey);
|
|
|
doHandleEasyCallResult(callPhoneRes);
|
|
doHandleEasyCallResult(callPhoneRes);
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- // intent 已有值,直接正常处理
|
|
|
|
|
- redisCache2.deleteObject(EASYCALL_INTENT_RETRY_KEY + result.getUuid());
|
|
|
|
|
|
|
+ // dialogue 已有值,直接正常处理
|
|
|
|
|
+ redisCache2.deleteObject(EASYCALL_DIALOGUE_RETRY_KEY + result.getUuid());
|
|
|
doHandleEasyCallResult(callPhoneRes);
|
|
doHandleEasyCallResult(callPhoneRes);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -933,7 +967,56 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ private boolean isDialogueEmpty(String dialogue) {
|
|
|
|
|
+ if (StringUtils.isBlank(dialogue)) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ String trimmed = dialogue.trim();
|
|
|
|
|
+ return "[]".equals(trimmed);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 延迟重试处理 EasyCall 外呼回调(等待 dialogue 对话内容异步写入完成)
|
|
|
|
|
+ * 每次重试前等待 {@link #EASYCALL_DIALOGUE_RETRY_INTERVAL_MS} 毫秒后重新拉取数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @Async("cidWorkFlowExecutor")
|
|
|
|
|
+ public void doRetryDialogue4EasyCall(CdrDetailVo result, int currentRetry) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Thread.sleep(EASYCALL_DIALOGUE_RETRY_INTERVAL_MS);
|
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
|
+ Thread.currentThread().interrupt();
|
|
|
|
|
+ log.warn("easyCall dialogue重试等待被中断, uuid={}", result.getUuid());
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("easyCall dialogue重试第{}次开始, uuid={}", currentRetry, result.getUuid());
|
|
|
|
|
+ EasyCallCallPhoneVO callPhoneRes = easyCallMapper.getCallPhoneInfoByUuid(result.getUuid());
|
|
|
|
|
+ if (null == callPhoneRes) {
|
|
|
|
|
+ log.error("easyCall dialogue重试时仍未查询到外呼结果, uuid={}", result.getUuid());
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isDialogueEmpty(callPhoneRes.getDialogue()) && !"未接通".equals(callPhoneRes.getIntent())) {
|
|
|
|
|
+ // dialogue 仍为空,继续判断是否还有剩余重试次数
|
|
|
|
|
+ String retryKey = EASYCALL_DIALOGUE_RETRY_KEY + result.getUuid();
|
|
|
|
|
+ Integer retryCount = redisCache2.getCacheObject(retryKey);
|
|
|
|
|
+ if (retryCount == null) {
|
|
|
|
|
+ retryCount = currentRetry;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (retryCount < EASYCALL_DIALOGUE_MAX_RETRY) {
|
|
|
|
|
+ redisCache2.setCacheObject(retryKey, retryCount + 1, 10, java.util.concurrent.TimeUnit.MINUTES);
|
|
|
|
|
+ log.info("easyCall dialogue对话内容仍未写入,uuid={},第{}次继续延迟重试", result.getUuid(), retryCount + 1);
|
|
|
|
|
+ doRetryDialogue4EasyCall(result, retryCount + 1);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("easyCall dialogue对话内容在{}次重试后仍为空,uuid={},以对话为空兜底处理", EASYCALL_DIALOGUE_MAX_RETRY, result.getUuid());
|
|
|
|
|
+ redisCache2.deleteObject(retryKey);
|
|
|
|
|
+ doHandleEasyCallResult(callPhoneRes);
|
|
|
|
|
+ }
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // dialogue 已写入完成,正常处理
|
|
|
|
|
+ log.info("easyCall dialogue重试第{}次成功获取到对话内容,uuid={}", currentRetry, result.getUuid());
|
|
|
|
|
+ redisCache2.deleteObject(EASYCALL_DIALOGUE_RETRY_KEY + result.getUuid());
|
|
|
|
|
+ doHandleEasyCallResult(callPhoneRes);
|
|
|
|
|
+ }
|
|
|
/**
|
|
/**
|
|
|
* 延迟重试处理 EasyCall 外呼回调(等待 intent 意向度异步评估完成)
|
|
* 延迟重试处理 EasyCall 外呼回调(等待 intent 意向度异步评估完成)
|
|
|
* 每次重试前等待 {@link #EASYCALL_INTENT_RETRY_INTERVAL_MS} 毫秒后重新拉取数据
|
|
* 每次重试前等待 {@link #EASYCALL_INTENT_RETRY_INTERVAL_MS} 毫秒后重新拉取数据
|
|
@@ -984,8 +1067,16 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
private void doHandleEasyCallResult(EasyCallCallPhoneVO callPhoneRes) {
|
|
private void doHandleEasyCallResult(EasyCallCallPhoneVO callPhoneRes) {
|
|
|
//等待数据信息
|
|
//等待数据信息
|
|
|
JSONObject bizJson = JSONObject.parseObject(callPhoneRes.getBizJson());
|
|
JSONObject bizJson = JSONObject.parseObject(callPhoneRes.getBizJson());
|
|
|
-
|
|
|
|
|
- String cacheString = (String) redisCache2.getCacheObject(EASYCALL_WORKFLOW_REDIS_KEY + bizJson.getString("callBackUuid"));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Object cacheObj = redisCache2.getCacheObject(EASYCALL_WORKFLOW_REDIS_KEY + bizJson.getString("callBackUuid"));
|
|
|
|
|
+ String cacheString;
|
|
|
|
|
+ if (cacheObj instanceof String) {
|
|
|
|
|
+ cacheString = (String) cacheObj;
|
|
|
|
|
+ } else if (cacheObj instanceof JSONObject) {
|
|
|
|
|
+ cacheString = ((JSONObject) cacheObj).toJSONString();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cacheString = cacheObj == null ? null : JSONObject.toJSONString(cacheObj);
|
|
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(cacheString)) {
|
|
if (StringUtils.isBlank(cacheString)) {
|
|
|
log.error("easyCall外呼回调缓存信息缺失, uuid={}", callPhoneRes.getUuid());
|
|
log.error("easyCall外呼回调缓存信息缺失, uuid={}", callPhoneRes.getUuid());
|
|
|
return;
|
|
return;
|
|
@@ -1063,7 +1154,24 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
// log.error("pushDialogContent4EasyCall 切换租户数据源失败: tenantId={}", TenantHelper.getTenantId(), e);
|
|
// log.error("pushDialogContent4EasyCall 切换租户数据源失败: tenantId={}", TenantHelper.getTenantId(), e);
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
- String intention = getIntention(callPhoneRes.getIntent());
|
|
|
|
|
|
|
+ String intention = null;
|
|
|
|
|
+ String intentionDegree = null;
|
|
|
|
|
+ if (StringUtils.isNotBlank(callPhoneRes.getDialogue())) {
|
|
|
|
|
+ log.info("【验证】意向度来源=自家AI, uuid={}, dialogueLength={}", callPhoneRes.getUuid(),
|
|
|
|
|
+ StringUtils.isBlank(callPhoneRes.getDialogue()) ? 0 : callPhoneRes.getDialogue().length());
|
|
|
|
|
+ try {
|
|
|
|
|
+ intentionDegree = crmCustomerAnalyzeService.aiIntentionDegree(
|
|
|
|
|
+ callPhoneRes.getDialogue(),
|
|
|
|
|
+ now().getLong(ChronoField.MILLI_OF_SECOND)
|
|
|
|
|
+ );
|
|
|
|
|
+ log.info("【验证】意向度结果={}, uuid={}", intentionDegree, callPhoneRes.getUuid());
|
|
|
|
|
+ intention = getIntention(intentionDegree);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("easyCall意向度AI解析失败,uuid={},将使用意向未知兜底", callPhoneRes.getUuid(), e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 2) 最终兜底:意向未知
|
|
|
|
|
+// String intention = getIntention(callPhoneRes.getIntent());
|
|
|
if (StringUtils.isEmpty(intention)) {
|
|
if (StringUtils.isEmpty(intention)) {
|
|
|
intention = "0";
|
|
intention = "0";
|
|
|
}
|
|
}
|
|
@@ -1452,8 +1560,10 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
companyWxClient.setDialogId(companyVoiceRoboticWx.getWxDialogId());
|
|
companyWxClient.setDialogId(companyVoiceRoboticWx.getWxDialogId());
|
|
|
if (Integer.valueOf(2).equals(robotic.getIsWeCom())) {
|
|
if (Integer.valueOf(2).equals(robotic.getIsWeCom())) {
|
|
|
companyWxClient.setCompanyUserId(qwUser.getCompanyUserId());
|
|
companyWxClient.setCompanyUserId(qwUser.getCompanyUserId());
|
|
|
|
|
+ companyWxClient.setCompanyId(qwUser.getCompanyId());
|
|
|
} else if (Integer.valueOf(1).equals(robotic.getIsWeCom())) {
|
|
} else if (Integer.valueOf(1).equals(robotic.getIsWeCom())) {
|
|
|
companyWxClient.setCompanyUserId(companyWxAccount.getCompanyUserId());
|
|
companyWxClient.setCompanyUserId(companyWxAccount.getCompanyUserId());
|
|
|
|
|
+ companyWxClient.setCompanyId(companyWxAccount.getCompanyId());
|
|
|
}
|
|
}
|
|
|
CrmCustomer crmCustomer = crmCustomerService.selectCrmCustomerById(companyWxClient.getCustomerId());
|
|
CrmCustomer crmCustomer = crmCustomerService.selectCrmCustomerById(companyWxClient.getCustomerId());
|
|
|
companyWxClient.setNickName(crmCustomer.getCustomerName());
|
|
companyWxClient.setNickName(crmCustomer.getCustomerName());
|
|
@@ -1515,8 +1625,10 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
companyWxClient.setDialogId(wx.getWxDialogId());
|
|
companyWxClient.setDialogId(wx.getWxDialogId());
|
|
|
if (robotic.getIsWeCom() == 2) {
|
|
if (robotic.getIsWeCom() == 2) {
|
|
|
companyWxClient.setCompanyUserId(qwMap.get(wx.getAccountId()).getCompanyUserId());
|
|
companyWxClient.setCompanyUserId(qwMap.get(wx.getAccountId()).getCompanyUserId());
|
|
|
|
|
+ companyWxClient.setCompanyId(qwMap.get(wx.getAccountId()).getCompanyId());
|
|
|
} else {
|
|
} else {
|
|
|
companyWxClient.setCompanyUserId(accountMap.get(wx.getAccountId()).getCompanyUserId());
|
|
companyWxClient.setCompanyUserId(accountMap.get(wx.getAccountId()).getCompanyUserId());
|
|
|
|
|
+ companyWxClient.setCompanyId(accountMap.get(wx.getAccountId()).getCompanyId());
|
|
|
}
|
|
}
|
|
|
companyWxClient.setNickName(crmCustomer.getCustomerName());
|
|
companyWxClient.setNickName(crmCustomer.getCustomerName());
|
|
|
companyWxClient.setPhone(crmCustomer.getMobile());
|
|
companyWxClient.setPhone(crmCustomer.getMobile());
|
|
@@ -1588,6 +1700,7 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
client.setRoboticWxId(companyVoiceRoboticWx.getId());
|
|
client.setRoboticWxId(companyVoiceRoboticWx.getId());
|
|
|
client.setCompanyId(companyVoiceRoboticWx.getAccount().getCompanyId());
|
|
client.setCompanyId(companyVoiceRoboticWx.getAccount().getCompanyId());
|
|
|
client.setCompanyUserId(companyVoiceRoboticWx.getAccount().getCompanyUserId());
|
|
client.setCompanyUserId(companyVoiceRoboticWx.getAccount().getCompanyUserId());
|
|
|
|
|
+ client.setCompanyId(companyVoiceRoboticWx.getAccount().getCompanyId());
|
|
|
CompanyWxAccount account = new CompanyWxAccount();
|
|
CompanyWxAccount account = new CompanyWxAccount();
|
|
|
account.setId(companyVoiceRoboticWx.getAccount().getId());
|
|
account.setId(companyVoiceRoboticWx.getAccount().getId());
|
|
|
account.setAllocateNum(companyVoiceRoboticWx.getAccount().getAllocateNum() + 1);
|
|
account.setAllocateNum(companyVoiceRoboticWx.getAccount().getAllocateNum() + 1);
|
|
@@ -1784,8 +1897,12 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
|
}
|
|
}
|
|
|
List<CompanyAiWorkflowExecLog> callLogs = logs.stream().filter(a -> "外呼".equals(a.getNodeName())).collect(Collectors.toList());
|
|
List<CompanyAiWorkflowExecLog> callLogs = logs.stream().filter(a -> "外呼".equals(a.getNodeName())).collect(Collectors.toList());
|
|
|
- HashMap<Long,String> callContentMap = selectCallContentByCallLogs(callLogs);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ HashMap<Long,String> callContentMap;
|
|
|
|
|
+ if (null != callLogs && !callLogs.isEmpty()) {
|
|
|
|
|
+ callContentMap = selectCallContentByCallLogs(callLogs);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callContentMap = new HashMap<>();
|
|
|
|
|
+ }
|
|
|
return logs.stream().map(log -> {
|
|
return logs.stream().map(log -> {
|
|
|
WorkflowExecRecordVo.NodeExecLogVo vo = new WorkflowExecRecordVo.NodeExecLogVo();
|
|
WorkflowExecRecordVo.NodeExecLogVo vo = new WorkflowExecRecordVo.NodeExecLogVo();
|
|
|
vo.setId(log.getId());
|
|
vo.setId(log.getId());
|