diff --git a/src/main/java/com/nis/util/excel/ImportExcel.java b/src/main/java/com/nis/util/excel/ImportExcel.java index 05a939490..5256a4dbf 100644 --- a/src/main/java/com/nis/util/excel/ImportExcel.java +++ b/src/main/java/com/nis/util/excel/ImportExcel.java @@ -359,7 +359,11 @@ public class ImportExcel { ExcelField ef = (ExcelField)os[0]; // If is dict type, get dict value if (StringUtils.isNotBlank(ef.dictType())){ - val = DictUtils.getDictCode(ef.dictType(), val.toString(), ""); + Object val1 = DictUtils.getDictCode(ef.dictType(), val.toString(), ""); + //没有获取到字典值的话会影响验证判断 + if(val1!=null&&StringUtils.isNotBlank(val1.toString())) { + val=val1; + } //log.debug("Dictionary type value: ["+i+","+colunm+"] " + val); } // Get param type and type cast diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 7d93f7b33..daa8bb747 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -825,6 +825,21 @@ public class BaseController { StringBuffer errInfo = new StringBuffer(); IpPortCfg baseIpCfg = new IpPortCfg(); BeanUtils.copyProperties(list.get(i), baseIpCfg); + //特殊字段验证 + //packet ip ratelimit + if(serviceDict.getFunctionId().intValue()==5&&serviceDict.getAction().intValue()==64) { + String userRegion1=baseIpCfg.getUserRegion1(); + try { + Double ratelimt= Double.parseDouble(userRegion1); + if(ratelimt>0.009||ratelimt<0.001) { + errInfo.append(prop.getProperty("ratelimit")+"."+String.format(prop.getProperty("must_between"),0.001,0.009)); + } + } catch (Exception e) { + // TODO: handle exception + errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("ratelimit"))); + } + } + if (regionDict.getRegionType().equals(1)) { // 校验必填的IP,端口 for (String code : configIpPortShow.split(",")) { @@ -1205,7 +1220,7 @@ public class BaseController { } } if (!has) { - errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("direction")) + "," + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("direction")) + "." + String.format(prop.getProperty("alternative_values"), directionPattern) + ";"); } return has; @@ -1233,7 +1248,7 @@ public class BaseController { } } if (!has) { - errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("protocol")) + "," + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("protocol")) + "." + String.format(prop.getProperty("alternative_values"), protocolPattern) + ";"); } return has; diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp index d17c98064..49dab435d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp @@ -85,8 +85,6 @@
- - <%@include file="/WEB-INF/include/excel/importModal.jsp" %>
- + + <%@include file="/WEB-INF/include/excel/importModal.jsp" %> \ No newline at end of file