From 990ddfd92bfe81eb3396d741a3ce9106ea5e132f Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 31 七月 2026 14:11:24 +0800
Subject: [PATCH] 【市一】报错调整
---
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
index 1bbf460..6c932e0 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -1812,13 +1812,10 @@
//鐢ㄦ潵鏍囪锛屾槸鍚︽湁鍖归厤涓婄殑
Integer flag = 0;
//1-AI璇嗗埆
- SysConfig configVoiceMatchAi = new SysConfig();
- configVoiceMatchAi.setOrgid(phoneCallReqYQVO.getOrgid());
- configVoiceMatchAi.setConfigKey("sys.voice.match.ai.url");
- SysConfig matchAi = sysConfigMapper.selectConfig(configVoiceMatchAi);
+ String url = configService.selectConfigByKey("sys.voice.match.ai.url",phoneCallReqYQVO.getOrgid());
- if (ObjectUtils.isNotEmpty(matchAi) && StringUtils.isNotEmpty(matchAi.getConfigValue())) {
- PhoneCallBackYQVO aiMatchResult = AiMatch(phoneCallReqYQVO, phoneCallBackYQVO,
+ if (ObjectUtils.isNotEmpty(url)) {
+ PhoneCallBackYQVO aiMatchResult = AiMatch(url, phoneCallReqYQVO, phoneCallBackYQVO,
ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate,
ivrTaskTemplateScripts, scriptId, flag, phoneCallReqYQVO.getUuid());
if(aiMatchResult != null){
@@ -5060,7 +5057,7 @@
* @param options
* @return
*/
- public Integer matchOptionIndex(String questionText, String voiceText, List<IvrTaskTemplateTargetoption> options, String uuid){
+ public Integer matchOptionIndex(String url, String questionText, String voiceText, List<IvrTaskTemplateTargetoption> options, String uuid){
JSONObject jsonObject = new JSONObject();
jsonObject.put("userQuestion",questionText);
jsonObject.put("userAnswer",voiceText);
@@ -5070,7 +5067,6 @@
String result = null;
// String url = "http://localhost:8099/matchOptionIndex";
- String url = configService.selectConfigByKey("sys.voice.match.ai.url");
if(StringUtils.isNotEmpty(url)){
try {
Map<String, String> headers = new HashMap<>();
@@ -5088,7 +5084,7 @@
}
}
- public PhoneCallBackYQVO AiMatch(PhoneCallReqYQVO phoneCallReqYQVO, PhoneCallBackYQVO phoneCallBackYQVO,
+ public PhoneCallBackYQVO AiMatch(String url, PhoneCallReqYQVO phoneCallReqYQVO, PhoneCallBackYQVO phoneCallBackYQVO,
IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, ServiceSubtask serviceSubtask, IvrTaskTemplate ivrTaskTemplate,
List<IvrTaskTemplateScript> ivrTaskTemplateScripts, String scriptId, Integer flag, String uuid){
PhoneCallBackYQVO back = null;
@@ -5096,7 +5092,7 @@
String voiceText = phoneCallReqYQVO.getAsrtext();
String questionText = StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrtext()) ? ivrTaskTemplateScriptVO.getIvrtext() : ivrTaskTemplateScriptVO.getScriptContent();
Integer matched = -1;
- matched = matchOptionIndex(questionText, voiceText, options, uuid);
+ matched = matchOptionIndex(url, questionText, voiceText, options, uuid);
//璇存槑鍖归厤姝g‘浜�
if(matched != null && matched >= 0){
IvrTaskTemplateTargetoption chosenOption = options.get(matched);
@@ -5332,8 +5328,9 @@
IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption3 = new IvrTaskTemplateTargetoption();
ivrTaskTemplateTargetoption3.setTargetvalue("鍏朵粬");
options.add(ivrTaskTemplateTargetoption3);
-
- Integer matched = matchOptionIndex(questionText,voiceText,options,"1");
+ //1-AI璇嗗埆
+ String url = configService.selectConfigByKey("sys.voice.match.ai.url");
+ Integer matched = matchOptionIndex(url, questionText,voiceText,options,"1");
if(ObjectUtils.isNotEmpty(matched)){
if(matched >= 0){
matchedText = options.get(matched).getTargetvalue();
--
Gitblit v1.9.3