From 50e1b73d4437df6067e2f70949cb1c5d83421d48 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Mon, 4 Jun 2018 14:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=A6=82=E6=9E=9Cdistrict=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=86=85=E5=AE=B9=E4=B8=BAothers=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=8F=AF=E6=89=8B=E5=8A=A8=E8=BE=93=E5=85=A5=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E5=8C=BA=E5=9F=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/ComplexkeywordCfg.java | 6 ++++++ .../configuration/WebsiteCfgService.java | 18 +++++++++++++++++ .../WEB-INF/views/cfg/complexCfgForm.jsp | 20 +++++++++++-------- .../WEB-INF/views/cfg/website/dnsForm.jsp | 9 +++++++++ .../WEB-INF/views/cfg/website/httpForm.jsp | 10 ++++++++++ 5 files changed, 55 insertions(+), 8 deletions(-) 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"); + } + } + + }); });