(1)asn no放入eCache中

(2)导入验证采用多线程验证,优化验证速度
(3)asn ip导入方式调整(未采用多线程,因为redis承受不了)
(4)asn ip列表展示速度优化
(5)导入方式重写:采用csv模式,限制采用xlsx格式,加载80万数据不会内存溢出.
This commit is contained in:
wangxin
2018-11-11 19:36:53 +08:00
parent 40bcfea683
commit 80dde7d6a0
53 changed files with 4831 additions and 2996 deletions

View File

@@ -148,5 +148,21 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
public void setRegionId(Integer regionId) {
this.regionId = regionId;
}
@Override
public String toString() {
return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", ipPattern="
+ ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress + ", portPattern="
+ portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName
+ ", asnIpGroup=" + asnIpGroup + ", direction=" + direction + ", protocol=" + protocol + ", protocolId="
+ protocolId + ", compileId=" + compileId + ", isIssued=" + isIssued + ", userRegion1=" + userRegion1
+ ", userRegion2=" + userRegion2 + ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4
+ ", userRegion5=" + userRegion5 + ", cfgId=" + cfgId + ", cfgDesc=" + cfgDesc + ", action=" + action
+ ", isValid=" + isValid + ", isAudit=" + isAudit + ", creatorId=" + creatorId + ", createTime="
+ createTime + ", editorId=" + editorId + ", editTime=" + editTime + ", auditorId=" + auditorId
+ ", auditTime=" + auditTime + ", serviceId=" + serviceId + ", requestId=" + requestId
+ ", cancelRequestId=" + cancelRequestId + ", requestName=" + requestName + ", isAreaEffective="
+ isAreaEffective + ", classify=" + classify + ", attribute=" + attribute + ", lable=" + lable
+ ", cfgType=" + cfgType + ", functionId=" + functionId + ", doLog=" + doLog + "]";
}
}

View File

@@ -72,5 +72,10 @@ public class PolicyGroupInfo extends BaseCfg<PolicyGroupInfo> implements Seriali
public void setAsnNo(Long asnNo) {
this.asnNo = asnNo;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return super.toString();
}
}

View File

@@ -0,0 +1,26 @@
package com.nis.domain.basics;
import java.io.Serializable;
public class Varibles implements Serializable{
/**
*
*/
private static final long serialVersionUID = -5747624301389103730L;
private String variableName;
private Long value;
public String getVariableName() {
return variableName;
}
public void setVariableName(String variableName) {
this.variableName = variableName;
}
public Long getValue() {
return value;
}
public void setValue(Long value) {
this.value = value;
}
}

View File

@@ -30,6 +30,14 @@ import com.nis.web.security.UserUtils;
* @version V1.0
*/
public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
protected Integer index;//excel导入时所在的行
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
protected Integer areaType;
protected List<AreaBean> areaIsp;
protected List<AreaIpCfg> areaCfg;

View File

@@ -343,5 +343,10 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
public void setIndexTable(String indexTable) {
this.indexTable = indexTable;
}
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
}

View File

@@ -245,5 +245,10 @@ public class BaseStringCfg<T> extends BaseCfg<T> {
}
return list;
}
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
}

View File

@@ -216,4 +216,10 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
}
return list;
}
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
}

View File

@@ -13,7 +13,7 @@ import com.nis.util.excel.ExcelField;
/**
* @Description: excel导入字符串类配置
*/
public class AppDomainTemplate {
public class AppDomainTemplate extends BasicTemplate{
private String cfgDesc;
private String cfgKeywords;
private Integer matchMethod ;

View File

@@ -5,7 +5,7 @@ import com.nis.util.excel.ExcelField;
/**
* @Description: excel导入ASN IP类配置
*/
public class AsnIpTemplate {
public class AsnIpTemplate extends BasicTemplate{
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么

View File

@@ -0,0 +1,17 @@
package com.nis.domain.configuration.template;
public class BasicTemplate {
/**
* 数据在excel中的第几行
*/
protected Integer index;
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
}

View File

@@ -13,7 +13,7 @@ import com.nis.util.excel.ExcelField;
/**
* @Description: excel导入增强字符串类配置
*/
public class ComplexStringAllTemplate {
public class ComplexStringAllTemplate extends BasicTemplate{
private String cfgDesc;
private String district;

View File

@@ -2,7 +2,7 @@ package com.nis.domain.configuration.template;
import com.nis.util.excel.ExcelField;
public class DnsResStrategyTemplate {
public class DnsResStrategyTemplate extends BasicTemplate{
@ExcelField(title="policy_name",align=2,sort=1)
private String cfgDesc;
@ExcelField(title="group",align=2,sort=2)

View File

@@ -14,7 +14,7 @@ import com.nis.util.excel.ExcelField;
/**
* @Description: excel导入IP类配置
*/
public class IpAllTemplate {
public class IpAllTemplate extends BasicTemplate{
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么

View File

@@ -13,7 +13,7 @@ import com.nis.util.excel.ExcelField;
/**
* @Description: excel导入IP白名单配置模板
*/
public class IpWhitelistTemplate {
public class IpWhitelistTemplate extends BasicTemplate{
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么

View File

@@ -13,7 +13,7 @@ import com.nis.util.excel.ExcelField;
/**
* @Description: excel导入字符串类配置
*/
public class StringAllTemplate {
public class StringAllTemplate extends BasicTemplate{
private String cfgDesc;
private String cfgKeywords;

View File

@@ -1,11 +1,17 @@
package com.nis.domain.specific;
import java.io.Serializable;
import java.util.Date;
import com.google.gson.annotations.Expose;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import com.nis.util.excel.ExcelField;
public class ConfigGroupInfo {
public class ConfigGroupInfo implements Serializable{
/**
*
*/
private static final long serialVersionUID = -4539188977409108742L;
private Integer id;
private Integer groupId;
@ExcelField(title="group_name",sort=302)
@@ -72,5 +78,10 @@ public class ConfigGroupInfo {
public void setGroupType(Integer groupType) {
this.groupType = groupType;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return ReflectionToStringBuilder.toString(this);
}
}