diff --git a/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java b/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java index 905ea7fa4..773981328 100644 --- a/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java +++ b/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java @@ -78,6 +78,12 @@ public class ComplexkeywordCfg extends BaseCfg{ public void setCfgKeywords(String cfgKeywords) { this.cfgKeywords = cfgKeywords; } + public String getDistrictShowName() { + return districtShowName; + } + public void setDistrictShowName(String districtShowName) { + this.districtShowName = districtShowName; + } /** * exprType * 继承此类的类会覆盖该方法写自己的缺省值 diff --git a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java index 8580ea7e8..fa9d72951 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -149,12 +149,18 @@ public class WebsiteCfgService extends CrudService { 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 { 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 { 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 { 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); } } diff --git a/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp index 8e90ee395..cc10f8c06 100644 --- a/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp @@ -3,11 +3,7 @@ - +
+
@@ -134,4 +131,11 @@ $(function(){ - \ No newline at end of file + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp index 919246345..d26ca1476 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp @@ -71,6 +71,15 @@ /* $("span[title='add']").on("click", function() { $(".ipPort0").removeClass("hidden"); }); */ + $(".district").each(function(){ + if($(this).siblings(".otherValue").val()!=''){ + if($(this).val()!=$(this).siblings(".otherValue").val()){ + $(this).find("option[value=others]").attr("selected","selected"); + $(this).siblings(".otherValue").prop("type","text"); + } + } + + }); }); diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp index 5cf47faa6..f835a86a3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp @@ -92,6 +92,16 @@ /* $("span[title='add']").on("click", function() { $(".ipPort0").removeClass("hidden"); }); */ + + $(".district").each(function(){ + if($(this).siblings(".otherValue").val()!=''){ + if($(this).val()!=$(this).siblings(".otherValue").val()){ + $(this).find("option[value=others]").attr("selected","selected"); + $(this).siblings(".otherValue").prop("type","text"); + } + } + + }); });