(1)修复字段域导入时获取字典值失败原值被替换为空,影响验证的bug
(2)packet ip ratelimit 字段验证 (3)packet ip 滚动条修复
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -85,8 +85,6 @@
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<!-- 模板导入,start -->
|
||||
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<shiro:hasPermission name="iplist:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
@@ -473,6 +471,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 模板导入,start -->
|
||||
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user