(1)asn导入加入组织国家,asn号验证,组织国家不能为空,asn号不能为两个组织所有
(2)新增asn_keyword_cfg表,用于保存并下发有效且含审核通过asn ip的 asn号 (3)asn 导入去除条数限制 (4)页面asn select选项还是会影响加载页面速度,现在改为input (5)asn_group_info 修改org_group_id为issued_ips,用于保存审核通过的asn ip (6)分组复用url配置文件补全v1
This commit is contained in:
@@ -69,6 +69,15 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
private boolean districtShow=false;
|
||||
private List<Object[]> annotationList;
|
||||
private List<List<Object>> dataList=Lists.newArrayList();
|
||||
private boolean hasImportLimit=true;
|
||||
|
||||
|
||||
public boolean isHasImportLimit() {
|
||||
return hasImportLimit;
|
||||
}
|
||||
public void setHasImportLimit(boolean hasImportLimit) {
|
||||
this.hasImportLimit = hasImportLimit;
|
||||
}
|
||||
/**
|
||||
* 构造函数
|
||||
* @param file 导入文件对象
|
||||
@@ -412,7 +421,7 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
}
|
||||
if(dataList.size()==0) {
|
||||
throw new ServiceException(props.getProperty("noneData", "noneData"));
|
||||
}else if(dataList.size()>(Constants.IMPORT_LIMIT+1)) {
|
||||
}else if(this.hasImportLimit&&dataList.size()>(Constants.IMPORT_LIMIT+1)) {
|
||||
throw new ServiceException(props.getProperty("import_limit_is", "The maximum import size is")+" "+Constants.IMPORT_LIMIT);
|
||||
}
|
||||
// Get excel data
|
||||
|
||||
@@ -226,24 +226,52 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
if (regionDict.getFunctionId().equals(600)) {//asn
|
||||
String organization=baseIpCfg.getOrganization();
|
||||
if(StringUtils.isBlank(organization)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("organization","Organization"))
|
||||
+ ";");
|
||||
}else {
|
||||
if(organization.length() > 1024){
|
||||
errInfo.append(prop.getProperty("asn_name")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":1024") + ";");
|
||||
}else {
|
||||
if(organization.trim().length()<128) {
|
||||
baseIpCfg.setCfgDesc(organization.trim());
|
||||
}
|
||||
baseIpCfg.setOrganization(organization.trim().toUpperCase());
|
||||
}
|
||||
|
||||
}
|
||||
String country=baseIpCfg.getCountry();
|
||||
if(StringUtils.isBlank(country)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("country"))
|
||||
+ ";");
|
||||
}else {
|
||||
if(country.length() > 512){
|
||||
errInfo.append(prop.getProperty("country_code")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":512") + ";");
|
||||
}else {
|
||||
baseIpCfg.setCountry(country.trim().toUpperCase());
|
||||
}
|
||||
}
|
||||
String detail=baseIpCfg.getDetail();
|
||||
if(StringUtils.isBlank(detail)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("detail"))
|
||||
+ ";");
|
||||
}else {
|
||||
if(detail.length() > 1024||detail.length()<4){
|
||||
errInfo.append(prop.getProperty("details")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";");
|
||||
}else {
|
||||
baseIpCfg.setDetail(detail.trim());
|
||||
}
|
||||
}
|
||||
//asn id
|
||||
String userRegion1 = baseIpCfg.getUserRegion1();
|
||||
if(StringUtils.isBlank(userRegion1)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("asn_no"))
|
||||
+ ";");
|
||||
}else if(StringUtils.isBlank(baseIpCfg.getOrganization())){
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("organization","Organization"))
|
||||
+ ";");
|
||||
}else if(StringUtils.isBlank(baseIpCfg.getCountry())){
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("country","Country"))
|
||||
+ ";");
|
||||
}else if(StringUtils.isBlank(baseIpCfg.getDetail())){
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("detail","Detail"))
|
||||
+ ";");
|
||||
}else {
|
||||
try {
|
||||
Long asnNo=Long.parseLong(userRegion1);
|
||||
@@ -258,22 +286,45 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
//缓存中没有
|
||||
if(configGroupInfo==null) {
|
||||
synchronized (Constants.IMPORT_LOCK) {
|
||||
AsnGroupInfo groupInfo=new AsnGroupInfo();
|
||||
groupInfo.setOrganization(baseIpCfg.getOrganization().trim());
|
||||
groupInfo.setCountry(baseIpCfg.getCountry().trim());
|
||||
groupInfo.setDetail(baseIpCfg.getDetail().trim());
|
||||
groupInfo.setIsValid(0);
|
||||
groupInfo.setAsnId(asnNo);
|
||||
asnNos.get(0).put(asnNo,groupInfo);
|
||||
if(StringUtils.isNotBlank(baseIpCfg.getOrganization())&&StringUtils.isNotBlank(baseIpCfg.getCountry())) {
|
||||
AsnGroupInfo groupInfo=new AsnGroupInfo();
|
||||
groupInfo.setOrganization(baseIpCfg.getOrganization().trim().toUpperCase());
|
||||
groupInfo.setCountry(baseIpCfg.getCountry().trim().toUpperCase());
|
||||
groupInfo.setDetail(baseIpCfg.getDetail().trim());
|
||||
groupInfo.setIsValid(0);
|
||||
groupInfo.setAsnId(asnNo);
|
||||
if(asnNos.get(0).containsKey(asnNo)) {
|
||||
if(!asnNos.get(0).get(asnNo).getOrganization().equals(baseIpCfg.getOrganization().trim().toUpperCase())) {
|
||||
//一个asn号不能被两个组织拥有
|
||||
logger.error("ASN "+asnNo+" Found two Organization "+asnNos.get(0).get(asnNo).getOrganization()+" "+baseIpCfg.getOrganization().trim().toUpperCase());
|
||||
errInfo.append(asnNos.get(0).get(asnNo).getOrganization()+" "+baseIpCfg.getOrganization().trim().toUpperCase()+" "+prop.getProperty("asn_no")+" "+asnNo+" "+prop.getProperty("repeat")
|
||||
+";");
|
||||
}else {
|
||||
asnNos.get(0).put(asnNo,groupInfo);
|
||||
}
|
||||
}else {
|
||||
asnNos.get(0).put(asnNo,groupInfo);
|
||||
}
|
||||
|
||||
}else {
|
||||
if(StringUtils.isNotBlank(baseIpCfg.getOrganization())) {
|
||||
logger.error("ASN "+asnNo+" Organization is Null");
|
||||
}
|
||||
if(StringUtils.isNotBlank(baseIpCfg.getCountry())) {
|
||||
logger.error("ASN "+asnNo+" Country is Null");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
if(!configGroupInfo.getOrganization().equals(baseIpCfg.getOrganization().trim())) {
|
||||
if(!configGroupInfo.getOrganization().equalsIgnoreCase(baseIpCfg.getOrganization().trim())) {
|
||||
errInfo.append(prop.getProperty("organization","Organization")+" "+prop.getProperty("mismatch","Mismatch"));
|
||||
}
|
||||
if(!configGroupInfo.getCountry().equals(baseIpCfg.getCountry().trim())) {
|
||||
if(!configGroupInfo.getCountry().equalsIgnoreCase(baseIpCfg.getCountry().trim())) {
|
||||
errInfo.append(prop.getProperty("country","Country")+" "+prop.getProperty("mismatch","Mismatch"));
|
||||
}
|
||||
if(!configGroupInfo.getDetail().equals(baseIpCfg.getDetail().trim())) {
|
||||
if(!configGroupInfo.getDetail().equalsIgnoreCase(baseIpCfg.getDetail().trim())) {
|
||||
errInfo.append(prop.getProperty("detail","Detail")+" "+prop.getProperty("mismatch","Mismatch"));
|
||||
}
|
||||
if(StringUtils.isBlank(errInfo.toString())) {
|
||||
@@ -291,27 +342,6 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
String organization=baseIpCfg.getOrganization();
|
||||
if(StringUtils.isBlank(organization)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("organization","Organization"))
|
||||
+ ";");
|
||||
}else {
|
||||
baseIpCfg.setCfgDesc(organization);
|
||||
|
||||
}
|
||||
String country=baseIpCfg.getCountry();
|
||||
if(StringUtils.isBlank(country)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("country"))
|
||||
+ ";");
|
||||
}
|
||||
String detail=baseIpCfg.getDetail();
|
||||
if(StringUtils.isBlank(detail)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("detail"))
|
||||
+ ";");
|
||||
}
|
||||
|
||||
}
|
||||
if (regionDict.getFunctionId().equals(301)) {
|
||||
|
||||
Reference in New Issue
Block a user