userRegion、district、stateName特殊字符转意
This commit is contained in:
@@ -4,6 +4,7 @@ import java.util.Date;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
/**
|
||||
* IP复用地址池配置
|
||||
@@ -76,6 +77,7 @@ public class IpMultiplexPoolCfg extends BaseCfg<IpMultiplexPoolCfg> {
|
||||
this.direction = direction;
|
||||
}
|
||||
public String getUserRegion() {
|
||||
userRegion=BaseService.keywordsEscape(userRegion);
|
||||
return userRegion;
|
||||
}
|
||||
public void setUserRegion(String userRegion) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
/**
|
||||
* @ClassName: MaatCfg.java
|
||||
@@ -593,6 +594,7 @@ public class MaatCfg implements Serializable {
|
||||
return userRegion;
|
||||
}
|
||||
public void setUserRegion(String userRegion) {
|
||||
userRegion=BaseService.keywordsEscape(userRegion);
|
||||
this.userRegion = userRegion;
|
||||
}
|
||||
public Integer getGroupNum() {
|
||||
|
||||
@@ -336,6 +336,8 @@ public abstract class BaseService {
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
//处理配置关键字转译
|
||||
cfg.setCfgKeywords(keywordsEscape(cfg.getCfgKeywords()));
|
||||
//增强字符串转换
|
||||
cfg.setDistrict(keywordsEscape(cfg.getDistrict()));
|
||||
dstList.add(cfg);
|
||||
}
|
||||
}else if(cfgType==4){
|
||||
@@ -516,7 +518,7 @@ public abstract class BaseService {
|
||||
resStrategy.setId(Long.valueOf(cfg.getCompileId()));
|
||||
resStrategy.setCfgId(cfg.getCompileId());
|
||||
resStrategy.setReqStrateId(cfg.getCfgId());
|
||||
resStrategy.setStrateName(cfg.getCfgDesc());
|
||||
resStrategy.setStrateName(this.keywordsEscape(cfg.getCfgDesc()));
|
||||
resStrategy.setAction(cfg.getAction());
|
||||
resStrategy.setService(cfg.getServiceId());
|
||||
resStrategy.setResGroup1Id(cfg.getResGroup1Id());
|
||||
@@ -597,8 +599,7 @@ public abstract class BaseService {
|
||||
if(StringUtils.isNotEmpty(replaceContent)){
|
||||
//不转译特殊字符
|
||||
replaceContent = replaceContent.trim();//首先去掉首尾空格
|
||||
replaceContent=replaceContent.replace("/", "\\/");
|
||||
replaceContent=replaceContent.replace(" ", "\\b");
|
||||
replaceContent=replaceContent.replace("/", "\\/");//首先转意斜杠“/”
|
||||
}
|
||||
return replaceContent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user