From 1c991536968257b5e1e79169c93348ed6d3e6a8f Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 17 May 2022 14:06:00 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-70681=20=E6=90=9C=E7=B4=A2=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6=20=E9=AB=98?= =?UTF-8?q?=E4=BA=AE=E5=B1=95=E7=A4=BA=E6=97=B6=20=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/alphafine/AlphaFineUtil.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 814bc3530d..5648ab98d6 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 @@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager; +import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; import java.util.Set; @@ -13,10 +14,15 @@ import java.util.Set; public class AlphaFineUtil { public static String highLightModelName(String modelName, String[] strings) { - if (strings == null) { + if (strings == null || ArrayUtils.isEmpty(strings)) { return modelName; } for (String string : strings) { + // 高亮分词 跳过高亮颜色本身的字符 + boolean skipHighLight = modelName.contains(AlphaFineConstants.HIGH_LIGHT_COLOR) && AlphaFineConstants.HIGH_LIGHT_COLOR.contains(string); + if (skipHighLight) { + continue; + } String primaryStr = getReplacedString(modelName, string); if (StringUtils.isNotEmpty(primaryStr)) { modelName = modelName.replaceAll("(?i)" + primaryStr, "|" + primaryStr + "|");