From daa2e55682202caf5121f466194c0ff366a4e423 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Thu, 10 Jan 2019 18:32:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=AF=BC=E5=85=A5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E2=80=98=E9=85=8D=E7=BD=AE=E6=8F=8F=E8=BF=B0=E2=80=99?= =?UTF-8?q?=E9=9D=9E=E7=A9=BA=E9=99=90=E5=88=B6=EF=BC=9Bdns=20block?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=AF=BC=E5=85=A5=E5=A2=9E=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=AD=96=E7=95=A5=EF=BC=9B=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A1=8C=E4=B8=BA=E7=BB=9F=E8=AE=A1=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...heckAppFeatureComplexStringFormatThread.java | 17 +++++++---------- .../thread/CheckComplexStringFormatThread.java | 9 ++++++++- .../util/excel/thread/CheckIpFormatThread.java | 11 +++++++++-- .../excel/thread/CheckStringFormatThread.java | 8 ++++++-- .../thread/CheckTopicWebsiteFormatThread.java | 8 ++++++-- .../views/dashboard/trafficUserBehavior.jsp | 4 ++-- 6 files changed, 38 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java index 8d5080f0e..2d6a4917b 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java @@ -92,8 +92,12 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable 128) { + String cfgDesc = baseStringCfg.getCfgDesc(); + // 配置描述限制 + if(StringUtils.isBlank(cfgDesc)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("config_describe")) + ";"); + }else if(cfgDesc.length() > 128) { errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); } @@ -151,14 +155,7 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); ComplexkeywordCfg baseStringCfg = new ComplexkeywordCfg(); BeanUtils.copyProperties(list.get(i), baseStringCfg); + String cfgDesc = baseStringCfg.getCfgDesc(); // 配置描述、关键字长度限制 - if(baseStringCfg.getCfgDesc().length() > 128) { + if(StringUtils.isBlank(cfgDesc)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("config_describe")) + ";"); + }else if(cfgDesc.length() > 128) { errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); } if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){ @@ -101,6 +105,9 @@ public class CheckComplexStringFormatThread implements Callable{ if (regionDict.getRegionType().equals(3)) { if (regionDict.getFunctionId().equals(7)) { Long dnsStrategyId = baseStringCfg.getDnsStrategyId(); + if(dnsStrategyId == null) { // 默认策略 + dnsStrategyId = Long.parseLong("0"); + } if (dnsStrategyId != null&&dnsStrategyId>0) { List dnsStrategys = DictUtils.getDnsResStrategyList(dnsStrategyId); if (dnsStrategys == null || dnsStrategys.size() == 0) { diff --git a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java index 6ce938705..9fef5f059 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java @@ -104,8 +104,12 @@ public class CheckIpFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); IpPortCfg baseIpCfg = new IpPortCfg(); BeanUtils.copyProperties(list.get(i), baseIpCfg); - // 配置描述长度限制 - if(baseIpCfg.getCfgDesc()!=null&&baseIpCfg.getCfgDesc().length() > 128) { + String cfgDesc = baseIpCfg.getCfgDesc(); + // 配置描述限制 + if(StringUtils.isBlank(cfgDesc)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("config_describe")) + ";"); + }else if(cfgDesc.length() > 128) { errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); } @@ -182,6 +186,9 @@ public class CheckIpFormatThread implements Callable{ // dns ip if (regionDict.getFunctionId().equals(7)) { Integer dnsStrategyId = baseIpCfg.getDnsStrategyId(); + if(dnsStrategyId == null) { // 默认策略 + dnsStrategyId = 0; + } if (dnsStrategyId != null&&dnsStrategyId>0) { List dnsStrategys = DictUtils.getDnsResStrategyList(Long.valueOf(dnsStrategyId)); if (dnsStrategys == null || dnsStrategys.size() == 0) { diff --git a/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java index eead68a72..bc4a6bf9f 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java @@ -88,8 +88,12 @@ public class CheckStringFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); BaseStringCfg baseStringCfg = new BaseStringCfg(); BeanUtils.copyProperties(list.get(i), baseStringCfg); - // 配置描述、关键字长度限制 - if(baseStringCfg.getCfgDesc().length() > 128) { + String cfgDesc = baseStringCfg.getCfgDesc(); + // 配置描述限制 + if(StringUtils.isBlank(cfgDesc)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("config_describe")) + ";"); + }else if(cfgDesc.length() > 128) { errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); } diff --git a/src/main/java/com/nis/util/excel/thread/CheckTopicWebsiteFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckTopicWebsiteFormatThread.java index bc22c1337..13dad284a 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckTopicWebsiteFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckTopicWebsiteFormatThread.java @@ -89,8 +89,12 @@ public class CheckTopicWebsiteFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); AppTopicDomainCfg baseStringCfg = new AppTopicDomainCfg(); BeanUtils.copyProperties(list.get(i), baseStringCfg); - // 配置描述、关键字长度限制 - if(baseStringCfg.getCfgDesc().length() > 128) { + String cfgDesc = baseStringCfg.getCfgDesc(); + // 配置描述限制 + if(StringUtils.isBlank(cfgDesc)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("config_describe")) + ";"); + }else if(cfgDesc.length() > 128) { errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); } diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp index 09d7177b4..ded2b39c9 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp @@ -222,7 +222,7 @@ <%-- value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${nowTime}'});"/> --%> + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchFoundStartTime','#searchFoundEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -234,7 +234,7 @@ <%-- value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${nowTime}'});"/> --%> + value="${log.searchFoundEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchFoundStartTime','#searchFoundEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>