(1)修复审核时json未携带tableName,userRegion的bug
(2)packet ip 限速修改导入模板 (3)packet ip 限速导入逻辑修改 (4)IP白名单导入添加
This commit is contained in:
@@ -7,13 +7,13 @@ import com.nis.util.excel.ExcelField;
|
||||
*
|
||||
*/
|
||||
public class IpRateLimitTemplate extends IpAllTemplate {
|
||||
|
||||
private String userRegion1;
|
||||
public static String userRegion1="0";
|
||||
private String userRegion2;
|
||||
@ExcelField(title="ratelimit",dictType="RATE_LIMIT",align=2,sort=2)
|
||||
public String getUserRegion1() {
|
||||
return userRegion1;
|
||||
public String getUserRegion2() {
|
||||
return userRegion2;
|
||||
}
|
||||
public void setUserRegion1(String userRegion1) {
|
||||
this.userRegion1 = userRegion1;
|
||||
public void setUserRegion2(String userRegion2) {
|
||||
this.userRegion2 = userRegion2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1311,25 +1311,44 @@ public class BaseController {
|
||||
// 特殊字段验证
|
||||
// packet ip ratelimit
|
||||
if (serviceDict!=null&&serviceDict.getFunctionId().intValue() == 5 && serviceDict.getAction().intValue() == 64) {
|
||||
String userRegion1 = baseIpCfg.getUserRegion1();
|
||||
try {
|
||||
// Double ratelimt= Double.parseDouble(userRegion1);
|
||||
List<SysDataDictionaryItem> ratelimtList = DictUtils.getDictList("RATE_LIMIT");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem ratelimit : ratelimtList) {
|
||||
if (ratelimit.getItemCode().equals(userRegion1)) {
|
||||
has = true;
|
||||
break;
|
||||
String userRegion1 = IpRateLimitTemplate.userRegion1;
|
||||
baseIpCfg.setUserRegion1(userRegion1);
|
||||
if("0".equals(userRegion1)) {
|
||||
String userRegion2 = baseIpCfg.getUserRegion2();
|
||||
try {
|
||||
// Double ratelimt= Double.parseDouble(userRegion2);
|
||||
List<SysDataDictionaryItem> ratelimtList = DictUtils.getDictList("RATE_LIMIT");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem ratelimit : ratelimtList) {
|
||||
if (ratelimit.getItemCode().equals(userRegion2)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!has) {
|
||||
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 (!has) {
|
||||
errInfo.append(prop.getProperty("ratelimit") + "."
|
||||
+ String.format(prop.getProperty("must_between"), 0.001, 0.009) + ";");
|
||||
}else if("1".equals(userRegion1)) {
|
||||
String userRegion3 = baseIpCfg.getUserRegion3();
|
||||
if (StringUtils.isNotBlank(userRegion3)) {
|
||||
try {
|
||||
Integer ratelimt=Integer.parseInt(userRegion3);
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("bandwith")) + ";");
|
||||
}
|
||||
}else {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("bandwith")) + ";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("ratelimit")) + ";");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// payload ip
|
||||
if (regionDict.getFunctionId().equals(212)) {
|
||||
@@ -3150,7 +3169,7 @@ public class BaseController {
|
||||
_cfg.setTableName(AsnIpCfg.getTablename());
|
||||
_cfg.setAction(0);
|
||||
_cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
_cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
// _cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
_cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
_cfg.setCreateTime(date);
|
||||
_cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
|
||||
@@ -556,7 +556,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
}
|
||||
}
|
||||
for(IpPortCfg cfg:entity.getIpPortList()) {
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId","cfgType","userRegion1","userRegion2","userRegion3","userRegion4","userRegion5"});
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
ipCfgDao.auditCfg(cfg);
|
||||
/*BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","userRegion2","userRegion3","userRegion4","userRegion5","ipType","direction",
|
||||
|
||||
Reference in New Issue
Block a user