IPSpoofing配置批量审核操作增加欺骗IP池配置处理,修正图片样例批量审核功能
This commit is contained in:
@@ -69,6 +69,7 @@ import com.nis.web.dao.basics.AsnGroupInfoDao;
|
||||
import com.nis.web.dao.configuration.AppCfgDao;
|
||||
import com.nis.web.dao.configuration.CommonPolicyDao;
|
||||
import com.nis.web.dao.configuration.ConfigSynchronizationDao;
|
||||
import com.nis.web.dao.configuration.PxyObjSpoofingIpPoolDao;
|
||||
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -94,6 +95,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
protected AsnGroupInfoDao asnGroupInfoDao;
|
||||
@Autowired
|
||||
protected AppCfgDao appCfgDao;
|
||||
@Autowired
|
||||
protected PxyObjSpoofingIpPoolDao pxyObjSpoofingIpPoolDao;
|
||||
|
||||
private boolean lastServiceTag = false;//标识是否是最后一个同步业务
|
||||
private boolean isFinished = false;
|
||||
/**
|
||||
@@ -293,8 +297,12 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
configCompileList = new ArrayList();
|
||||
List<Integer> compileIds = new ArrayList();
|
||||
List<String> asnGroupIds = new ArrayList();
|
||||
List<String> spoofingPoolCfgIds = new ArrayList();
|
||||
for(CfgIndexInfo cfg:list){
|
||||
compileIds.add(cfg.getCompileId());
|
||||
if(entity.getServiceId().equals(518)){ // IP_Spoofing
|
||||
spoofingPoolCfgIds.add(cfg.getUserRegion3());
|
||||
}
|
||||
/*if(entity.getServiceId().equals(37)||entity.getServiceId().equals(149)){
|
||||
asnGroupIds.add(cfg.getUserRegion4());
|
||||
}*/
|
||||
@@ -335,12 +343,43 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
if(!StringUtil.isEmpty(asnGroupIds)) {
|
||||
commonPolicyDao.auditCfgBatch(tableName, entity,asnGroupIds,null);
|
||||
}
|
||||
}else if(tableName.equals("pxy_obj_spoofing_ip_pool")) {
|
||||
if(!StringUtil.isEmpty(spoofingPoolCfgIds)) {
|
||||
commonPolicyDao.auditCfgBatch(tableName, entity,spoofingPoolCfgIds,null);
|
||||
}
|
||||
}else{
|
||||
commonPolicyDao.auditCfgBatch( tableName, entity,compileIds,null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(entity.getServiceId().equals(518)){// IP仿冒策略
|
||||
List<PxyObjSpoofingIpPool> poolList = new ArrayList<PxyObjSpoofingIpPool>();
|
||||
String json="";
|
||||
for (String cfgId : spoofingPoolCfgIds) {
|
||||
PxyObjSpoofingIpPool pool = new PxyObjSpoofingIpPool();
|
||||
pool = pxyObjSpoofingIpPoolDao.getPxyObjSpoofingIpPool(Long.parseLong(cfgId));
|
||||
pool.setAreaEffectiveIds("0");
|
||||
pool.setGroupId(pool.getCfgId().intValue());// 界面端的配置ID作为策略分组ID
|
||||
poolList.add(pool);
|
||||
}
|
||||
// 调用服务接口下发配置数据
|
||||
json=gsonToJson(poolList);
|
||||
// logger.info("欺骗IP池配置批量下发配置参数:"+json);
|
||||
// 调用服务接口下发配置
|
||||
try {
|
||||
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
||||
if(result!=null){
|
||||
logger.info("欺骗IP池配置批量下发响应信息:"+result.getMsg());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("欺骗IP池配置批量下发失败",e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//批量获取regionId,groupId(相同编译下的IP类配置多条ip只获取一个组号),分组复用的域配置不需要重新获取regionId,groupId
|
||||
List<Integer> regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
List<Integer> groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
@@ -478,7 +517,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
String json=gsonToJson(maatBean);
|
||||
//调用服务接口下发配置数据
|
||||
if(isUpdateCfg) {
|
||||
// logger.info("配置批量下发:"+json);
|
||||
logger.info("配置批量下发:"+json);
|
||||
//调用服务接口同步回调类配置
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
if(result!=null){
|
||||
|
||||
Reference in New Issue
Block a user