From 5db7759db3fa6792155d72139f9d5d9e56eb3436 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期四, 23 七月 2026 17:05:15 +0800
Subject: [PATCH] 【丽水】回写语言判断 增加AI识别

---
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java |   46 +++++++++++++++++++++++++++++++++-------------
 1 files changed, 33 insertions(+), 13 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 e7d2dc6..36f658e 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -16,6 +16,7 @@
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.system.domain.SysConfig;
 import com.ruoyi.system.mapper.SysConfigMapper;
+import com.smartor.common.DeepSeekApi;
 import com.smartor.common.FtpService;
 import com.smartor.common.MtSubmitSmUtil;
 import com.smartor.config.PhoneUtils;
@@ -1666,20 +1667,39 @@
                     if (StringUtils.isEmpty(phoneCallReqYQVO.getAsrtext())) {
                         continue;
                     }
-                    //鍖呭惈
-                    Matcher matcher = null;
-                    if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex())) {
-                        Pattern pattern = Pattern.compile(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex());
-                        matcher = pattern.matcher(phoneCallReqYQVO.getAsrtext());
+                    //2-AI璇嗗埆
+                    SysConfig configVoiceMatchType = new SysConfig();
+                    configVoiceMatchType.setOrgid(phoneCallReqYQVO.getOrgid());
+                    configVoiceMatchType.setConfigKey("sys.voice.match.type");
+                    SysConfig matchType = sysConfigMapper.selectConfig(configVoiceMatchType);
+                    boolean matchedFlag = false;
+                    if(ObjectUtils.isNotEmpty(matchType) && StringUtils.isNotEmpty(matchType.getConfigValue()) && matchType.getConfigValue().equals("2")){
+                        int checkFlag = DeepSeekApi.matchQuestionAnswer(ivrTaskTemplateScriptVO.getScriptContent(),
+                                phoneCallReqYQVO.getAsrtext(),
+                                ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue());
+                        if(checkFlag == 1){
+                            matchedFlag = true;
+                        }
+                    }else {
+                        //鍖呭惈
+                        Matcher matcher = null;
+                        if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex())) {
+                            Pattern pattern = Pattern.compile(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex());
+                            matcher = pattern.matcher(phoneCallReqYQVO.getAsrtext());
+                        }
+                        //涓嶅寘鍚�
+                        Matcher matcher2 = null;
+                        if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2())) {
+                            Pattern pattern2 = Pattern.compile(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2());
+                            matcher2 = pattern2.matcher(phoneCallReqYQVO.getAsrtext());
+                        }
+
+                        if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) {
+                            matchedFlag = true;
+                        }
                     }
-                    //涓嶅寘鍚�
-                    Matcher matcher2 = null;
-                    if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2())) {
-                        Pattern pattern2 = Pattern.compile(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2());
-                        matcher2 = pattern2.matcher(phoneCallReqYQVO.getAsrtext());
-                    }
-                    if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) {
-                        //璇存槑鍖归厤姝g‘浜�
+                    //璇存槑鍖归厤姝g‘浜�
+                    if(matchedFlag){
                         //杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉�
                         log.info("鍖归厤姝g‘浜嗗悧--------------");
                         ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(1);

--
Gitblit v1.9.3