From dfdedd9df6386d062a8889d1cb5883f3294e0bb5 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 29 七月 2026 09:10:12 +0800
Subject: [PATCH] 【丽水】JZ_MZ_WanChengJZ 就诊信息同步生成随访任务

---
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 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 35b9597..67be372 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -1745,15 +1745,15 @@
                 configVoiceMatchAi.setConfigKey("sys.voice.match.ai");
                 SysConfig matchAi = sysConfigMapper.selectConfig(configVoiceMatchAi);
 
-//            if (ObjectUtils.isNotEmpty(matchAi) && StringUtils.isNotEmpty(matchAi.getConfigValue())
-//                    && matchAi.getConfigValue().equals("1")) {
-//                PhoneCallBackYQVO aiMatchResult = AiMatch(phoneCallReqYQVO, phoneCallBackYQVO,
-//                        ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate,
-//                        ivrTaskTemplateScripts, scriptId, flag);
-//                if(aiMatchResult != null){
-//                    return aiMatchResult;
-//                }
-//            } else {
+            if (ObjectUtils.isNotEmpty(matchAi) && StringUtils.isNotEmpty(matchAi.getConfigValue())
+                    && matchAi.getConfigValue().equals("1")) {
+                PhoneCallBackYQVO aiMatchResult = AiMatch(phoneCallReqYQVO, phoneCallBackYQVO,
+                        ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate,
+                        ivrTaskTemplateScripts, scriptId, flag, phoneCallReqYQVO.getUuid());
+                if(aiMatchResult != null){
+                    return aiMatchResult;
+                }
+            } else {
                 //鏄�夋嫨棰�
                 for (int j = 0; j < ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().size(); j++) {
                     log.error("phoneCallReqYQVO.getAsrtext()鐨勫�间负锛歿}", phoneCallReqYQVO.getAsrtext());
@@ -1995,7 +1995,7 @@
                         continue;
                     }
                 }
-//            }
+            }
                 //閮芥病鏈夊尮閰嶅埌
                 if (StringUtils.isEmpty(phoneCallBackYQVO.getValue())) {
                     log.info("閮芥病鏈夊尮閰嶅埌-------------------------");
@@ -4981,11 +4981,12 @@
      * @param options
      * @return
      */
-    public Integer matchOptionIndex(String questionText, String voiceText, List<IvrTaskTemplateTargetoption> options){
+    public Integer matchOptionIndex(String questionText, String voiceText, List<IvrTaskTemplateTargetoption> options, String uuid){
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("userQuestion",questionText);
         jsonObject.put("userAnswer",voiceText);
         jsonObject.put("options", options);
+        jsonObject.put("uuid", uuid);
         String jsonString = jsonObject.toJSONString();
         String result = null;
 
@@ -5010,13 +5011,13 @@
 
     public PhoneCallBackYQVO AiMatch(PhoneCallReqYQVO phoneCallReqYQVO, PhoneCallBackYQVO phoneCallBackYQVO,
                         IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, ServiceSubtask serviceSubtask, IvrTaskTemplate ivrTaskTemplate,
-                        List<IvrTaskTemplateScript> ivrTaskTemplateScripts, String scriptId, Integer flag){
+                        List<IvrTaskTemplateScript> ivrTaskTemplateScripts, String scriptId, Integer flag, String uuid){
         PhoneCallBackYQVO back = null;
         List<IvrTaskTemplateTargetoption> options = ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList();
         String voiceText = phoneCallReqYQVO.getAsrtext();
         String questionText = StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrtext()) ? ivrTaskTemplateScriptVO.getIvrtext() : ivrTaskTemplateScriptVO.getScriptContent();
         Integer matched = -1;
-        matched = matchOptionIndex(questionText, voiceText, options);
+        matched = matchOptionIndex(questionText, voiceText, options, uuid);
         //璇存槑鍖归厤姝g‘浜�
         if(matched != null && matched >= 0){
             IvrTaskTemplateTargetoption chosenOption = options.get(matched);
@@ -5253,7 +5254,7 @@
         ivrTaskTemplateTargetoption3.setTargetvalue("鍏朵粬");
         options.add(ivrTaskTemplateTargetoption3);
 
-        Integer matched = matchOptionIndex(questionText,voiceText,options);
+        Integer matched = matchOptionIndex(questionText,voiceText,options,"1");
         if(ObjectUtils.isNotEmpty(matched)){
             if(matched >= 0){
                 matchedText = options.get(matched).getTargetvalue();

--
Gitblit v1.9.3