优化asn ip导入,减少循环次数,减少调用综合服务接口次数

This commit is contained in:
wangxin
2018-11-05 19:03:15 +08:00
parent 0607a68a38
commit b64d26e7f6
3 changed files with 20 additions and 17 deletions

View File

@@ -3352,6 +3352,7 @@ public class BaseController {
if (regionDict.getRegionType().equals(1)) {// IP
if(regionDict.getFunctionId().intValue()==600) {//ans ip
Map<String,List<AsnIpCfg>> asnIpCfgs=new HashMap<>();
int total=ipPortCfgs.size();
for (BaseIpCfg cfg : ipPortCfgs) {
AsnIpCfg _cfg=new AsnIpCfg();
BeanUtils.copyProperties(cfg, _cfg);
@@ -3381,7 +3382,7 @@ public class BaseController {
}
}
ipPortCfgs.clear();
asnIpCfgService.saveAsnIpBatch(asnIpCfgs);
asnIpCfgService.saveAsnIpBatch(asnIpCfgs,total);
}else {
List<Integer> compileIds=Lists.newArrayList();
List<Integer> regionIds=Lists.newArrayList();