增强字符串配置,如果district字段内容为others,用户可手动输入匹配区域。

This commit is contained in:
zhangwei
2018-06-04 14:31:26 +08:00
parent 24c37c1834
commit 50e1b73d44
5 changed files with 55 additions and 8 deletions

View File

@@ -149,12 +149,18 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
if(entity.getHttpReqHdrList()!=null){
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveHttpReqHdrCfg(cfg);
}
}
if(entity.getHttpResHdrList()!=null){
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveHttpResHdrCfg(cfg);
}
}
@@ -213,12 +219,18 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
if(entity.getHttpReqHdrList()!=null){
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveHttpReqHdrCfg(cfg);
}
}
if(entity.getHttpResHdrList()!=null){
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveHttpResHdrCfg(cfg);
}
}
@@ -683,6 +695,9 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
for(ComplexkeywordCfg cfg:entity.getDomainList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveDnsDomainCfg(cfg);
}
}
@@ -722,6 +737,9 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
for(ComplexkeywordCfg cfg:entity.getDomainList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveDnsDomainCfg(cfg);
}
}