(1)dns欺骗ip模板替换,不和dnsip共用

(2)导入一行格式错误不终止导入,略过该行继续导入
This commit is contained in:
wangxin
2018-12-20 15:53:02 +06:00
parent 87e3a77d7e
commit 81ddac4f9f
9 changed files with 157 additions and 83 deletions

View File

@@ -0,0 +1,35 @@
/**
*@Title: BaseStringConfig.java
*@Package com.nis.domain.restful
*@Description TODO
*@author dell
*@date 2018年2月5日 下午5:26:02
*@version 版本号
*/
package com.nis.domain.configuration.template;
import com.nis.util.excel.ExcelField;
/**
* @Description: excel导入DNS IP类配置
*/
public class DnsFakeIpTemplate extends IpAllTemplate {
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么
*
* @since 1.0.0
*/
private Integer dnsStrategyId;
@ExcelField(title="group",align=2,sort=2)
public Integer getDnsStrategyId() {
return dnsStrategyId;
}
public void setDnsStrategyId(Integer dnsStrategyId) {
this.dnsStrategyId = dnsStrategyId;
}
}

View File

@@ -339,6 +339,18 @@ public class ExportExcel {
}
if("group".equals(headerStr)) {
commentStr="";
if(region.getFunctionId()==401) {
//查询dns fake ip policyGroup列表
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByType(1);
if(!StringUtil.isEmpty(list)){
for (PolicyGroupInfo policyGroupInfo : list) {
commentStr=commentStr+policyGroupInfo.getGroupId()+""+policyGroupInfo.getGroupName()+"\n";
index++;
}
}
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
index++;
}else {
//查询ip复用地址池配置的policyGroup列表
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByType(2);
if(!StringUtil.isEmpty(list)){
@@ -350,6 +362,8 @@ public class ExportExcel {
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
index++;
}
}
if("isp".equals(headerStr)) {
commentStr="";
List<Integer> itTypeList = new ArrayList<Integer>();

View File

@@ -480,7 +480,7 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
}
}
} catch (Exception ex) {
log.info("Get cell value ["+i+","+column+"] error: " + ex.toString());
log.debug("Get cell value ["+i+","+column+"] error: " + ex.toString());
val = null;
}
// set entity value

View File

