From 8da5a2dc96d01079b761d605a6a77bfccebc7b6c Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Thu, 3 Jan 2019 01:11:56 +0800 Subject: [PATCH] =?UTF-8?q?APP=E7=89=B9=E5=BE=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E9=A1=B5=E4=BF=AE=E6=94=B9=EF=BC=8Capp=20pay?= =?UTF-8?q?load=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=8A=9F=E8=83=BD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/AppPayloadTemplate.java | 113 ++++++ .../java/com/nis/util/excel/ExportExcel.java | 94 +++++ ...ckAppFeatureComplexStringFormatThread.java | 352 ++++++++++++++++++ .../nis/web/controller/BaseController.java | 342 ++++++++++++----- .../configuration/ntc/IpController.java | 6 + .../configuration/AppMultiFeatureCfgDao.java | 1 + .../configuration/AppMultiFeatureCfgDao.xml | 23 ++ .../java/com/nis/web/service/BaseService.java | 29 ++ .../AppMultiFeatureCfgService.java | 334 +++++++++++++---- .../resources/messages/message_en.properties | 8 +- .../resources/messages/message_ru.properties | 8 +- .../messages/message_zh_CN.properties | 8 +- .../sql/20190102/update_function_dicts.sql | 6 + .../WEB-INF/include/excel/importModal.jsp | 6 +- .../static/pages/scripts/importExcel.js | 5 +- 15 files changed, 1152 insertions(+), 183 deletions(-) create mode 100644 src/main/java/com/nis/domain/configuration/template/AppPayloadTemplate.java create mode 100644 src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java create mode 100644 src/main/resources/sql/20190102/update_function_dicts.sql diff --git a/src/main/java/com/nis/domain/configuration/template/AppPayloadTemplate.java b/src/main/java/com/nis/domain/configuration/template/AppPayloadTemplate.java new file mode 100644 index 000000000..4b1bde10d --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/template/AppPayloadTemplate.java @@ -0,0 +1,113 @@ +package com.nis.domain.configuration.template; + +import com.nis.util.excel.ExcelField; + +/** + * APP Payload 导入模板类 + * @author dell + * + */ +public class AppPayloadTemplate extends ComplexStringAllTemplate{ + + // APP PAYLOAD L3_HEADER的特殊属性 + private String ver; + private String ihl; + private String tos; + private String totalLength; + private String flags; + private String fragmentOffset; + private String protocol; + private String icmpType; + private String icmpCode; + private String icmpIdentifier; + private String headerType; + + @ExcelField(title="headerType",align=2,sort=17) + public String getHeaderType() { + return headerType; + } + public void setHeaderType(String headerType) { + this.headerType = headerType; + } + + @ExcelField(title="VER",align=2,sort=18) + public String getVer() { + return ver; + } + public void setVer(String ver) { + this.ver = ver; + } + + @ExcelField(title="IHL",align=2,sort=19) + public String getIhl() { + return ihl; + } + public void setIhl(String ihl) { + this.ihl = ihl; + } + + @ExcelField(title="TOS",align=2,sort=20) + public String getTos() { + return tos; + } + public void setTos(String tos) { + this.tos = tos; + } + + @ExcelField(title="Total Length",align=2,sort=21) + public String getTotalLength() { + return totalLength; + } + public void setTotalLength(String totalLength) { + this.totalLength = totalLength; + } + + @ExcelField(title="Flags",align=2,sort=22) + public String getFlags() { + return flags; + } + public void setFlags(String flags) { + this.flags = flags; + } + + @ExcelField(title="fragment offset",align=2,sort=23) + public String getFragmentOffset() { + return fragmentOffset; + } + public void setFragmentOffset(String fragmentOffset) { + this.fragmentOffset = fragmentOffset; + } + + @ExcelField(title="Protocol",align=2,sort=24) + public String getProtocol() { + return protocol; + } + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + @ExcelField(title="ICMP type",align=2,sort=25) + public String getIcmpType() { + return icmpType; + } + public void setIcmpType(String icmpType) { + this.icmpType = icmpType; + } + + @ExcelField(title="ICMP code",align=2,sort=26) + public String getIcmpCode() { + return icmpCode; + } + public void setIcmpCode(String icmpCode) { + this.icmpCode = icmpCode; + } + + @ExcelField(title="ICMP identifier",align=2,sort=27) + public String getIcmpIdentifier() { + return icmpIdentifier; + } + public void setIcmpIdentifier(String icmpIdentifier) { + this.icmpIdentifier = icmpIdentifier; + } + +} diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index 50c9bdb4c..ad4edaaff 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -1036,6 +1036,11 @@ public class ExportExcel { commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n"; index++; } + // APP Payload + if(region.getFunctionId().equals(563)) { + commentStr=commentStr+"▶"+"L3_header:"+msgProp.getProperty("need_input")+"'headerType'"+"\n"; + index++; + } } } } @@ -1257,6 +1262,95 @@ public class ExportExcel { index++; } } + + // APP Payload + if("headerType".equals(headerStr)){ + commentStr=commentStr+"IP_header"+"\n"+"ICMP_header"+"\n"; + index++; + index++; + defaultValue=region.getConfigDistrict().split(",")[0]; + + commentStr=msgProp.getProperty("select")+":\n"+commentStr; + index++; + index++; + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + + //1、非空说明 + commentStr=commentStr+"▶"+msgProp.getProperty("required")+"\n"; + index++; + //2、默认值说明 + /*if(!StringUtil.isEmpty(defaultValue)){ + commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+"IP_header"+"\n"; + index++; + }*/ + + commentStr=commentStr+"▶"+"IP_header:"+msgProp.getProperty("need_input")+"('VER'、'IHL'、'TOS'、'Total Length'、'Flags'、'fragment offset'、'Protocol'),"+msgProp.getProperty("max_input")+"\n"; + index++; + commentStr=commentStr+"▶"+"ICMP_header:"+msgProp.getProperty("need_input")+"('ICMP type'、'ICMP code'、'ICMP identifier')"+"\n"; + index++; + } + if("VER".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_4"); + index++; + } + if("IHL".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_4"); + index++; + } + if("TOS".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8"); + index++; + } + if("Total Length".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_16"); + index++; + } + if("Flags".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_3"); + index++; + } + if("fragment offset".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8"); + index++; + } + if("Protocol".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8"); + index++; + } + if("ICMP type".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8"); + index++; + } + if("ICMP code".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8"); + index++; + } + if("ICMP identifier".equals(headerStr)){ + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_16"); + index++; + } + }else if(region.getRegionType().equals(6)) { if(region.getFunctionId().equals(400)) { if("group".equals(headerStr)){ diff --git a/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java new file mode 100644 index 000000000..106d24e7e --- /dev/null +++ b/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java @@ -0,0 +1,352 @@ +package com.nis.util.excel.thread; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Callable; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.commons.lang3.StringUtils; +import org.apache.log4j.Logger; +import org.jets3t.service.ServiceException; +import org.springframework.beans.BeanUtils; + +import com.beust.jcommander.internal.Lists; +import com.beust.jcommander.internal.Sets; +import com.nis.domain.FunctionRegionDict; +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.configuration.AppComplexFeatureCfg; +import com.nis.util.Constants; +import com.nis.web.service.SpringContextHolder; +import com.nis.web.service.configuration.AppMultiFeatureCfgService; + +public class CheckAppFeatureComplexStringFormatThread implements Callable{ + private Logger logger=Logger.getLogger(CheckAppFeatureComplexStringFormatThread.class); + private BlockingQueue srcQueue; + private BlockingQueue destQueue; + private Properties prop; + private FunctionServiceDict serviceDict; + private FunctionRegionDict regionDict; + + public CheckAppFeatureComplexStringFormatThread(FunctionServiceDict serviceDict,FunctionRegionDict regionDict,Properties prop,BlockingQueue srcQueue,BlockingQueue destQueue) { + this.serviceDict=serviceDict; + this.regionDict=regionDict; + this.srcQueue=srcQueue; + this.destQueue=destQueue; + this.prop=prop; + + } + @Override + public String call() throws Exception { + List dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE); + StringBuffer msg=new StringBuffer(); + while(!srcQueue.isEmpty()) { + int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE); + if(regionDict.getRegionType().intValue()==3) { + try { + List cfgs=this.checkAppComplexFeatureCfg(msg,dataList); + destQueue.addAll(cfgs); + }catch (Exception e) { + logger.error("checkComplexStringCfg error,",e); + // TODO: handle exception + //msg=e.getMessage(); + //msg.append(e.getMessage()); + //break; + } + } + dataList.clear(); + } + return msg.toString(); + } + public List checkAppComplexFeatureCfg(StringBuffer msg, + List list) throws ServiceException { + logger.warn("start to validate appfeaturecomplexString data..."); + long start=System.currentTimeMillis(); + List stringList = new ArrayList(); + String exprTypeP = regionDict.getConfigExprType(); + if (StringUtils.isBlank(exprTypeP)) { + throw new RuntimeException("Found String region,but exprType is Empty"); + } + String matchMethodP = regionDict.getConfigMatchMethod(); + if (StringUtils.isBlank(matchMethodP)) { + throw new RuntimeException("Found String region,but matchMethod is Empty"); + } + String hexP = regionDict.getConfigHex(); + if (StringUtils.isBlank(hexP)) { + throw new RuntimeException("Found String region,but hex is Empty"); + } + String mulityKeywordsP = regionDict.getConfigMultiKeywords(); + if (StringUtils.isBlank(mulityKeywordsP)) { + throw new RuntimeException("Found String region,but mulityKeywords is Empty"); + } + String dirtrictP = regionDict.getConfigDistrict(); + StringBuffer errTip = new StringBuffer(); + Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f"); + AppMultiFeatureCfgService appMultiFeatureCfgService = SpringContextHolder.getBean(AppMultiFeatureCfgService.class); + for (int i = 0; i < list.size(); i++) { + StringBuffer errInfo = new StringBuffer(); + AppComplexFeatureCfg baseStringCfg = new AppComplexFeatureCfg(); + BeanUtils.copyProperties(list.get(i), baseStringCfg); + // 配置描述、关键字长度限制 + if(baseStringCfg.getCfgDesc().length() > 128) { + errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); + } + if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){ + errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";"); + } + + if (regionDict.getRegionType().equals(3)) { + String keyword = baseStringCfg.getCfgKeywords(); + String district = baseStringCfg.getDistrict(); + if (StringUtils.isBlank(keyword)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";"); + } + if (StringUtils.isNotBlank(dirtrictP)) { + if (StringUtils.isBlank(district)) { + if (dirtrictP.indexOf(",") == -1) { + baseStringCfg.setDistrict(dirtrictP); + } else { + // baseStringCfg.setDistrict(dirtrictP.split(",")[0]); + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("district") + " ") + + ";"); + } + } else if (dirtrictP.indexOf(district) == -1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("district") + " ") + + ";"); + } else if (dirtrictP.indexOf("others")>-1&&district.equals("others")) { + //不允许自定义匹配区域导入 + errInfo.append(prop.getProperty("district")+" "+ + String.format(prop.getProperty("can_not_be"), " 'others'")+ ";"); + } + } + if (mulityKeywordsP.equals("0")) { + if (keyword.indexOf("\n") > -1) { + errInfo.append( + String.format(prop.getProperty("not_multiple"), prop.getProperty("key_word")) + ";"); + } + Matcher m = pattern.matcher(keyword); + if (m.find()) { + errInfo.append(String.format(prop.getProperty("has_invisible_char"), + prop.getProperty("key_word") + " '" + keyword + "'") + ";"); + } + } else { + boolean has = false; + Set keywordSet=Sets.newHashSet(); + + for (String key : keyword.split("\n")) { + Matcher m = pattern.matcher(key); + if (m.find()) { + has = true; + errInfo.append(String.format(prop.getProperty("has_invisible_char"), + prop.getProperty("key_word") + " '" + key + "'") + ";"); + break; + } + if(!keywordSet.contains(key)) { + keywordSet.add(key); + }else { + errInfo.append(prop.getProperty("key_word") + " '" + key + "'"+" "+prop.getProperty("repeat") + ";"); + } + } + if (!has) { + if(keyword.replaceAll("\n","").length()>1024) { + errInfo.append(String.format(prop.getProperty("most_keywords"), + prop.getProperty("key_word")) + ";"); + }else { + String reWord = keyword.replaceAll("\n", Constants.KEYWORD_EXPR); + baseStringCfg.setCfgKeywords(reWord); + } + } + } + Integer exprType = baseStringCfg.getExprType(); + boolean has = false; + if (exprType == null) { + if (exprTypeP.indexOf(",") == -1) { + if (mulityKeywordsP.equals("0") && exprTypeP.equals("1")) { + throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); + } + baseStringCfg.setExprType(Integer.parseInt(exprTypeP)); + } else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("0")) { + baseStringCfg.setExprType(0); + } else if (exprTypeP.indexOf("1") > -1 && mulityKeywordsP.equals("1") + && keyword.indexOf("\n") > -1) { + baseStringCfg.setExprType(1); + } else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("1") + && keyword.indexOf("\n") == -1) { + baseStringCfg.setExprType(0); + } else { + baseStringCfg.setExprType(Integer.parseInt(exprTypeP.split(",")[0])); + } + // errInfo.append(String.format(prop.getProperty("can_not_null"), + // prop.getProperty("expression_type"))+";"); + } else { + for (String exp : exprTypeP.split(",")) { + if (exp.equals(exprType.toString())) { + has = true; + break; + } + } + if (!has) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("expression_type")) + + ";"); + } + has = false; + } + exprType = baseStringCfg.getExprType(); + Integer matchMethod = baseStringCfg.getMatchMethod(); + if (matchMethod == null) { + if (matchMethodP.indexOf(",") == -1) { + if (exprTypeP.equals("1") && !matchMethodP.equals("0")) { + throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); + } + baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP)); + } else if (exprType != null && exprType.intValue() == 1) { + if (matchMethodP.indexOf("0") > -1) { + baseStringCfg.setMatchMethod(0); + } else { + throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); + } + + } else { + baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP.split(",")[0])); + } + // errInfo.append(String.format(prop.getProperty("can_not_null"), + // prop.getProperty("match_method"))+";"); + } else { + for (String exp : matchMethodP.split(",")) { + if (exp.equals(matchMethod.toString())) { + has = true; + break; + } + } + if (!has) { + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("match_method")) + + ";"); + } + } + Integer isHex = baseStringCfg.getIsHex(); + Integer isCaseInsenstive = baseStringCfg.getIsCaseInsenstive(); + if (isHex == null || isCaseInsenstive == null) { + if (isHex == null) { + if (hexP.indexOf("0")>-1 || hexP.indexOf("2")>-1) { + baseStringCfg.setIsHex(0); + } else if (hexP.indexOf("1")>-1) { + baseStringCfg.setIsHex(1); + } else { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("is_hex")) + ";"); + } + } + if (isCaseInsenstive == null) { + if (hexP.indexOf("0")>-1 || hexP.indexOf("1")>-1) { + baseStringCfg.setIsCaseInsenstive(0); + } else if (hexP.indexOf("2")>-1) { + baseStringCfg.setIsCaseInsenstive(1); + } else { + errInfo.append(String.format(prop.getProperty("can_not_null"), + prop.getProperty("is_case_insenstive")) + ";"); + } + } + } else { + if (isHex.intValue() != 0 && isHex.intValue() != 1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); + } + if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) + + ";"); + } + if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); + } + if (hexP.equals("1") && isHex.intValue() == 0) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); + } + if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) + + ";"); + } + if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) + + ";"); + } + // 关键字十六进制校验 + if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) { + boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches(); + if(!bl) { + errInfo.append( + prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + } + } + } + isHex = baseStringCfg.getIsHex(); + isCaseInsenstive = baseStringCfg.getIsCaseInsenstive(); + if (isHex != null && isCaseInsenstive != null) { + if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) { + baseStringCfg.setIsHexbin(0); + } else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 0) { + baseStringCfg.setIsHexbin(1); + } else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) { + baseStringCfg.setIsHexbin(2); + } else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验 + errInfo.append(prop.getProperty("hex_case_insensitive")+ ";"); + } + } + + // APP Payload L3_HEADER的特殊属性限制 + if(baseStringCfg.getDistrict().equals("L3_header")) { + String headerType = baseStringCfg.getHeaderType(); + if(StringUtils.isBlank(headerType)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "headerType") + ";"); + }else if((!"IP_header".equals(headerType)) && (!"ICMP_header".equals(headerType))) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), "headerType") + ";"); + }else{ + appMultiFeatureCfgService.checkImportAppPayload(baseStringCfg, errInfo, prop); + } + appMultiFeatureCfgService.setL3HeaderKeyword(baseStringCfg); + }else { + baseStringCfg.setHeaderType(null); + baseStringCfg.setVer(null); + baseStringCfg.setIhl(null); + baseStringCfg.setTos(null); + baseStringCfg.setTotalLength(null); + baseStringCfg.setFlags(null); + baseStringCfg.setFragmentOffset(null); + baseStringCfg.setProtocol(null); + baseStringCfg.setIcmpType(null); + baseStringCfg.setIcmpCode(null); + baseStringCfg.setIcmpIdentifier(null); + } + } + if (errInfo.toString().length() > 0) { + errTip.append(String.format(prop.getProperty("line"), baseStringCfg.getIndex()) + ","); + errTip.append(errInfo); + errTip.append("
"); + }else { + stringList.add(baseStringCfg); + } + } + if (errTip.toString().length() > 0) { + msg.append(errTip); + //throw new ServiceException(errTip.toString()); + } + long end=System.currentTimeMillis(); + logger.warn("validate appfeaturecomplexString data finish,cost:"+(end-start)); + return stringList; + } +} diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 2b6984f04..9a60e7d2c 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -47,6 +47,7 @@ import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.basics.AsnIpCfg; import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.basics.SysDictInfo; +import com.nis.domain.configuration.AppComplexFeatureCfg; import com.nis.domain.configuration.AppDomainCfg; import com.nis.domain.configuration.AppFeatureIndex; import com.nis.domain.configuration.AppHttpCfg; @@ -75,6 +76,7 @@ import com.nis.domain.configuration.PxyObjTrustedCaCrl; import com.nis.domain.configuration.RequestInfo; import com.nis.domain.configuration.StringCfgTemplate; import com.nis.domain.configuration.template.AppDomainTemplate; +import com.nis.domain.configuration.template.AppPayloadTemplate; import com.nis.domain.configuration.template.AsnIpTemplate; import com.nis.domain.configuration.template.ComplexStringAllTemplate; import com.nis.domain.configuration.template.DdosIpTemplate; @@ -127,6 +129,7 @@ import com.nis.util.StringUtil; import com.nis.util.excel.ExcelCsv; import com.nis.util.excel.ExportExcel; import com.nis.util.excel.ImportBigExcel; +import com.nis.util.excel.thread.CheckAppFeatureComplexStringFormatThread; import com.nis.util.excel.thread.CheckComplexStringFormatThread; import com.nis.util.excel.thread.CheckDnsResStrategyFormatThread; import com.nis.util.excel.thread.CheckIpFormatThread; @@ -1093,6 +1096,48 @@ public class BaseController { return queue; } + /** + * 多线程验证 + * @param _msg + * @param serviceDict + * @param regionDict + * @param list + * @return + * @throws InterruptedException + * @throws ExecutionException + * @throws ServiceException + */ + public BlockingQueue checkAppComplexFeatureStringCfgMulity(StringBuffer _msg,FunctionServiceDict serviceDict, FunctionRegionDict regionDict,BlockingQueue list) throws InterruptedException, ExecutionException, ServiceException{ + logger.warn("start checkAppComplexFeatureStringCfgMulity ,size "+list.size()); + long start=System.currentTimeMillis(); + BlockingQueue queue=new ArrayBlockingQueue<>(list.size()); + ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE); + List> futures=new ArrayList<>(); + for(int i=0;i future:futures) { + String msg = future.get(); + if(StringUtils.isNotBlank(msg)) { + _msg.append(msg); + //throw new ServiceException(msg); + } + } + long end=System.currentTimeMillis(); + logger.warn("checkAppComplexFeatureStringCfgMulity finish,cost:"+(end-start)+",size:"+queue.size()); + return queue; + } + /** * * setReportSearchTime(报表查询设置开始时间与结束时间) (这里描述这个方法适用条件 – 可选) @@ -1229,6 +1274,7 @@ public class BaseController { BlockingQueue> stringCfgs =null; BlockingQueue complexkeywordCfgs =null; BlockingQueue dnsResStrategies=null; + BlockingQueue appComplexFeatureCfgs=null; List cfgIndexInfos = new ArrayList(); List appPolicyCfgs = new ArrayList(); List appFeatureIndexs= new ArrayList(); @@ -1361,6 +1407,9 @@ public class BaseController { } else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换 BlockingQueue list = ei.getDataList(HttpsReplaceComplexTemplate.class); complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list); + } else if(regionDict.getFunctionId().equals(563)){// APP Payload + BlockingQueue list = ei.getDataList(AppPayloadTemplate.class); + appComplexFeatureCfgs = this.checkAppComplexFeatureStringCfgMulity(errTip,serviceDict, regionDict, list); } else { BlockingQueue list = ei.getDataList(ComplexStringAllTemplate.class ); @@ -1673,7 +1722,7 @@ public class BaseController { } if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 || regionDict.getFunctionId().intValue()==563){ AppFeatureIndex appfeature = new AppFeatureIndex(); - if(appFeatureRegion!=null){ + if(regionDict!=null){ appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode())); appfeature.setCfgRegionValue(regionDict.getConfigRegionValue()); appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType())); @@ -1816,114 +1865,199 @@ public class BaseController { _stringCfgs.clear(); } } else if (regionDict.getRegionType().equals(3)) { - List _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE); - while(!complexkeywordCfgs.isEmpty()) { - complexkeywordCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE); - List compileIds=Lists.newArrayList(); - List groupIds=Lists.newArrayList(); - List regionIds=Lists.newArrayList(); - try { - compileIds = ConfigServiceUtil.getId(1,_complexkeywordCfgs.size()); - if(isSend.equals("1")) { - groupIds = ConfigServiceUtil.getId(2,_complexkeywordCfgs.size()); - regionIds = ConfigServiceUtil.getId(3,_complexkeywordCfgs.size()); - } - } catch (Exception e) { - e.printStackTrace(); - logger.info("获取编译ID出错"); - throw new MaatConvertException(":"+e.getMessage()); - } - int ind=0; - for (ComplexkeywordCfg cfg : _complexkeywordCfgs) { - cfg.setAction(serviceDict.getAction()); - /*cfg.setAuditorId(UserUtils.getUser().getId()); + if(!regionDict.getFunctionId().equals(563)) { + List _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE); + while(!complexkeywordCfgs.isEmpty()) { + complexkeywordCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE); + List compileIds=Lists.newArrayList(); + List groupIds=Lists.newArrayList(); + List regionIds=Lists.newArrayList(); + try { + compileIds = ConfigServiceUtil.getId(1,_complexkeywordCfgs.size()); + if(isSend.equals("1")) { + groupIds = ConfigServiceUtil.getId(2,_complexkeywordCfgs.size()); + regionIds = ConfigServiceUtil.getId(3,_complexkeywordCfgs.size()); + } + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + int ind=0; + for (ComplexkeywordCfg cfg : _complexkeywordCfgs) { + cfg.setAction(serviceDict.getAction()); + /*cfg.setAuditorId(UserUtils.getUser().getId()); cfg.setAuditTime(date);*/ - cfg.setCfgRegionCode(regionDict.getConfigRegionCode()); - cfg.setCfgType(regionDict.getConfigRegionValue()); - cfg.setCreateTime(date); - cfg.setCreatorId(UserUtils.getUser().getId()); - cfg.setDoLog(2); - cfg.setFunctionId(regionDict.getFunctionId()); - if(isSend.equals("1")) { - cfg.setIsAudit(Constants.AUDIT_YES); - cfg.setIsValid(Constants.VALID_YES); - cfg.setAuditorId(UserUtils.getUser().getId()); - cfg.setAuditTime(date); - if(groupIds!=null&&groupIds.size()==_complexkeywordCfgs.size()) { - cfg.setGroupId(groupIds.get(ind)); - } - if(regionIds!=null&®ionIds.size()==_complexkeywordCfgs.size()) { - cfg.setRegionId(regionIds.get(ind)); - } - }else { - cfg.setIsAudit(Constants.AUDIT_NOT_YET); - cfg.setIsValid(Constants.VALID_NO); - } - //cfg.setIsAudit(0); - //cfg.setIsValid(0); - cfg.setIsAreaEffective(0); - cfg.setLable("0"); - cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId); - cfg.setAttribute(attribute); - cfg.setClassify(classify); - cfg.setServiceId(serviceDict.getServiceId()); - if(compileIds!=null&&compileIds.size()==_complexkeywordCfgs.size()) { - cfg.setCompileId(compileIds.get(ind)); - } - if(specificServiceCfg!=null) { - cfg.setAppCode(specificServiceCfg.getSpecServiceCode()); - cfg.setSpecServiceId(specificServiceCfg.getSpecServiceId()); - if(StringUtils.isNotBlank(behaviorId)) - cfg.setBehavCode(Integer.parseInt(behaviorId)); - } - if (serviceDict.getServiceId().intValue() == 33 - || serviceDict.getServiceId().intValue() == 145 - || serviceDict.getServiceId().intValue() == 35 - || serviceDict.getServiceId().intValue() == 147 - || serviceDict.getServiceId().intValue() == 36 - || serviceDict.getServiceId().intValue() == 148) { - if (appRegion != null) { - AppPolicyCfg appPolicyCfg = new AppPolicyCfg(); - BeanUtils.copyProperties(cfg, appPolicyCfg,new String[] {"cfgId"}); - //appPolicyCfg.setSpecServiceId(specificServiceCfg.getSpecServiceId()); - //appPolicyCfg.setAppCode(specificServiceCfg.getSpecServiceCode()); - appPolicyCfg.setMatchMethod(0); - appPolicyCfg.setIsHexbin(0); - appPolicyCfg.setCfgType(appRegion.getConfigRegionValue()); - appPolicyCfg.setCfgRegionCode(appRegion.getConfigRegionCode()); - if (StringUtils.isNotBlank(behaviorId)) { - //appPolicyCfg.setBehavCode(Integer.parseInt(behaviorId)); - appPolicyCfg.setExprType(1); - } else { - appPolicyCfg.setExprType(0); + cfg.setCfgRegionCode(regionDict.getConfigRegionCode()); + cfg.setCfgType(regionDict.getConfigRegionValue()); + cfg.setCreateTime(date); + cfg.setCreatorId(UserUtils.getUser().getId()); + cfg.setDoLog(2); + cfg.setFunctionId(regionDict.getFunctionId()); + if(isSend.equals("1")) { + cfg.setIsAudit(Constants.AUDIT_YES); + cfg.setIsValid(Constants.VALID_YES); + cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(date); + if(groupIds!=null&&groupIds.size()==_complexkeywordCfgs.size()) { + cfg.setGroupId(groupIds.get(ind)); } - appPolicyCfgs.add(appPolicyCfg); - } - } else { - if(!regionDict.getFunctionId().equals(402) && !regionDict.getFunctionId().equals(565) - && !regionDict.getFunctionId().equals(566) && !regionDict.getFunctionId().equals(564)) { - CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); - BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"}); - cfgIndexInfos.add(cfgIndexInfo); - } - if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 - || regionDict.getFunctionId().intValue()==564){ - AppFeatureIndex appfeature = new AppFeatureIndex(); - BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"}); - if(appFeatureRegion!=null){ - appfeature.setCfgRegionCode1(String.valueOf(appFeatureRegion.getConfigRegionCode())); - appfeature.setCfgRegionValue(appFeatureRegion.getConfigRegionValue()); - appfeature.setCfgRegionType(String.valueOf(appFeatureRegion.getRegionType())); + if(regionIds!=null&®ionIds.size()==_complexkeywordCfgs.size()) { + cfg.setRegionId(regionIds.get(ind)); } - appFeatureIndexs.add(appfeature); + }else { + cfg.setIsAudit(Constants.AUDIT_NOT_YET); + cfg.setIsValid(Constants.VALID_NO); } + //cfg.setIsAudit(0); + //cfg.setIsValid(0); + cfg.setIsAreaEffective(0); + cfg.setLable("0"); + cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId); + cfg.setAttribute(attribute); + cfg.setClassify(classify); + cfg.setServiceId(serviceDict.getServiceId()); + if(compileIds!=null&&compileIds.size()==_complexkeywordCfgs.size()) { + cfg.setCompileId(compileIds.get(ind)); + } + if(specificServiceCfg!=null) { + cfg.setAppCode(specificServiceCfg.getSpecServiceCode()); + cfg.setSpecServiceId(specificServiceCfg.getSpecServiceId()); + if(StringUtils.isNotBlank(behaviorId)) + cfg.setBehavCode(Integer.parseInt(behaviorId)); + } + if (serviceDict.getServiceId().intValue() == 33 + || serviceDict.getServiceId().intValue() == 145 + || serviceDict.getServiceId().intValue() == 35 + || serviceDict.getServiceId().intValue() == 147 + || serviceDict.getServiceId().intValue() == 36 + || serviceDict.getServiceId().intValue() == 148) { + if (appRegion != null) { + AppPolicyCfg appPolicyCfg = new AppPolicyCfg(); + BeanUtils.copyProperties(cfg, appPolicyCfg,new String[] {"cfgId"}); + //appPolicyCfg.setSpecServiceId(specificServiceCfg.getSpecServiceId()); + //appPolicyCfg.setAppCode(specificServiceCfg.getSpecServiceCode()); + appPolicyCfg.setMatchMethod(0); + appPolicyCfg.setIsHexbin(0); + appPolicyCfg.setCfgType(appRegion.getConfigRegionValue()); + appPolicyCfg.setCfgRegionCode(appRegion.getConfigRegionCode()); + if (StringUtils.isNotBlank(behaviorId)) { + //appPolicyCfg.setBehavCode(Integer.parseInt(behaviorId)); + appPolicyCfg.setExprType(1); + } else { + appPolicyCfg.setExprType(0); + } + appPolicyCfgs.add(appPolicyCfg); + } + } else { + if(!regionDict.getFunctionId().equals(402) && !regionDict.getFunctionId().equals(565) + && !regionDict.getFunctionId().equals(566) && !regionDict.getFunctionId().equals(564)) { + CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); + BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"}); + cfgIndexInfos.add(cfgIndexInfo); + } + if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 + || regionDict.getFunctionId().intValue()==564){ + AppFeatureIndex appfeature = new AppFeatureIndex(); + BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"}); + if(regionDict!=null){ + appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode())); + appfeature.setCfgRegionValue(regionDict.getConfigRegionValue()); + appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType())); + } + appFeatureIndexs.add(appfeature); + } + } + ind++; } - ind++; + ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); + cfgIndexInfos.clear(); + appPolicyCfgs.clear(); + _complexkeywordCfgs.clear(); + appFeatureIndexs.clear(); + } + + }else { + // APP Payload处理 + List _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE); + while(!appComplexFeatureCfgs.isEmpty()) { + appComplexFeatureCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE); + List compileIds=Lists.newArrayList(); + List groupIds=Lists.newArrayList(); + List regionIds=Lists.newArrayList(); + try { + compileIds = ConfigServiceUtil.getId(1,_complexkeywordCfgs.size()); + if(isSend.equals("1")) { + groupIds = ConfigServiceUtil.getId(2,_complexkeywordCfgs.size()); + regionIds = ConfigServiceUtil.getId(3,_complexkeywordCfgs.size()); + } + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + int ind=0; + for (AppComplexFeatureCfg cfg : _complexkeywordCfgs) { + cfg.setAction(serviceDict.getAction()); + /*cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(date);*/ + cfg.setCfgRegionCode(regionDict.getConfigRegionCode()); + cfg.setCfgType(regionDict.getConfigRegionValue()); + cfg.setCreateTime(date); + cfg.setCreatorId(UserUtils.getUser().getId()); + cfg.setDoLog(2); + cfg.setFunctionId(regionDict.getFunctionId()); + if(isSend.equals("1")) { + cfg.setIsAudit(Constants.AUDIT_YES); + cfg.setIsValid(Constants.VALID_YES); + cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(date); + if(groupIds!=null&&groupIds.size()==_complexkeywordCfgs.size()) { + cfg.setGroupId(groupIds.get(ind)); + } + if(regionIds!=null&®ionIds.size()==_complexkeywordCfgs.size()) { + cfg.setRegionId(regionIds.get(ind)); + } + }else { + cfg.setIsAudit(Constants.AUDIT_NOT_YET); + cfg.setIsValid(Constants.VALID_NO); + } + //cfg.setIsAudit(0); + //cfg.setIsValid(0); + cfg.setIsAreaEffective(0); + cfg.setLable("0"); + cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId); + cfg.setAttribute(attribute); + cfg.setClassify(classify); + cfg.setServiceId(serviceDict.getServiceId()); + if(compileIds!=null&&compileIds.size()==_complexkeywordCfgs.size()) { + cfg.setCompileId(compileIds.get(ind)); + } + if(specificServiceCfg!=null) { + cfg.setAppCode(specificServiceCfg.getSpecServiceCode()); + cfg.setSpecServiceId(specificServiceCfg.getSpecServiceId()); + if(StringUtils.isNotBlank(behaviorId)) + cfg.setBehavCode(Integer.parseInt(behaviorId)); + } + + + AppFeatureIndex appfeature = new AppFeatureIndex(); + BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"}); + if(regionDict!=null){ + appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode())); + appfeature.setCfgRegionValue(regionDict.getConfigRegionValue()); + appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType())); + } + appFeatureIndexs.add(appfeature); + + ind++; + } + ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); + cfgIndexInfos.clear(); + appPolicyCfgs.clear(); + _complexkeywordCfgs.clear(); + appFeatureIndexs.clear(); } - ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); - cfgIndexInfos.clear(); - appPolicyCfgs.clear(); - _complexkeywordCfgs.clear(); } }else if(regionDict.getRegionType().equals(6)) { if(regionDict.getFunctionId().equals(400)) { @@ -2061,6 +2195,8 @@ public class BaseController { ei.loadInitParams(HttpsRedirectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict); }else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换 ei.loadInitParams(HttpsReplaceComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict); + }else if(regionDict.getFunctionId().equals(563)) {// APP Payload + ei.loadInitParams(AppPayloadTemplate.class, this.getMsgProp(), regionDict, serviceDict); } else { ei.loadInitParams(ComplexStringAllTemplate.class, msgProp, regionDict, serviceDict); } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java index 79daef1d3..801831700 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java @@ -30,6 +30,7 @@ import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.configuration.template.AppDomainTemplate; +import com.nis.domain.configuration.template.AppPayloadTemplate; import com.nis.domain.configuration.template.AsnIpTemplate; import com.nis.domain.configuration.template.ComplexStringAllTemplate; import com.nis.domain.configuration.template.DdosIpTemplate; @@ -460,6 +461,11 @@ public class IpController extends BaseController{ ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceComplexTemplate.class, 2); excel.setDataList(this.getMsgProp(),classList,null). write(request,response, fileName).dispose(); + }else if(regionDict.getFunctionId().equals(563)) {// APP Payload + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, AppPayloadTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); }else{ List classList=new ArrayList(); ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, ComplexStringAllTemplate.class, 2); diff --git a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.java index 544cedd5f..37beaed0c 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.java @@ -63,6 +63,7 @@ public interface AppMultiFeatureCfgDao { public void deleteAppTcpCfg(BaseCfg entity); public int insertAppComplexFeatureCfg(AppComplexFeatureCfg entity); + public int insertAppComplexFeatureCfgBatch(AppComplexFeatureCfg entity); public void deleteAppComplexFeatureCfg(BaseCfg entity); //IP RANGE配置 public List getAppIpRangeCfg(@Param("compileId")Integer compileId,@Param("functionId")Integer functionId) ; diff --git a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml index a0987faa1..0997b2ee1 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml @@ -553,6 +553,29 @@ #{icmpCode,jdbcType=VARCHAR},#{icmpIdentifier,jdbcType=VARCHAR},#{headerType,jdbcType=VARCHAR} ) + + + + insert into app_complex_feature_cfg ( + APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, + SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, + DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5, + ver,ihl,tos,total_length,flags,fragment_offset,protocol,icmp_type,icmp_code,icmp_identifier,header_type + )values ( + , + #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER}, + #{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR}, + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}, + #{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}, + #{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}, + #{ver,jdbcType=VARCHAR},#{ihl,jdbcType=VARCHAR},#{tos,jdbcType=VARCHAR},#{totalLength,jdbcType=VARCHAR}, + #{flags,jdbcType=VARCHAR},#{fragmentOffset,jdbcType=VARCHAR},#{protocol,jdbcType=VARCHAR},#{icmpType,jdbcType=VARCHAR}, + #{icmpCode,jdbcType=VARCHAR},#{icmpIdentifier,jdbcType=VARCHAR},#{headerType,jdbcType=VARCHAR} + ) + + diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index 77fe7a122..f4902b221 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -1613,6 +1613,8 @@ public abstract class BaseService { type="DnsResStrategy"; }else if(list.get(0) instanceof AsnIpCfg) { type="AsnIpCfg"; + }else if(list.get(0) instanceof AppComplexFeatureCfg) { + type="AppComplexFeature"; } if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) { this.saveCfgIndexOf(cfgIndexInfos); @@ -1634,6 +1636,9 @@ public abstract class BaseService { }else if("AsnIpCfg".equals(type)) { List listPage = (List) list; this.saveAsnIpBatch(listPage); + }else if("AppComplexFeature".equals(type)) { + List listPage = (List) list; + this.saveAppComplexFeatureBatch(listPage); }else if("BaseStringCfg".equals(type)) { List> listPage = (List>) list; // 调用对应配置的service @@ -1815,6 +1820,30 @@ public abstract class BaseService { } } + + /** + * APP Payload导入配置时数据批量入库 + * @param data + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveAppComplexFeatureBatch(List data) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + AppComplexFeatureCfg cfg = data.get(index); + ((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppComplexFeatureCfgBatch(cfg); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + + } + /** * 同一个app下的ip批量保存 * @param cfgs diff --git a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java index 5b105e535..a251d9143 100644 --- a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java @@ -5,6 +5,8 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; +import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; @@ -20,6 +22,7 @@ import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppStringFeatureCfg; import com.nis.domain.configuration.AppTcpCfg; import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; @@ -111,43 +114,9 @@ public class AppMultiFeatureCfgService extends BaseService { cfg.setIsCaseInsenstive(0); cfg.setExprType(3); cfg.setMatchMethod(0); - String keyword = ""; - if(cfg.getHeaderType().equals("IP_header")){ - if(StringUtils.isNoneBlank(cfg.getVer())){ - keyword += "0-3:"+cfg.getVer()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIhl())){ - keyword += "4-7:"+cfg.getIhl()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getTos())){ - keyword += "8-15:"+cfg.getTos()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getTotalLength())){ - keyword += "16-31:"+cfg.getTotalLength()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getFlags())){ - keyword += "48-50:"+cfg.getFlags()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getFragmentOffset())){ - keyword += "56-63:"+cfg.getFragmentOffset()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getProtocol())){ - keyword += "72-79:"+cfg.getProtocol()+Constants.KEYWORD_EXPR; - } - }else{ - if(StringUtils.isNoneBlank(cfg.getIcmpType())){ - keyword += "0-7:"+cfg.getIcmpType()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIcmpCode())){ - keyword += "8-15:"+cfg.getIcmpCode()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIcmpIdentifier())){ - keyword += "32-47:"+cfg.getIcmpIdentifier()+Constants.KEYWORD_EXPR; - } - } - keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR)); - cfg.setCfgKeywords(keyword); + this.setL3HeaderKeyword(cfg); appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg); + }else if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); cfg.setHeaderType(null); @@ -205,43 +174,9 @@ public class AppMultiFeatureCfgService extends BaseService { cfg.setIsCaseInsenstive(0); cfg.setExprType(3); cfg.setMatchMethod(0); - String keyword = ""; - if(cfg.getHeaderType().equals("IP_header")){ - if(StringUtils.isNoneBlank(cfg.getVer())){ - keyword += "0-3:"+cfg.getVer()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIhl())){ - keyword += "4-7:"+cfg.getIhl()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getTos())){ - keyword += "8-15:"+cfg.getTos()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getTotalLength())){ - keyword += "16-31:"+cfg.getTotalLength()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getFlags())){ - keyword += "48-50:"+cfg.getFlags()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getFragmentOffset())){ - keyword += "56-63:"+cfg.getFragmentOffset()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getProtocol())){ - keyword += "72-79:"+cfg.getProtocol()+Constants.KEYWORD_EXPR; - } - }else{ - if(StringUtils.isNoneBlank(cfg.getIcmpType())){ - keyword += "0-7:"+cfg.getIcmpType()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIcmpCode())){ - keyword += "8-15:"+cfg.getIcmpCode()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIcmpIdentifier())){ - keyword += "32-47:"+cfg.getIcmpIdentifier()+Constants.KEYWORD_EXPR; - } - } - keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR)); - cfg.setCfgKeywords(keyword); + this.setL3HeaderKeyword(cfg); appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg); + }else if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); cfg.setHeaderType(null); @@ -259,6 +194,46 @@ public class AppMultiFeatureCfgService extends BaseService { } } } + + public void setL3HeaderKeyword(AppComplexFeatureCfg cfg) { + String keyword = ""; + if(cfg.getHeaderType().equals("IP_header")){ + if(StringUtils.isNoneBlank(cfg.getVer())){ + keyword += "0-3:"+cfg.getVer()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getIhl())){ + keyword += "4-7:"+cfg.getIhl()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getTos())){ + keyword += "8-15:"+cfg.getTos()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getTotalLength())){ + keyword += "16-31:"+cfg.getTotalLength()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getFlags())){ + keyword += "48-50:"+cfg.getFlags()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getFragmentOffset())){ + keyword += "56-63:"+cfg.getFragmentOffset()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getProtocol())){ + keyword += "72-79:"+cfg.getProtocol()+Constants.KEYWORD_EXPR; + } + }else{ + if(StringUtils.isNoneBlank(cfg.getIcmpType())){ + keyword += "0-7:"+cfg.getIcmpType()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getIcmpCode())){ + keyword += "8-15:"+cfg.getIcmpCode()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getIcmpIdentifier())){ + keyword += "32-47:"+cfg.getIcmpIdentifier()+Constants.KEYWORD_EXPR; + } + } + keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR)); + cfg.setCfgKeywords(keyword); + } + public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit) { ToMaatBean maatBean = new ToMaatBean(); MaatCfg maatCfg = new MaatCfg(); @@ -460,4 +435,219 @@ public class AppMultiFeatureCfgService extends BaseService { return dataMap; } + /** + * APP Payload L3_HEADER导入操作特殊属性限制 + * @param baseStringCfg + * @param errInfo + * @param prop + */ + public void checkImportAppPayload(AppComplexFeatureCfg baseStringCfg, StringBuffer errInfo, Properties prop) { + String headerType = baseStringCfg.getHeaderType(); + String ver = baseStringCfg.getVer(); + String ihl = baseStringCfg.getIhl(); + String tos = baseStringCfg.getTos(); + String totalLength = baseStringCfg.getTotalLength(); + String flags = baseStringCfg.getFlags(); + String fragmentOffset = baseStringCfg.getFragmentOffset(); + String protocol = baseStringCfg.getProtocol(); + String icmpType = baseStringCfg.getIcmpType(); + String icmpCode = baseStringCfg.getIcmpCode(); + String icmpIdentifier = baseStringCfg.getIcmpIdentifier(); + + boolean errorFlag = false; + Pattern pattern = Pattern.compile("^([0-9|a-f|A-F]*)$");//.matcher(keyword).matches(); + StringBuffer errInfoCopy = new StringBuffer(); + errInfoCopy.append(errInfo); + + if("IP_header".equals(headerType)) { + boolean ipHeaderFlag = false; + List ipHeaderList = new ArrayList<>(); + if(StringUtils.isNotBlank(baseStringCfg.getVer())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getIhl())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getTos())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getTotalLength())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getFlags())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getFragmentOffset())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getProtocol())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(ipHeaderList.size() > 4) {// IP_header最多填写四个属性值 + errInfo.append("IP_header " + prop.getProperty("l3_header_error")+";"); + }else { + ipHeaderFlag = true; + } + + int count = 0; + if(StringUtils.isBlank(ver) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "VER ") + ";"); + }else if(ver.trim().length() != 4 && ipHeaderFlag){ + errInfo.append( + "VER "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(ver).matches() && ipHeaderFlag) { + errInfo.append( + "VER "+ " '" + ver + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(ihl) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "IHL ") + ";"); + }else if(ihl.trim().length() != 4 && ipHeaderFlag){ + errInfo.append( + "IHL "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(ihl).matches() && ipHeaderFlag) { + errInfo.append( + "IHL "+ " '" + ihl + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(tos) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "TOS ") + ";"); + }else if(tos.trim().length() != 8 && ipHeaderFlag){ + errInfo.append( + "TOS "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(tos).matches() && ipHeaderFlag) { + errInfo.append( + "TOS "+ " '" + tos + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(totalLength) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "Total Length ") + ";"); + }else if(totalLength.trim().length() != 16 && ipHeaderFlag){ + errInfo.append( + "Total Length "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(totalLength).matches() && ipHeaderFlag) { + errInfo.append( + "Total Length "+ " '" + totalLength + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(flags) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "Flags ") + ";"); + }else if(flags.trim().length() != 3 && ipHeaderFlag){ + errInfo.append( + "Flags "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(flags).matches() && ipHeaderFlag) { + errInfo.append( + "Flags "+ " '" + flags + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(fragmentOffset) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "fragment offset ") + ";"); + }else if(fragmentOffset.trim().length() != 8 && ipHeaderFlag){ + errInfo.append( + "fragment offset "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(fragmentOffset).matches() && ipHeaderFlag) { + errInfo.append( + "fragment offset "+ " '" + fragmentOffset + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(protocol) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "Protocol ") + ";"); + }else if(protocol.trim().length() != 8 && ipHeaderFlag){ + errInfo.append( + "Protocol "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(protocol).matches() && ipHeaderFlag) { + errInfo.append( + "Protocol "+ " '" + protocol + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if((count >0 || count <5) && (!errorFlag)) { + errInfo.setLength(0);; + errInfo.append(errInfoCopy); + } + baseStringCfg.setIcmpType(null); + baseStringCfg.setIcmpCode(null); + baseStringCfg.setIcmpIdentifier(null); + }else { + int count = 0; + if(StringUtils.isBlank(icmpType)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "ICMP type ") + ";"); + }else if(icmpType.trim().length() != 8){ + errInfo.append( + "ICMP type "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(icmpType).matches()) { + errInfo.append( + "ICMP type "+ " '" + icmpType + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(icmpCode)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "ICMP code ") + ";"); + }else if(icmpCode.trim().length() != 8){ + errInfo.append( + "ICMP code "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(icmpCode).matches()) { + errInfo.append( + "ICMP code "+ " '" + icmpCode + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(icmpIdentifier)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "ICMP identifier ") + ";"); + }else if(icmpIdentifier.trim().length() != 16){ + errInfo.append( + "ICMP identifier "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(icmpIdentifier).matches()) { + errInfo.append( + "ICMP identifier "+ " '" + icmpIdentifier + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if((count >0) && (!errorFlag)) { + errInfo.setLength(0);; + errInfo.append(errInfoCopy); + } + baseStringCfg.setVer(null); + baseStringCfg.setIhl(null); + baseStringCfg.setTos(null); + baseStringCfg.setTotalLength(null); + baseStringCfg.setFlags(null); + baseStringCfg.setFragmentOffset(null); + baseStringCfg.setProtocol(null); + } + + } + } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index e35ca8087..27aac9641 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1438,4 +1438,10 @@ print=Print traffic_connect_log=Traffic Log keyword_log_to_url=KeywordLogToURL http_log=HTTP Logs -cut_sample_tool=Cut Sample Tool \ No newline at end of file +cut_sample_tool=Cut Sample Tool +hex_minlength_3=Please enter a hexadecimal string of length 3 +hex_minlength_4=Please enter a hexadecimal string of length 4 +hex_minlength_8=Please enter a hexadecimal string of length 8 +hex_minlength_16=Please enter a hexadecimal string of length 16 +need_input=Attributes need to be filled in +max_input=Fill in at most four \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 8b97df174..0cb27f12d 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1442,4 +1442,10 @@ print=Print traffic_connect_log=\u0416\u0443\u0440\u043D\u0430\u043B \u0422\u0440\u0430\u0444\u0438\u043A\u0430 keyword_log_to_url=KeywordLogToURL http_log=HTTP Logs -cut_sample_tool=Cut Sample Tool \ No newline at end of file +cut_sample_tool=Cut Sample Tool +hex_minlength_3=Please enter a hexadecimal string of length 3 +hex_minlength_4=Please enter a hexadecimal string of length 4 +hex_minlength_8=Please enter a hexadecimal string of length 8 +hex_minlength_16=Please enter a hexadecimal string of length 16 +need_input=Attributes need to be filled in +max_input=Fill in at most four \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 07a1d0de1..710d6f28b 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1438,4 +1438,10 @@ print=\u6253\u5370 traffic_connect_log=\u6D41\u91CF\u65E5\u5FD7 keyword_log_to_url=\u5173\u952E\u5B57\u65E5\u5FD7\u8F6CURL http_log=HTTP \u65E5\u5FD7 -cut_sample_tool=\u6837\u4F8B\u526A\u5207\u5DE5\u5177 \ No newline at end of file +cut_sample_tool=\u6837\u4F8B\u526A\u5207\u5DE5\u5177 +hex_minlength_3=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A3\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32 +hex_minlength_4=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A4\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32 +hex_minlength_8=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A8\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32 +hex_minlength_16=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A16\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32 +need_input=\u9700\u8981\u586B\u5199\u5C5E\u6027 +max_input=\u6700\u591A\u586B\u5199\u56DB\u4E2A \ No newline at end of file diff --git a/src/main/resources/sql/20190102/update_function_dicts.sql b/src/main/resources/sql/20190102/update_function_dicts.sql new file mode 100644 index 000000000..2b3c60455 --- /dev/null +++ b/src/main/resources/sql/20190102/update_function_dicts.sql @@ -0,0 +1,6 @@ +-- APP Payload -- +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 563 AND dict_id = 211; +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 563 AND dict_id = 212; +UPDATE function_service_dict SET is_import = 1 WHERE function_id = 563; + + diff --git a/src/main/webapp/WEB-INF/include/excel/importModal.jsp b/src/main/webapp/WEB-INF/include/excel/importModal.jsp index a72b2da63..2b5297212 100644 --- a/src/main/webapp/WEB-INF/include/excel/importModal.jsp +++ b/src/main/webapp/WEB-INF/include/excel/importModal.jsp @@ -94,11 +94,11 @@
- - + +