1、多域配置时,增强字符串类的配置,多个匹配区域可组合设置为一条功能更配置域字典,也可单独设置为多条功能配置域字典【单独匹配区域设置字典时,每个匹配区域下拉列表只有一项内容,这种设置,可以灵活组合配置,但取决于具体业务是否允许这种情况】;2、关键字内容与表达式的分隔符使用特殊字符串***and***分隔,提交审核配置时下发服务的配置关键字进行特殊转义处理;3、存在与表达式的关键字内容,在界面静态显示时需处理,将***and***替换为空格。

This commit is contained in:
zhangwei
2018-06-06 14:54:14 +08:00
parent 44b149a694
commit 5a1dae8dd0
16 changed files with 68 additions and 33 deletions

View File

@@ -8,6 +8,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
@@ -336,13 +337,8 @@ public abstract class BaseService {
cfg.setRegionId(ConfigServiceUtil.getId(3, 1).get(0));
cfg.setAuditTime(baseCfg.getAuditTime());
cfg.setIsValid(baseCfg.getIsValid());
String cfgKeywords = cfg.getCfgKeywords();
cfgKeywords=cfgKeywords.replace("\\", "\\\\");
cfgKeywords=cfgKeywords.replace("&", "\\&");
cfgKeywords=cfgKeywords.replace(" ", "\\b");
//英文逗号在界面表示多个关键字的与表达式maat端以&表示
cfgKeywords=cfgKeywords.replace(",", "&");
cfg.setCfgKeywords(cfgKeywords);
//处理配置关键字转译
cfg.setCfgKeywords(keywordsEscape(cfg.getCfgKeywords()));
dstList.add(cfg);
regionValue = cfg.getCfgType();
}
@@ -560,4 +556,14 @@ public abstract class BaseService {
}
}
}
public static String keywordsEscape(String cfgKeywords){
//不转译特殊字符
cfgKeywords = StringEscapeUtils.unescapeHtml4(cfgKeywords);
cfgKeywords=cfgKeywords.replace("\\", "\\\\");
cfgKeywords=cfgKeywords.replace("&", "\\&");
cfgKeywords=cfgKeywords.replace(" ", "\\b");
//***and***在界面表示多个关键字的与表达式此特殊字符串在common.js中使用定义maat端以&表示
cfgKeywords=cfgKeywords.replace(Constants.KEYWORD_EXPR, "&");
return cfgKeywords;
}
}