@@ -42,24 +42,26 @@ public class CheckComplexStringFormatThread implements Callable<String>{
@Override
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
String msg=null;
StringBuffer msg=new StringBuffer();
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==3) {
try {
List<ComplexkeywordCfg> cfgs=this.checkComplexStringCfg(dataList);
List<ComplexkeywordCfg> cfgs=this.checkComplexStringCfg(msg,dataList);
destQueue.addAll(cfgs);
}catch (Exception e) {
logger.error("checkComplexStringCfg error,",e);
// TODO: handle exception
msg=e.getMessage();
break;
//msg=e.getMessage();
//msg.append(e.getMessage());
//break;
}
}
dataList.clear();
}
return msg;
return msg.toString();
}
public List<ComplexkeywordCfg> checkComplexStringCfg(
public List<ComplexkeywordCfg> checkComplexStringCfg(StringBuffer msg,
List<?> list) throws ServiceException {
logger.warn("start to validate complexString data...");
long start=System.currentTimeMillis();
@@ -233,9 +235,9 @@ public class CheckComplexStringFormatThread implements Callable<String>{
Integer isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
if (isHex == null || isCaseInsenstive == null) {
if (isHex == null) {
if (hexP.equals("0") || hexP.equals("2")) {
if (hexP.indexOf("0")>-1 || hexP.indexOf("2")>-1) {
baseStringCfg.setIsHex(0);
} else if (hexP.equals("1")) {
} else if (hexP.indexOf("1")>-1) {
baseStringCfg.setIsHex(1);
} else {
errInfo.append(
@@ -243,9 +245,9 @@ public class CheckComplexStringFormatThread implements Callable<String>{
}
}
if (isCaseInsenstive == null) {
if (hexP.equals("0") || hexP.equals("1")) {
if (hexP.indexOf("0")>-1 || hexP.indexOf("1")>-1) {
baseStringCfg.setIsCaseInsenstive(0);
} else if (hexP.equals("2")) {
} else if (hexP.indexOf("2")>-1) {
baseStringCfg.setIsCaseInsenstive(1);
} else {
errInfo.append(String.format(prop.getProperty("can_not_null"),
@@ -299,11 +301,13 @@ public class CheckComplexStringFormatThread implements Callable<String>{
errTip.append(String.format(prop.getProperty("line"), baseStringCfg.getIndex()) + ",");
errTip.append(errInfo);
errTip.append("<br>");
}
}else {
stringList.add(baseStringCfg);
}
}
if (errTip.toString().length() > 0) {
throw new ServiceException(errTip.toString());
msg.append(errTip);
//throw new ServiceException(errTip.toString());
}
long end=System.currentTimeMillis();
logger.warn("validate complexString data finish,cost:"+(end-start));

View File

@@ -41,24 +41,25 @@ public class CheckDnsResStrategyFormatThread implements Callable<String>{
@Override
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
String msg=null;
StringBuffer msg=new StringBuffer();
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==6) {
try {
List<DnsResStrategy> cfgs=this.checkDnsResStrategyCfg(dataList);
List<DnsResStrategy> cfgs=this.checkDnsResStrategyCfg(msg,dataList);
destQueue.addAll(cfgs);
}catch (Exception e) {
logger.error("checkDnsResStrategyCfg error",e);
// TODO: handle exception
msg=e.getMessage();
break;
//msg=e.getMessage();
//break;
}
}
dataList.clear();
}
return msg;
return msg.toString();
}
public List<DnsResStrategy> checkDnsResStrategyCfg(List<?> list)
public List<DnsResStrategy> checkDnsResStrategyCfg(StringBuffer msg,List<?> list)
throws ServiceException {
List<DnsResStrategy> dnsResStrategies=Lists.newArrayList();
StringBuffer errTip = new StringBuffer();
@@ -129,11 +130,14 @@ public class CheckDnsResStrategyFormatThread implements Callable<String>{
errTip.append(String.format(prop.getProperty("line"), dnsResStrategy.getIndex()) + ",");
errTip.append(errInfo);
errTip.append("<br>");
}
}else {
dnsResStrategies.add(dnsResStrategy);
}
}
if (errTip.toString().length() > 0) {
throw new ServiceException(errTip.toString());
msg.append(errTip);
//throw new ServiceException(errTip.toString());
}
return dnsResStrategies;
}

View File

@@ -18,6 +18,7 @@ import com.beust.jcommander.internal.Lists;
import com.nis.domain.FunctionRegionDict;
import com.nis.domain.FunctionServiceDict;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.basics.PolicyGroupInfo;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.DnsResStrategy;
import com.nis.domain.configuration.IpPortCfg;
@@ -48,25 +49,26 @@ public class CheckIpFormatThread implements Callable<String>{
@Override
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
String msg=null;
StringBuffer msg=new StringBuffer();
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==1) {
try {
List<BaseIpCfg> ipcfgs=this.checkIpCfg(asnNoMaps, dataList);
List<BaseIpCfg> ipcfgs=this.checkIpCfg(msg,asnNoMaps, dataList);
boolean success=destQueue.addAll(ipcfgs);
}catch (Exception e) {
logger.error("checkIpCfg error,",e);
e.printStackTrace();
// TODO: handle exception
msg=e.getMessage();
break;
//msg.append(e.getMessage());
//break;
}
}
dataList.clear();
}
return msg;
return msg.toString();
}
public List<BaseIpCfg> checkIpCfg(List<Map<Long,Integer>> asnNos, List<Object> list)
public List<BaseIpCfg> checkIpCfg(StringBuffer msg,List<Map<Long,Integer>> asnNos, List<Object> list)
throws ServiceException {
logger.warn("start to validate ip...");
long start=System.currentTimeMillis();
@@ -188,10 +190,10 @@ public class CheckIpFormatThread implements Callable<String>{
Integer dnsStrategyId = baseIpCfg.getDnsStrategyId();
if (dnsStrategyId != null) {
if(dnsStrategyId>0) {
List<DnsResStrategy> dnsStrategys = DictUtils.getDnsResStrategyList(Long.valueOf(dnsStrategyId));
if (dnsStrategys == null || dnsStrategys.size() == 0) {
PolicyGroupInfo dnsStrategy = DictUtils.getDnsGroups(dnsStrategyId);
if (dnsStrategy == null ) {
errInfo.append(
String.format(prop.getProperty("is_incorrect"), prop.getProperty("dns_res_strategy"))
String.format(prop.getProperty("is_incorrect"), prop.getProperty("group"))
+ ";");
}
}
@@ -649,11 +651,13 @@ public class CheckIpFormatThread implements Callable<String>{
errTip.append(String.format(prop.getProperty("line"), baseIpCfg.getIndex()) + ",");
errTip.append(errInfo);
errTip.append("<br>");
}
}else {
ipList.add(baseIpCfg);
}
}
if (errTip.toString().length() > 0) {
throw new ServiceException(errTip.toString());
msg.append(errTip);
//throw new ServiceException(errTip.toString());
}
long end=System.currentTimeMillis();
logger.warn("validate ip finish,cost:"+(end-start));

View File

@@ -42,25 +42,26 @@ public class CheckStringFormatThread implements Callable<String>{
@Override
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
String msg=null;
StringBuffer msg=new StringBuffer();
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==2) {
try {
List<BaseStringCfg<?>> cfgs=this.checkStringCfg(dataList);
List<BaseStringCfg<?>> cfgs=this.checkStringCfg(msg,dataList);
destQueue.addAll(cfgs);
}catch (Exception e) {
logger.error("checkStringCfg error",e);
// TODO: handle exception
msg=e.getMessage();
break;
//msg=e.getMessage();
//break;
}
}
dataList.clear();
}
return msg;
return msg.toString();
}
public List<BaseStringCfg<?>> checkStringCfg(List<?> list) throws ServiceException {
public List<BaseStringCfg<?>> checkStringCfg(StringBuffer msg,List<?> list) throws ServiceException {
logger.warn("start to validate stringCfg data...");
long start=System.currentTimeMillis();
List<BaseStringCfg<?>> stringList = new ArrayList<BaseStringCfg<?>>();
@@ -276,9 +277,9 @@ public class CheckStringFormatThread implements Callable<String>{
Integer isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
if (isHex == null || isCaseInsenstive == null) {
if (isHex == null) {
if (hexP.equals("0") || hexP.equals("2")) {
if (hexP.indexOf("0")>-1 || hexP.indexOf("2")>-1) {
baseStringCfg.setIsHex(0);
} else if (hexP.equals("1")) {
} else if (hexP.indexOf("1")>-1) {
baseStringCfg.setIsHex(1);
} else {
errInfo.append(
@@ -286,9 +287,9 @@ public class CheckStringFormatThread implements Callable<String>{
}
}
if (isCaseInsenstive == null) {
if (hexP.equals("0") || hexP.equals("1")) {
if (hexP.indexOf("0")>-1 || hexP.indexOf("1")>-1) {
baseStringCfg.setIsCaseInsenstive(0);
} else if (hexP.equals("2")) {
} else if (hexP.indexOf("2")>-1) {
baseStringCfg.setIsCaseInsenstive(1);
} else {
errInfo.append(String.format(prop.getProperty("can_not_null"),
@@ -343,11 +344,14 @@ public class CheckStringFormatThread implements Callable<String>{
errTip.append(String.format(prop.getProperty("line"), baseStringCfg.getIndex()) + ",");
errTip.append(errInfo);
errTip.append("<br>");
}
}else {
stringList.add(baseStringCfg);
}
}
if (errTip.toString().length() > 0) {
throw new ServiceException(errTip.toString());
msg.append(errTip);
//throw new ServiceException(errTip.toString());
}
long end=System.currentTimeMillis();
logger.warn("validate stringCfg data finish,cost:"+(end-start));

View File

@@ -79,6 +79,7 @@ import com.nis.domain.configuration.template.AsnIpTemplate;
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
import com.nis.domain.configuration.template.DdosIpTemplate;
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
import com.nis.domain.configuration.template.DnsFakeIpTemplate;
import com.nis.domain.configuration.template.DnsIpTemplate;
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
@@ -931,7 +932,7 @@ public class BaseController {
* @throws InterruptedException
* @throws ExecutionException
*/
public BlockingQueue<BaseIpCfg> checkIpCfgMulity(FunctionServiceDict serviceDict, FunctionRegionDict regionDict,List<Map<Long,Integer>> asnNos, BlockingQueue<? extends Object> list) throws ServiceException, InterruptedException, ExecutionException{
public BlockingQueue<BaseIpCfg> checkIpCfgMulity(StringBuffer _msg,FunctionServiceDict serviceDict, FunctionRegionDict regionDict,List<Map<Long,Integer>> asnNos, BlockingQueue<? extends Object> list) throws ServiceException, InterruptedException, ExecutionException{
logger.warn("start checkIpCfgMulity ,size "+list.size());
long start=System.currentTimeMillis();
BlockingQueue<BaseIpCfg> queue=new ArrayBlockingQueue<>(list.size());
@@ -954,7 +955,8 @@ public class BaseController {
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
throw new ServiceException(msg);
//throw new ServiceException(msg);
_msg.append(msg);
}
}
long end=System.currentTimeMillis();
@@ -971,7 +973,7 @@ public class BaseController {
* @throws ExecutionException
* @throws ServiceException
*/
public BlockingQueue<BaseStringCfg<?>> checkStringCfgMulity(FunctionServiceDict serviceDict, FunctionRegionDict regionDict, BlockingQueue<? extends Object> list) throws InterruptedException, ExecutionException, ServiceException{
public BlockingQueue<BaseStringCfg<?>> checkStringCfgMulity(StringBuffer _msg,FunctionServiceDict serviceDict, FunctionRegionDict regionDict, BlockingQueue<? extends Object> list) throws InterruptedException, ExecutionException, ServiceException{
logger.warn("start checkStringCfgMulity ,size "+list.size());
long start=System.currentTimeMillis();
BlockingQueue<BaseStringCfg<?>> queue=new ArrayBlockingQueue<>(list.size());
@@ -993,7 +995,8 @@ public class BaseController {
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
throw new ServiceException(msg);
//throw new ServiceException(msg);
_msg.append(msg);
}
}
long end=System.currentTimeMillis();
@@ -1010,7 +1013,7 @@ public class BaseController {
* @throws ExecutionException
* @throws ServiceException
*/
public BlockingQueue<ComplexkeywordCfg> checkComplexStringCfgMulity(FunctionServiceDict serviceDict, FunctionRegionDict regionDict,BlockingQueue<? extends Object> list) throws InterruptedException, ExecutionException, ServiceException{
public BlockingQueue<ComplexkeywordCfg> checkComplexStringCfgMulity(StringBuffer _msg,FunctionServiceDict serviceDict, FunctionRegionDict regionDict,BlockingQueue<? extends Object> list) throws InterruptedException, ExecutionException, ServiceException{
logger.warn("start checkComplexStringCfgMulity ,size "+list.size());
long start=System.currentTimeMillis();
BlockingQueue<ComplexkeywordCfg> queue=new ArrayBlockingQueue<>(list.size());
@@ -1032,7 +1035,8 @@ public class BaseController {
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
throw new ServiceException(msg);
//throw new ServiceException(msg);
_msg.append(msg);
}
}
long end=System.currentTimeMillis();
@@ -1049,7 +1053,7 @@ public class BaseController {
* @throws ExecutionException
* @throws ServiceException
*/
public BlockingQueue<DnsResStrategy> checkDnsResStrategyCfgMulity(FunctionServiceDict serviceDict, FunctionRegionDict regionDict,BlockingQueue<? extends Object> list) throws InterruptedException, ExecutionException, ServiceException{
public BlockingQueue<DnsResStrategy> checkDnsResStrategyCfgMulity(StringBuffer _msg,FunctionServiceDict serviceDict, FunctionRegionDict regionDict,BlockingQueue<? extends Object> list) throws InterruptedException, ExecutionException, ServiceException{
logger.warn("start checkDnsResStrategyCfgMulity ,size "+list.size());
long start=System.currentTimeMillis();
BlockingQueue<DnsResStrategy> queue=new ArrayBlockingQueue<>(list.size());
@@ -1071,7 +1075,8 @@ public class BaseController {
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
throw new ServiceException(msg);
_msg.append(msg);
//throw new ServiceException(msg);
}
}
long end=System.currentTimeMillis();
@@ -1210,6 +1215,7 @@ public class BaseController {
ImportBigExcel ei=null;
try {
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
StringBuffer errTip=new StringBuffer();
BlockingQueue<BaseIpCfg> ipPortCfgs =null;
BlockingQueue<BaseStringCfg<?>> stringCfgs =null;
BlockingQueue<ComplexkeywordCfg> complexkeywordCfgs =null;
@@ -1250,78 +1256,78 @@ public class BaseController {
if (serviceDict!=null&&serviceDict.getAction().equals(64)) {
BlockingQueue<IpRateLimitTemplate> list = ei.getDataList(IpRateLimitTemplate.class
);
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, null, list);
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
} else {
BlockingQueue<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, null, list);
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
}
} else if (regionDict.getFunctionId().equals(7)&&serviceDict!=null&&serviceDict.getAction().intValue()==16) {
BlockingQueue<DnsIpTemplate> list = ei.getDataList(DnsIpTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, null, list);
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
}else if(regionDict.getFunctionId().equals(401)) {
BlockingQueue<DnsIpTemplate> list = ei.getDataList(DnsIpTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, null, list);
BlockingQueue<DnsFakeIpTemplate> list = ei.getDataList(DnsFakeIpTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
}else if (regionDict.getFunctionId().equals(212)) {
BlockingQueue<IpPayloadTemplate> list = ei.getDataList(IpPayloadTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, null, list);
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
} else if (regionDict.getFunctionId().equals(510)
&& "p2p_ip".equals(regionDict.getConfigServiceType())) { // P2p IP
BlockingQueue<P2pIpTemplate> list = ei.getDataList(P2pIpTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, null, list);
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
} else if (regionDict.getFunctionId().equals(600)) {// ASN IP
//加载asn缓存
AsnCacheUtils.init(true);
BlockingQueue<AsnIpTemplate> list = ei.getDataList(AsnIpTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, asnNoMaps, list);
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, asnNoMaps, list);
} else if (regionDict.getFunctionId().equals(301)) {// DDOS IP
BlockingQueue<DdosIpTemplate> list = ei.getDataList(DdosIpTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, null, list);
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
} else {
BlockingQueue<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class );
ipPortCfgs=this.checkIpCfgMulity(serviceDict, regionDict, null, list);
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
}
} else if (regionDict.getRegionType().equals(2)) {// 字符串类
if (regionDict.getFunctionId().equals(510)
&& "p2p_hash".equals(regionDict.getConfigServiceType())) { // P2p hash
BlockingQueue<P2pHashStringTemplate> list = ei.getDataList(P2pHashStringTemplate.class
);
stringCfgs=this.checkStringCfgMulity(serviceDict, regionDict, list);
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
}else if (regionDict.getFunctionId().equals(403)) {
BlockingQueue<AppDomainTemplate> list = ei.getDataList(AppDomainTemplate.class
);
stringCfgs=this.checkStringCfgMulity(serviceDict, regionDict, list);
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
}else if (regionDict.getFunctionId().equals(201)){// Domain Intercept
if(serviceDict.getAction().equals(1)){// 监测
BlockingQueue<DomainInterceptMonitTemplate> list = ei.getDataList(DomainInterceptMonitTemplate.class);
stringCfgs=this.checkStringCfgMulity(serviceDict, regionDict, list);
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
}else if(serviceDict.getAction().equals(64)){// 限速
BlockingQueue<DomainInterceptRateLimitTemplate> list = ei.getDataList(DomainInterceptRateLimitTemplate.class);
stringCfgs=this.checkStringCfgMulity(serviceDict, regionDict, list);
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
}else{// 白名单
BlockingQueue<DomainInterceptTemplate> list = ei.getDataList(DomainInterceptTemplate.class);
stringCfgs=this.checkStringCfgMulity(serviceDict, regionDict, list);
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
}
}else {
BlockingQueue<StringAllTemplate> list = ei.getDataList(StringAllTemplate.class );
stringCfgs=this.checkStringCfgMulity(serviceDict, regionDict, list);
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
}
} else if (regionDict.getRegionType().equals(3)) {// 增强字符串类
if (regionDict.getFunctionId().equals(7)&&serviceDict!=null&&serviceDict.getAction().intValue()==16) {
BlockingQueue<DnsComplexStringTemplate> list = ei.getDataList(DnsComplexStringTemplate.class
);
complexkeywordCfgs = this.checkComplexStringCfgMulity(serviceDict, regionDict, list);
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
} else {
BlockingQueue<ComplexStringAllTemplate> list = ei.getDataList(ComplexStringAllTemplate.class
);
complexkeywordCfgs = this.checkComplexStringCfgMulity(serviceDict, regionDict, list);
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
}
}else if (regionDict.getRegionType().equals(6)) {// 回调类
if (regionDict.getFunctionId().equals(400)) {
BlockingQueue<DnsResStrategyTemplate> list = ei.getDataList(DnsResStrategyTemplate.class
);
dnsResStrategies=this.checkDnsResStrategyCfgMulity(serviceDict, regionDict, list);
dnsResStrategies=this.checkDnsResStrategyCfgMulity(errTip,serviceDict, regionDict, list);
}
}
//删除文件
@@ -1868,7 +1874,9 @@ public class BaseController {
}
}
}
if(errTip.toString().length()>0) {
addMessage(redirectAttributes,"error", errTip.toString());
}
} catch (Exception e) {
if(ei!=null) {
if(ei.getUploadFile().exists()) {
@@ -1907,7 +1915,7 @@ public class BaseController {
} else if (regionDict.getFunctionId().equals(7)&&serviceDict!=null&&serviceDict.getAction().intValue()==16) {
ei.loadInitParams(DnsIpTemplate.class, msgProp, regionDict, serviceDict);
}else if(regionDict.getFunctionId().equals(401)) {
ei.loadInitParams(DnsIpTemplate.class, msgProp, regionDict, serviceDict);
ei.loadInitParams(DnsFakeIpTemplate.class, msgProp, regionDict, serviceDict);
}else if (regionDict.getFunctionId().equals(212)) {
ei.loadInitParams(IpPayloadTemplate.class, msgProp, regionDict, serviceDict);
} else if (regionDict.getFunctionId().equals(510)

View File

@@ -34,6 +34,7 @@ import com.nis.domain.configuration.template.AsnIpTemplate;
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
import com.nis.domain.configuration.template.DdosIpTemplate;
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
import com.nis.domain.configuration.template.DnsFakeIpTemplate;
import com.nis.domain.configuration.template.DnsIpTemplate;
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
import com.nis.domain.configuration.template.IpAllTemplate;
@@ -315,8 +316,8 @@ public class IpController extends BaseController{
excel.setDataList(pro,classList,null).
write(request,response, fileName).dispose();
}else if(regionDict.getFunctionId().equals(7)||regionDict.getFunctionId().equals(401)){ //Dns IPDNS FAKE IP
List<DnsIpTemplate> classList=new ArrayList<DnsIpTemplate>();
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsIpTemplate.class, 2);
List<DnsFakeIpTemplate> classList=new ArrayList<DnsFakeIpTemplate>();
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsFakeIpTemplate.class, 2);
excel.setDataList(pro,classList,null).
write(request,response, fileName).dispose();
}else if(regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())){ //P2p IP