From 01bbc8f0563b33dd5ce6d59f76c3bae9931615dd Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 05 六月 2024 17:32:07 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java
index 50b52cf..8262bf3 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java
@@ -19,6 +19,8 @@
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * 鎸囨爣閫夐」搴揝ervice涓氬姟灞傚鐞�
@@ -165,7 +167,8 @@
                 }
             }
         }
-        if (CollectionUtils.isNotEmpty(ivrLibaTargetVO.getTargetoptionList())) {
+        if (CollectionUtils.isNotEmpty(ivrLibaTargetVO.getTargetoptionList()) && ivrLibaTargetVO.getValueType() == 1) {
+            //閫夐」澶勭悊
             for (IvrLibaTargetoption ivrLibaTargetoption : ivrLibaTargetVO.getTargetoptionList()) {
                 if (CollectionUtils.isNotEmpty(ivrLibaTargetoption.getNodynamiccruxs())) {
                     ivrLibaTargetoption.setNodynamiccruxsJson(new Gson().toJson(ivrLibaTargetoption.getNodynamiccruxs()));
@@ -187,6 +190,7 @@
                 }
 
             }
+        } else if (ivrLibaTargetVO.getValueType() == 2 || ivrLibaTargetVO.getValueType() == 3) {
         }
 
         return ivrLibaTarget.getId().intValue();
@@ -212,4 +216,31 @@
     public int deleteIvrLibaTargetByTargetID(Long id) {
         return ivrLibaTargetMapper.deleteIvrLibaTargetByTargetID(id);
     }
+
+    /**
+     * 鎸囨爣娴嬭瘯闂鍖归厤
+     */
+    @Override
+    public String targetQuesMate(IvrLibaTargetVO ivrLibaTargetVO) {
+
+        for (IvrLibaTargetoption ivrLibaTargetoption : ivrLibaTargetVO.getTargetoptionList()) {
+
+            Matcher matcher = null;
+            if (StringUtils.isNotEmpty(ivrLibaTargetoption.getTargetregex())) {
+                Pattern pattern = Pattern.compile(ivrLibaTargetoption.getTargetregex());
+                matcher = pattern.matcher(ivrLibaTargetVO.getContent());
+            }
+            //涓嶅寘鍚�
+            Matcher matcher2 = null;
+            if (StringUtils.isNotEmpty(ivrLibaTargetoption.getTargetregex2())) {
+                Pattern pattern2 = Pattern.compile(ivrLibaTargetoption.getTargetregex2());
+                matcher2 = pattern2.matcher(ivrLibaTargetVO.getContent());
+            }
+            if (StringUtils.isNotEmpty(ivrLibaTargetoption.getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrLibaTargetoption.getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrLibaTargetoption.getTargetregex2()) && StringUtils.isNotEmpty(ivrLibaTargetoption.getTargetregex()) && matcher.matches()) {
+                return ivrLibaTargetoption.getTargetvalue();
+            }
+
+        }
+        return null;
+    }
 }

--
Gitblit v1.9.3