From 43f7b03a3e98c98bda1b93019031c7732cba91aa Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 15:21:49 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-71309=20&&=20REPORT-71298=20=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=B1=95=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/AlphaFineUtil.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java index 0d23a6fc9..d0efa8435 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java @@ -32,6 +32,10 @@ public class AlphaFineUtil { private static String getReplacedString(String modelName, String string) { + // 如果是直接包含了高亮字符 返回 + if (modelName.contains(string)) { + return string; + } //需要考虑modelName有空格的情况 //比如现在是work boo k 搜索词是workb,应该要替换的部分是work b //先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换 @@ -53,6 +57,18 @@ public class AlphaFineUtil { return result.toString(); } + public static String escapeExprSpecialWord(String keyword) { + if (StringUtils.isNotBlank(keyword)) { + String[] fbsArr = { "\\", "$", "(", ")", "*", "+", ".", "[", "]", "?", "^", "{", "}", "|" }; + for (String key : fbsArr) { + if (keyword.contains(key)) { + keyword = keyword.replace(key, "\\" + key); + } + } + } + return keyword; + } + public static boolean unread() { Set readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); Set idSet = ProductNewsSearchManager.getInstance().getIdSet();