From 01a79d5b431b71cc79cf5f6cc92cd4f3432781dd Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 30 四月 2024 12:39:54 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 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 45dd461..d851abe 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涓氬姟灞傚鐞�
@@ -214,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.getOptiondesc();
+            }
+
+        }
+        return null;
+    }
 }

--
Gitblit v1.9.3