From 23c7d024cd515d97266f42a6d0ceb43c58d0eeda Mon Sep 17 00:00:00 2001 From: zhangwei Date: Fri, 4 Jan 2019 19:37:22 +0600 Subject: [PATCH 1/7] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .classpath | 12 ++++++------ .settings/org.eclipse.wst.common.component | 3 --- src/main/resources/jdbc.properties | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.classpath b/.classpath index 8f5d0c05f..1bd04b74e 100644 --- a/.classpath +++ b/.classpath @@ -28,7 +28,7 @@ - + @@ -108,11 +108,6 @@ - - - - - @@ -158,5 +153,10 @@ + + + + + diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 02aec5565..dbec03a4c 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -4,9 +4,6 @@ - - uses - diff --git a/src/main/resources/jdbc.properties b/src/main/resources/jdbc.properties index a03ff6e0f..291639453 100644 --- a/src/main/resources/jdbc.properties +++ b/src/main/resources/jdbc.properties @@ -1,13 +1,13 @@ #jdbc for oracle #jdbc.driver=oracle.jdbc.driver.OracleDriver jdbc.devlop.driver=com.mysql.jdbc.Driver -jdbc.devlop.url=jdbc:mysql://192.168.10.204:3306/gwall_dev?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true +jdbc.devlop.url=jdbc:mysql://10.0.4.221:3306/ntc_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true jdbc.devlop.username=root jdbc.devlop.key=pR3JFt5dsGCW0nZO3TLF7Q== jdbc.devlop.password=JgW5tsiGBNAtcqCgSQIP0g== jdbc.product.driver=com.mysql.jdbc.Driver -jdbc.product.url=jdbc:mysql://192.168.10.204:3306/gwall_dev?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true +jdbc.product.url=jdbc:mysql://10.0.4.221:3306/ntc_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true jdbc.product.username=root jdbc.product.key=pR3JFt5dsGCW0nZO3TLF7Q== jdbc.product.password=JgW5tsiGBNAtcqCgSQIP0g== From e1b2681b9fa672eea83b8510f6779bff7e44d7aa Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sat, 5 Jan 2019 12:46:16 +0600 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=89=88=E6=9C=AC=E5=8F=B7=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/nis.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 8a4e1292d..1656e7b0e 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -573,7 +573,7 @@ trafficBandwidthTrans=v1/trafficBandwidthTrans trafficProtocolList=v1/trafficProtocolList irSnatLog=irSnatLogs irDnatLog=irDnatLogs -trafficBandwidthTransv1/=trafficBandwidthTrans +trafficBandwidthTrans=v1/trafficBandwidthTrans trafficProtocolList=v1/trafficProtocolList trafficAppList=v1/trafficAppList ntcActionEntranceReport=v1/ntcActionEntranceReport From 46c26f703afe871f9370665d9cef453183d08c4e Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Sat, 5 Jan 2019 18:49:58 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=84=E8=AF=AD?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/messages/message_ru.properties | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index fac54d252..ca50a1542 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1443,12 +1443,12 @@ traffic_connect_log=\u0416\u0443\u0440\u043D\u0430\u043B \u0422\u0440\u0430\u044 keyword_log_to_url=KeywordLogToURL http_log=HTTP Logs 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 +hex_minlength_3=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043D\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443 \u0434\u043B\u0438\u043D\u043E\u0439 3 +hex_minlength_4=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043D\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443 \u0434\u043B\u0438\u043D\u043E\u0439 4 +hex_minlength_8=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043D\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443 \u0434\u043B\u0438\u043D\u043E\u0439 8 +hex_minlength_16=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043D\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443 \u0434\u043B\u0438\u043D\u043E\u0439 16 +need_input=\u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u043E +max_input=\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E \u0447\u0435\u0442\u044B\u0440\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430 no_need_input=Attributes no need to be filled in close_link=Close Link asn_group=ASN Group From 9979bb26b24b3a79372dda652d11c5ed148aabfb Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Sat, 5 Jan 2019 21:16:23 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=97=B6=E9=97=B4=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E9=99=90=E5=88=B6.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/report/asnRecordList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/report/eventBlockList.jsp | 8 ++++---- .../WEB-INF/views/report/eventKeyProtectionList.jsp | 8 ++++---- src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp | 8 ++++---- src/main/webapp/WEB-INF/views/report/urlReportList.jsp | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp index ccc773417..dcf7d214f 100644 --- a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp +++ b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp @@ -146,7 +146,7 @@ <%-- value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchFoundStartTime','#searchFoundEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -157,7 +157,7 @@ <%-- value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchFoundEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchFoundStartTime','#searchFoundEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
diff --git a/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp b/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp index f7f0c2816..446052699 100644 --- a/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp @@ -217,7 +217,7 @@
+ value="${log.searchTaskStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchTaskStartTime','#searchTaskEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -227,7 +227,7 @@
+ value="${log.searchTaskEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchTaskStartTime','#searchTaskEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -238,7 +238,7 @@
+ value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchReportStartTime','#searchReportEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -248,7 +248,7 @@
+ value="${log.searchReportEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchReportStartTime','#searchReportEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
diff --git a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp index 1b3d4313e..073d388ff 100644 --- a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp @@ -215,7 +215,7 @@
+ value="${log.searchTaskStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchTaskStartTime','#searchTaskEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -225,7 +225,7 @@
+ value="${log.searchTaskEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchTaskStartTime','#searchTaskEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -236,7 +236,7 @@
+ value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchReportStartTime','#searchReportEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -246,7 +246,7 @@
+ value="${log.searchReportEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchReportStartTime','#searchReportEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
diff --git a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp index 686d2a2f7..32c2ad3f1 100644 --- a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp @@ -226,7 +226,7 @@
+ value="${log.searchTaskStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchTaskStartTime','#searchTaskEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -236,7 +236,7 @@
+ value="${log.searchTaskEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchTaskStartTime','#searchTaskEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -247,7 +247,7 @@
+ value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchReportStartTime','#searchReportEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -257,7 +257,7 @@
+ value="${log.searchReportEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchReportStartTime','#searchReportEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
diff --git a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp index b419adc36..ce3361228 100644 --- a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp +++ b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp @@ -145,7 +145,7 @@ <%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchReportStartTime','#searchReportEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -156,7 +156,7 @@ <%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchReportEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchReportStartTime','#searchReportEndTime',1,'w','yyyy-MM-dd hh:mm:ss',false)"/>
From f56a0fe09a78eb6e9447f204634fa23d1020cde2 Mon Sep 17 00:00:00 2001 From: wangxin Date: Sun, 6 Jan 2019 11:24:49 +0800 Subject: [PATCH 5/7] =?UTF-8?q?(1)asn=E5=AF=BC=E5=85=A5=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=9B=BD=E5=AE=B6=EF=BC=8Casn=E5=8F=B7?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=EF=BC=8C=E7=BB=84=E7=BB=87=E5=9B=BD=E5=AE=B6?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA=EF=BC=8Casn=E5=8F=B7?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=B8=BA=E4=B8=A4=E4=B8=AA=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=89=80=E6=9C=89=20(2)=E6=96=B0=E5=A2=9Easn=5Fkeyword=5Fcfg?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E7=94=A8=E4=BA=8E=E4=BF=9D=E5=AD=98=E5=B9=B6?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=E6=9C=89=E6=95=88=E4=B8=94=E5=90=AB=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=80=9A=E8=BF=87asn=20ip=E7=9A=84=20asn=E5=8F=B7=20(?= =?UTF-8?q?3)asn=20=E5=AF=BC=E5=85=A5=E5=8E=BB=E9=99=A4=E6=9D=A1=E6=95=B0?= =?UTF-8?q?=E9=99=90=E5=88=B6=20(4)=E9=A1=B5=E9=9D=A2asn=20select=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E8=BF=98=E6=98=AF=E4=BC=9A=E5=BD=B1=E5=93=8D=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E9=A1=B5=E9=9D=A2=E9=80=9F=E5=BA=A6=EF=BC=8C=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E6=94=B9=E4=B8=BAinput=20(5)asn=5Fgroup=5Finfo=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9org=5Fgroup=5Fid=E4=B8=BAissued=5Fips?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E4=BA=8E=E4=BF=9D=E5=AD=98=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=9A=84asn=20ip=20(6)=E5=88=86=E7=BB=84?= =?UTF-8?q?=E5=A4=8D=E7=94=A8url=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=A1=A5=E5=85=A8v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nis/domain/basics/AsnGroupInfo.java | 18 +- .../domain/configuration/AsnKeywordCfg.java | 49 +++ .../domain/configuration/CfgIndexInfo.java | 15 +- .../configuration/template/AsnIpTemplate.java | 6 +- .../com/nis/util/excel/ImportBigExcel.java | 11 +- .../excel/thread/CheckIpFormatThread.java | 116 +++--- .../nis/web/controller/BaseController.java | 1 + .../controller/basics/AsnGroupController.java | 25 ++ .../controller/basics/AsnIpController.java | 12 +- .../configuration/ntc/IpController.java | 31 +- .../nis/web/dao/basics/AsnGroupInfoDao.java | 4 +- .../nis/web/dao/basics/AsnGroupInfoDao.xml | 50 ++- .../com/nis/web/dao/basics/AsnIpCfgDao.java | 3 + .../com/nis/web/dao/basics/AsnIpCfgDao.xml | 104 ++++++ .../web/dao/configuration/StringCfgDao.java | 3 + .../web/dao/configuration/StringCfgDao.xml | 32 ++ .../java/com/nis/web/service/BaseService.java | 17 +- .../service/basics/AsnGroupInfoService.java | 82 ++++- .../web/service/basics/AsnIpCfgService.java | 95 ++--- .../service/configuration/IpCfgService.java | 342 ++++++++++-------- .../specific/ConfigGroupInfoService.java | 7 +- .../resources/messages/message_en.properties | 9 +- .../resources/messages/message_ru.properties | 9 +- .../messages/message_zh_CN.properties | 9 +- src/main/resources/nis.properties | 4 +- .../resources/sql/20190106/asn_group_info.sql | 42 +++ .../sql/20190106/asn_keyword_cfg.sql | 59 +++ .../WEB-INF/views/basics/asnGroupList.jsp | 22 +- .../WEB-INF/views/basics/asnIpCfgFormAdd.jsp | 27 +- .../views/basics/asnIpCfgFormUpdate.jsp | 60 +-- .../WEB-INF/views/cfg/ipaddr/asnForm.jsp | 7 +- .../WEB-INF/views/cfg/ipaddr/ipForm.jsp | 2 +- .../WEB-INF/views/cfg/ipaddr/ipSubList.jsp | 28 +- .../1.11.0/jquery.validate.method.js | 35 ++ .../1.11.0/localization/messages_en.js | 2 + .../1.11.0/localization/messages_ru.js | 2 + .../1.11.0/localization/messages_zh.js | 2 + 37 files changed, 968 insertions(+), 374 deletions(-) create mode 100644 src/main/java/com/nis/domain/configuration/AsnKeywordCfg.java create mode 100644 src/main/resources/sql/20190106/asn_group_info.sql create mode 100644 src/main/resources/sql/20190106/asn_keyword_cfg.sql diff --git a/src/main/java/com/nis/domain/basics/AsnGroupInfo.java b/src/main/java/com/nis/domain/basics/AsnGroupInfo.java index 991714bb4..f76c5e316 100644 --- a/src/main/java/com/nis/domain/basics/AsnGroupInfo.java +++ b/src/main/java/com/nis/domain/basics/AsnGroupInfo.java @@ -17,25 +17,27 @@ public class AsnGroupInfo extends BaseCfg implements Serializable{ */ private static final long serialVersionUID = 7931466570918016654L; private Integer groupId; - private Integer orgGroupId; + private Long issuedIPs; @ExcelField(title="cfg_id",sort=301) private Integer compileId; - @ExcelField(title="organization",sort=302) + @ExcelField(title="asn_name",sort=302) private String organization; - @ExcelField(title="organization",sort=303) + @ExcelField(title="country_code",sort=303) private String country; - @ExcelField(title="organization",sort=304) + @ExcelField(title="details",sort=304) private String detail; private Integer isValid; @ExcelField(title="ASN",sort=305) private Long asnId; - public Integer getOrgGroupId() { - return orgGroupId; + + + public Long getIssuedIPs() { + return issuedIPs; } - public void setOrgGroupId(Integer orgGroupId) { - this.orgGroupId = orgGroupId; + public void setIssuedIPs(Long issuedIPs) { + this.issuedIPs = issuedIPs; } public Integer getCompileId() { diff --git a/src/main/java/com/nis/domain/configuration/AsnKeywordCfg.java b/src/main/java/com/nis/domain/configuration/AsnKeywordCfg.java new file mode 100644 index 000000000..280a520c2 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AsnKeywordCfg.java @@ -0,0 +1,49 @@ +/** + *@Title: SslCertConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月6日 上午8:59:51 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import com.nis.util.excel.ExcelField; + +/** + * @ClassName: SslCertConfig.java + * @Description: TODO + * @author (dell) + * @date 2018年2月6日 上午8:59:51 + * @version V1.0 + */ +public class AsnKeywordCfg extends BaseStringCfg{ + private static final String tableName="asn_keyword_cfg"; + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = -6121146112218278084L; + @ExcelField(title="ASN",sort=201) + private String cfgKeywords; + /* (non-Javadoc) + * @see com.nis.domain.configuration.ComplexkeywordCfg#initDefaultValue() + */ + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.exprType=0; + this.matchMethod=3; + this.isHexbin=0; + } + @ExcelField(title="organization",sort=3) + protected String userRegion4; + + public static String getTablename() { + return tableName; + } + +} diff --git a/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java b/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java index a5cacb998..2a6c8d87a 100644 --- a/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java +++ b/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java @@ -83,7 +83,7 @@ public class CfgIndexInfo extends BaseCfg { private String organization; private String country; private String detail; - private List asnGroups; + private List asnKeywords; /*private CachePolicyUserRegion cachePolicyUserRegion;//缓存策略用户自定义域参数 @@ -95,15 +95,16 @@ public class CfgIndexInfo extends BaseCfg { }*/ - public List getAsnGroups() { - return asnGroups; - } - public void setAsnGroups(List asnGroups) { - this.asnGroups = asnGroups; - } + public String getOrganization() { return organization; } + public List getAsnKeywords() { + return asnKeywords; + } + public void setAsnKeywords(List asnKeywords) { + this.asnKeywords = asnKeywords; + } public void setOrganization(String organization) { this.organization = organization; } diff --git a/src/main/java/com/nis/domain/configuration/template/AsnIpTemplate.java b/src/main/java/com/nis/domain/configuration/template/AsnIpTemplate.java index 50f53e26f..fc4d27ca3 100644 --- a/src/main/java/com/nis/domain/configuration/template/AsnIpTemplate.java +++ b/src/main/java/com/nis/domain/configuration/template/AsnIpTemplate.java @@ -42,21 +42,21 @@ public class AsnIpTemplate extends BasicTemplate{ public void setDestIpAddress(String destIpAddress) { this.destIpAddress = destIpAddress; } - @ExcelField(title="organization",align=2,sort=1) + @ExcelField(title="asn_name",align=2,sort=1) public String getOrganization() { return organization; } public void setOrganization(String organization) { this.organization = organization; } - @ExcelField(title="country",align=2,sort=14) + @ExcelField(title="country_code",align=2,sort=14) public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } - @ExcelField(title="detail",align=2,sort=13) + @ExcelField(title="details",align=2,sort=13) public String getDetail() { return detail; } diff --git a/src/main/java/com/nis/util/excel/ImportBigExcel.java b/src/main/java/com/nis/util/excel/ImportBigExcel.java index c6c99bf96..71a39afad 100644 --- a/src/main/java/com/nis/util/excel/ImportBigExcel.java +++ b/src/main/java/com/nis/util/excel/ImportBigExcel.java @@ -69,6 +69,15 @@ public class ImportBigExcel extends XLSXCovertCSVReader{ private boolean districtShow=false; private List annotationList; private List> 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 diff --git a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java index b7b0e55db..f02e8532b 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java @@ -226,24 +226,52 @@ public class CheckIpFormatThread implements Callable{ } } 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{ //缓存中没有 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 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)) { diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 7d17ac449..b1df7c17a 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1344,6 +1344,7 @@ public class BaseController { BlockingQueue list = ei.getDataList(P2pIpTemplate.class ); ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list); } else if (regionDict.getFunctionId().equals(600)) {// ASN IP + ei.setHasImportLimit(false); //加载asn缓存 //AsnCacheUtils.init(true); //从数据库中读取 diff --git a/src/main/java/com/nis/web/controller/basics/AsnGroupController.java b/src/main/java/com/nis/web/controller/basics/AsnGroupController.java index 2f90cd108..a00e3d8ef 100644 --- a/src/main/java/com/nis/web/controller/basics/AsnGroupController.java +++ b/src/main/java/com/nis/web/controller/basics/AsnGroupController.java @@ -16,6 +16,8 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; import com.nis.domain.basics.AsnGroupInfo; +import com.nis.domain.basics.AsnIpCfg; +import com.nis.domain.specific.ConfigGroupInfo; import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; /** @@ -110,6 +112,14 @@ public class AsnGroupController extends BaseController { } return false; } + @RequestMapping(value="ajaxGetAuditedIPAddress",method=RequestMethod.POST) + @ResponseBody + public boolean ajaxGetAuditedIPAddress(Model model,@RequestParam(required=true,value="asnIds")String asnIds){ + if(StringUtils.isNotBlank(asnIds)) { + return asnGroupInfoService.checkIpAddrs(asnIds); + } + return false; + } @RequestMapping(value="asnGroupName",method=RequestMethod.POST) @ResponseBody public Integer asnGroupName(Model model,@RequestParam(required=true,value="id")Long id,@RequestParam(required=true,value="organization")String organization,@RequestParam(required=true,value="country")String country, @@ -154,4 +164,19 @@ public class AsnGroupController extends BaseController { return false; } + /** + * 校验asn号是否已存在 + */ + @ResponseBody + @RequestMapping(value = {"/orgMustExists"}) + public boolean orgMustExists(AsnIpCfg cfg, HttpServletRequest request, HttpServletResponse response){ + cfg.setIsValid(1); + AsnIpCfg asnIpCfg=asnIpCfgService.getOne(cfg); + if(asnIpCfg == null){ + return false; + } + + return true; + } + } diff --git a/src/main/java/com/nis/web/controller/basics/AsnIpController.java b/src/main/java/com/nis/web/controller/basics/AsnIpController.java index a307b78c0..25a42de54 100644 --- a/src/main/java/com/nis/web/controller/basics/AsnIpController.java +++ b/src/main/java/com/nis/web/controller/basics/AsnIpController.java @@ -61,8 +61,8 @@ public class AsnIpController extends BaseController{ ,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ initFormCondition(model,cfg); - List groupInfos=configGroupInfoService.findAllList(4); - model.addAttribute("policyGroups", groupInfos); + //List groupInfos=configGroupInfoService.findAllList(4); + //model.addAttribute("policyGroups", groupInfos); model.addAttribute("_cfg", cfg); return "/basics/asnIpCfgFormAdd"; } @@ -72,8 +72,8 @@ public class AsnIpController extends BaseController{ ,RedirectAttributes redirectAttributes){ cfg = asnIpCfgService.get(Long.parseLong(ids)); initUpdateFormCondition(model, cfg); - List groupInfos=configGroupInfoService.findAllList(4); - model.addAttribute("policyGroups", groupInfos); + //List groupInfos=configGroupInfoService.findAllList(4); + //model.addAttribute("policyGroups", groupInfos); model.addAttribute("_cfg", cfg); return "/basics/asnIpCfgFormUpdate"; } @@ -181,14 +181,14 @@ public class AsnIpController extends BaseController{ return "redirect:" + adminPath +"/basics/asn/list?functionId="+functionId; } - @RequestMapping(value = {"/ajaxDeleteAsnIp"}) + /*@RequestMapping(value = {"/ajaxDeleteAsnIp"}) public void ajaxDeleteAsnIp(String ids, HttpServletRequest request, HttpServletResponse response){ try{ asnIpCfgService.ajaxDeleteAsnIp(ids); }catch(Exception e){ logger.error("Delete failed",e); } - } + }*/ @RequestMapping(value="ajaxGetGroups",method=RequestMethod.POST) @ResponseBody public List ajaxGetGroups(Model model,@RequestParam(required=true,value="org")String org){ 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 f22410e1d..ddac3858f 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 @@ -26,6 +26,7 @@ import com.nis.domain.FunctionRegionDict; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.basics.AsnGroupInfo; +import com.nis.domain.configuration.AsnKeywordCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; @@ -93,8 +94,8 @@ public class IpController extends BaseController{ }else{ initFormCondition(model,entity); } - List policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4); - model.addAttribute("policyGroups", policyGroups); + //List policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4); + //model.addAttribute("policyGroups", policyGroups); model.addAttribute("_cfg", entity); return "/cfg/ipaddr/ipForm"; } @@ -127,8 +128,14 @@ public class IpController extends BaseController{ } } } - if(StringUtils.isNotBlank(cfg.getUserRegion4())) { - tabList.add(new String[]{"3","ASN"}); + if(cfg.getAsnKeywords()!=null){ + String cfgType = null; + for(AsnKeywordCfg keyword:cfg.getAsnKeywords()){ + if(!keyword.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"3",keyword.getCfgType()}); + cfgType = keyword.getCfgType(); + } + } } model.addAttribute("_cfg", cfg); model.addAttribute("index", index); @@ -177,11 +184,11 @@ public class IpController extends BaseController{ entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - if(StringUtils.isNoneBlank(entity.getUserRegion4())) { + /*if(StringUtils.isNoneBlank(entity.getUserRegion4())) { ipCfgService.auditAsnCfg(entity, isAudit); - }else { + }else {*/ ipCfgService.auditIpCfg(entity,isAudit); - } + /*}*/ addMessage(redirectAttributes,"success", "audit_success"); } catch (Exception e) { logger.info("ip配置下发失败:"+e.getMessage()); @@ -524,13 +531,13 @@ public class IpController extends BaseController{ titleList.add("asn_policy"); classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); classMap.put("NTC_IP", IpPortCfg.class); - classMap.put("asn_policy", AsnGroupInfo.class); + classMap.put("asn_policy", AsnKeywordCfg.class); String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion3,userregion4,userregion5,&userregion2:ratelimit-"; String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + ",config_time,editor,edit_time,auditor,audit_time" +",letter,whether_area_block,classification,attribute,label" +",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,"; - String asnGroupInfoNoExport=ipPortInfoNoExport+"block_type,"; + String asnGroupInfoNoExport=ipPortInfoNoExport+"block_type,block_type,expression_type,match_method,is_hex,is_case_insenstive,"; // 时间过滤 if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; @@ -548,13 +555,11 @@ public class IpController extends BaseController{ noExportMap.put("NTC_IP", ipPortInfoNoExport); noExportMap.put("asn_policy", asnGroupInfoNoExport); List ipList=new ArrayList(); - List groupInfoList=new ArrayList(); + List groupInfoList=new ArrayList(); for (CfgIndexInfo cfg : ipLists) { CfgIndexInfo cfgIndexInfo=ipCfgService.exportIpInfo(cfg); ipList.addAll(cfgIndexInfo.getIpPortList()); - if(!StringUtil.isEmpty(cfgIndexInfo.getUserRegion4())){ - groupInfoList.addAll(cfgIndexInfo.getAsnGroups()); - } + groupInfoList.addAll(cfgIndexInfo.getAsnKeywords()); } dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_IP", ipList); diff --git a/src/main/java/com/nis/web/dao/basics/AsnGroupInfoDao.java b/src/main/java/com/nis/web/dao/basics/AsnGroupInfoDao.java index 3150d2cf4..9d5dd3bb2 100644 --- a/src/main/java/com/nis/web/dao/basics/AsnGroupInfoDao.java +++ b/src/main/java/com/nis/web/dao/basics/AsnGroupInfoDao.java @@ -12,7 +12,7 @@ import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface AsnGroupInfoDao extends CrudDao { List findAsnGroupInfoList(AsnGroupInfo policyGroupInfo); - AsnGroupInfo getById(int id); + AsnGroupInfo getById(long id); AsnGroupInfo getByGroupId(int groupId); AsnGroupInfo getInfoByAsnNo(AsnGroupInfo policyGroupInfo); Integer getGroupIdByOrganization(String organization); @@ -28,5 +28,5 @@ public interface AsnGroupInfoDao extends CrudDao { void insertBatch(List policyGroupInfos); List findAsnGroupInfos(); Long getCount(); - void audit(AsnIpCfg t); + void modifyIssuedIp(AsnGroupInfo info); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/basics/AsnGroupInfoDao.xml b/src/main/java/com/nis/web/dao/basics/AsnGroupInfoDao.xml index 24163767b..2536d0e20 100644 --- a/src/main/java/com/nis/web/dao/basics/AsnGroupInfoDao.xml +++ b/src/main/java/com/nis/web/dao/basics/AsnGroupInfoDao.xml @@ -14,11 +14,11 @@ - + r.id,r.group_id,r.compile_id,r.organization,r.country,r.detail,r.is_valid,r.create_time,r.edit_time, - r.creator_id,r.editor_id,r.asn_id,r.org_group_id + r.creator_id,r.editor_id,r.asn_id,r.issued_ips @@ -55,8 +55,8 @@ AND r.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%') - - AND r.org_group_id =#{orgGroupId } + + AND r.issued_ips =#{issuedIPs } AND r.is_valid =#{isValid } @@ -87,7 +87,7 @@ - insert into asn_group_info(group_id,compile_id,organization,country,detail,is_valid,creator_id,create_time,editor_id,edit_time,asn_id,org_group_id + insert into asn_group_info(group_id,compile_id,organization,country,detail,is_valid,creator_id,create_time,editor_id,edit_time,asn_id )values ( #{groupId,jdbcType=INTEGER}, #{compileId,jdbcType=INTEGER}, @@ -99,8 +99,7 @@ #{createTime,jdbcType=TIMESTAMP}, #{editorId,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP}, - #{asnId,jdbcType=INTEGER}, - #{orgGroupId,jdbcType=INTEGER} + #{asnId,jdbcType=INTEGER} ) @@ -126,8 +125,8 @@ group_id = #{groupId,jdbcType=INTEGER}, - - org_group_id = #{orgGroupId,jdbcType=INTEGER}, + + issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER}, compile_id = #{compileId,jdbcType=INTEGER}, @@ -153,6 +152,9 @@ is_valid = #{isValid,jdbcType=INTEGER}, + + issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER}, + @@ -160,9 +162,37 @@ and group_id = #{groupId,jdbcType=INTEGER} + + and asn_id = #{asnId,jdbcType=INTEGER} + and id = #{id,jdbcType=INTEGER} + and is_valid != -1 + + + + + update asn_group_info + + + + issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER}, + + + + + + + and group_id = #{groupId,jdbcType=INTEGER} + + + and asn_id = #{asnId,jdbcType=INTEGER} + + + and id = #{id,jdbcType=INTEGER} + + and is_valid != -1 @@ -225,7 +255,7 @@ SELECT FROM - asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid =1 + asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid =1 AND issued_ips>0 + select 1 from asn_ip_cfg where is_valid=1 and asn_ip_group=#{groupId} and cfg_id !=#{cfgId} limit 1 @@ -447,6 +548,9 @@ + diff --git a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java index 7739dd796..99082bc06 100644 --- a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java @@ -4,6 +4,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; +import com.nis.domain.configuration.AsnKeywordCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; @@ -45,7 +46,9 @@ public interface StringCfgDao extends CrudDao{ public void deleteByCompileIds(@Param("user")long user,@Param("tableName")String tableName,@Param("compileIds")String compileIds); public List findSubscribeIdCfgListByCfgIndexInfo(CfgIndexInfo entity); public void deleteSubscribeIdCfgByCfgIndexInfo(CfgIndexInfo entity); + public void deleteAsnKeyword(CfgIndexInfo entity); public List findSubscribeIdCfgList(NtcSubscribeIdCfg ntcSubscribeIdCfg); + public List findAsnKeywordCfgList(CfgIndexInfo entity); public void saveSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg); public void updateSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg); public void deleteSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg); diff --git a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml index 0053f52a2..395b37267 100644 --- a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml @@ -34,6 +34,8 @@ + + @@ -77,6 +79,12 @@ r.action,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id,r.edit_time, r.auditor_id, r.audit_time,r.service_id,r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable, r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code + + + r.cfg_id,r.cfg_desc,r.cfg_keywords,r.cfg_type, + r.action,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id,r.edit_time, r.auditor_id, + r.audit_time,r.service_id,r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable, + r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code,r.user_region1,r.user_region2,r.user_region3,r.user_region4,r.user_region5 delete from ntc_subscribe_id_cfg @@ -731,6 +752,17 @@ + + delete from asn_keyword_cfg + + + and compile_id = #{compileId,jdbcType=INTEGER} + + + and function_id = #{functionId,jdbcType=INTEGER} + + + diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index f655fb657..cb4f04325 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -102,6 +102,7 @@ import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.dao.specific.ConfigGroupInfoDao; import com.nis.web.dao.specific.SpecificServiceCfgDao; import com.nis.web.security.UserUtils; +import com.nis.web.service.basics.AsnGroupInfoService; import com.nis.web.service.basics.SysDictInfoService; /** @@ -1780,7 +1781,7 @@ public abstract class BaseService { //需要通过新增域接口新增的ip集合 List toAddRegionAsnIpCfgs=Lists.newArrayList(); Map> toSendFirstAsnIpCfgs=Maps.newHashMap(); - + Map asnGroupAddRegions=Maps.newHashMap(); // AsnCacheUtils.init(true); try{ batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); @@ -1793,6 +1794,12 @@ public abstract class BaseService { } //AsnGroupInfo group=AsnCacheUtils.get(Long.parseLong(cfg.getUserRegion1())); if(group!=null&&group.getIsValid().intValue()==1) { + if(asnGroupAddRegions.containsKey(group.getAsnId())) { + int count=asnGroupAddRegions.get(group.getAsnId()); + asnGroupAddRegions.put(group.getAsnId(), count+1); + }else { + asnGroupAddRegions.put(group.getAsnId(), 1); + } toAddRegionAsnIpCfgs.add(cfg); }else if(group!=null) { if(toSendFirstAsnIpCfgs.containsKey(group.getAsnId())) { @@ -1809,12 +1816,17 @@ public abstract class BaseService { } if(send) { if(toAddRegionAsnIpCfgs.size()>0) { + for(Entry asnGroupAddRegion:asnGroupAddRegions.entrySet()) { + AsnGroupInfo group=new AsnGroupInfo(); + group.setAsnId(asnGroupAddRegion.getKey()); + group.setIssuedIPs(asnGroupAddRegion.getValue()+0l); + ((AsnGroupInfoDao) batchSqlSession.getMapper(AsnGroupInfoDao.class)).modifyIssuedIp(group);; + } asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES); } if(toSendFirstAsnIpCfgs.size()>0) { List configCompileList = new ArrayList(); ToMaatBean maatBean = new ToMaatBean(); - for(Entry> info:toSendFirstAsnIpCfgs.entrySet()) { AsnGroupInfo group=asnNoMaps.get(0).get(info.getKey()); if(group==null) { @@ -1855,6 +1867,7 @@ public abstract class BaseService { configCompileList.add(maatCfg); group.setIsValid(1); + group.setIssuedIPs(info.getValue().size()+0L); ((AsnGroupInfoDao) batchSqlSession.getMapper(AsnGroupInfoDao.class)).updateValid(group); } maatBean.setConfigCompileList(configCompileList); diff --git a/src/main/java/com/nis/web/service/basics/AsnGroupInfoService.java b/src/main/java/com/nis/web/service/basics/AsnGroupInfoService.java index 85f1f502a..a2de50675 100644 --- a/src/main/java/com/nis/web/service/basics/AsnGroupInfoService.java +++ b/src/main/java/com/nis/web/service/basics/AsnGroupInfoService.java @@ -1,5 +1,6 @@ package com.nis.web.service.basics; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -9,14 +10,21 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.basics.AsnGroupInfo; +import com.nis.domain.maat.MaatCfg; +import com.nis.domain.maat.ToMaatBean; +import com.nis.domain.maat.ToMaatResult; import com.nis.domain.specific.ConfigGroupInfo; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.StringUtil; import com.nis.web.dao.basics.AsnGroupInfoDao; import com.nis.web.dao.basics.AsnIpCfgDao; +import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.dao.specific.ConfigGroupInfoDao; import com.nis.web.security.UserUtils; import com.nis.web.service.BaseService; @@ -58,8 +66,10 @@ public class AsnGroupInfoService extends BaseService{ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdate(AsnGroupInfo entity) throws MaatConvertException{ //asn类型从综合服务获取groupId - String org=entity.getOrganization().trim(); - String country=entity.getCountry().trim(); + String org=entity.getOrganization().trim().toUpperCase(); + String country=entity.getCountry().trim().toUpperCase(); + entity.setOrganization(org); + entity.setCountry(country); int groupId=0; //获取组织 ConfigGroupInfo configGroupInfo=configGroupInfoDao.getAsnGroupByName(org); @@ -72,7 +82,7 @@ public class AsnGroupInfoService extends BaseService{ throw new MaatConvertException("Get asn group id failed"); } configGroupInfo=new ConfigGroupInfo(); - configGroupInfo.setGroupName(org); + configGroupInfo.setGroupName(org.toUpperCase()); configGroupInfo.setIsIssued(0); configGroupInfo.setGroupType(4); configGroupInfo.setGroupId(groupIds.get(1)); @@ -103,33 +113,79 @@ public class AsnGroupInfoService extends BaseService{ asnGroupInfoDao.insert(entity); //修改 }else{ + long id=entity.getId(); + AsnGroupInfo group=asnGroupInfoDao.getById(id); + int count=asnGroupInfoDao.getCountGroupInfoByName(group.getOrganization()); + if(count==1&&!group.getOrganization().equalsIgnoreCase(entity.getOrganization())) { + configGroupInfoDao.delAsnGroup(group.getOrganization()); + } + ConfigGroupInfo configGroupInfo1=configGroupInfoDao.getAsnGroupByName(entity.getOrganization()); + if(configGroupInfo1==null) { + List groupIds= ConfigServiceUtil.getId(2,2); + if(groupIds.size()>0) { + groupId=groupIds.get(0).intValue(); + }else { + throw new MaatConvertException("Get asn group id failed"); + } + configGroupInfo1=new ConfigGroupInfo(); + configGroupInfo1.setGroupName(entity.getOrganization().toUpperCase()); + configGroupInfo1.setIsIssued(0); + configGroupInfo1.setGroupType(4); + configGroupInfo1.setGroupId(groupIds.get(1)); + configGroupInfo1.setInsertTime(new Date()); + configGroupInfoDao.insertConfigGroupInfo(configGroupInfo1); + } Date editTime=new Date(); entity.setEditorId(UserUtils.getUser().getId()); entity.setEditTime(editTime); entity.setGroupId(groupId); asnGroupInfoDao.update(entity); + asnIpCfgDao.updateAsn(String.valueOf(entity.getAsnId()),entity.getOrganization(),entity.getCountry(),entity.getDetail()); } } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void delete(String ids,String asnIds){ if(!StringUtil.isEmpty(ids)){ + List dicts=DictUtils.getFunctionServiceDictList(600); + int result=0; + do { + result=asnIpCfgDao.deleteByAsnId(asnIds); + }while(result>0); for (String id : ids.split(",")) { if(!StringUtil.isEmpty(id)){ AsnGroupInfo entity=asnGroupInfoDao.getById(Integer.parseInt(id)); + int valid=entity.getIsValid(); entity.setIsValid(-1); entity.setId(Long.parseLong(id)); asnGroupInfoDao.updateValid(entity); if(asnGroupInfoDao.getCountGroupInfoByName(entity.getOrganization())==0) { configGroupInfoDao.delAsnGroup(entity.getOrganization()); } + //取消下发过的编译 + if(valid==1) { + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(dicts.get(0).getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("asn ip配置取消配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult _result = ConfigServiceUtil.put(json,1); + logger.info("asn ip配置取消配置响应信息:"+_result.getMsg()); + } } } - int result=0; - do { - result=asnIpCfgDao.deleteByAsnId(asnIds); - }while(result>0); } } @@ -143,6 +199,18 @@ public class AsnGroupInfoService extends BaseService{ } return false; } + public boolean checkIpAddrs(String groupIds) { + StringBuffer buffer=new StringBuffer(); + for(String groupId:groupIds.split(",")) { + Integer.parseInt(groupId); + buffer.append("'AS"+groupId+"',"); + } + List hasIpList=asnIpCfgDao.hasASNIpAddrs(buffer.substring(0, buffer.toString().length()-1)); + if(hasIpList!=null&&hasIpList.size()>0) { + return true; + } + return false; + } public AsnGroupInfo getInfoByAsnNo(AsnGroupInfo AsnGroupInfo){ return asnGroupInfoDao.getInfoByAsnNo(AsnGroupInfo); diff --git a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java index 117f5263d..6d6886e82 100644 --- a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java +++ b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java @@ -17,6 +17,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.beust.jcommander.internal.Lists; +import com.google.common.collect.Maps; import com.nis.domain.Page; import com.nis.domain.basics.AsnGroupInfo; import com.nis.domain.basics.AsnIpCfg; @@ -102,9 +103,13 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { Date editTime=new Date(); entity.setEditTime(editTime); entity.setEditorId(entity.getCurrentUser().getId()); - String org=entity.getOrganization().trim(); - String country=entity.getCountry().trim(); - String detail=entity.getDetail().trim(); + String userRegion1=entity.getUserRegion1(); + AsnGroupInfo groupInfo=new AsnGroupInfo(); + groupInfo.setAsnId(Long.parseLong(userRegion1)); + groupInfo=asnGroupInfoDao.getInfoByAsnNo(groupInfo); + String org=groupInfo.getOrganization().trim(); + String country=groupInfo.getCountry().trim(); + String detail=groupInfo.getDetail().trim(); entity.setOrganization(org); entity.setCountry(country); entity.setDetail(detail); @@ -230,9 +235,23 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void delAndSend(List entities) { StringBuilder sb=new StringBuilder(); + Map asnDelCounts=Maps.newHashMap(); for(AsnIpCfg ip:entities) { sb.append(ip.getCfgId()); sb.append(","); + if(asnDelCounts.containsKey(Long.parseLong(ip.getUserRegion1()))) { + int count=asnDelCounts.get(Long.parseLong(ip.getUserRegion1()))+1; + asnDelCounts.put(Long.parseLong(ip.getUserRegion1()), count); + }else { + asnDelCounts.put(Long.parseLong(ip.getUserRegion1()), 1); + } + } + //跟新asn组的审核通过IP数量 + for(Entry asnDelCount: asnDelCounts.entrySet()) { + AsnGroupInfo info=new AsnGroupInfo(); + info.setAsnId(asnDelCount.getKey()); + info.setIssuedIPs(0l-asnDelCount.getValue()); + asnGroupInfoDao.modifyIssuedIp(info); } sb.deleteCharAt(sb.toString().lastIndexOf(",")); asnIpCfgDao.delete(sb.toString()); @@ -242,12 +261,16 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveAsnIpCfg(CfgIndexInfo entity) { Date createTime=new Date(); + //asn号 + String userRegion1=entity.getUserRegion1(); + AsnGroupInfo asnGroupInfo=new AsnGroupInfo(); + asnGroupInfo.setAsnId(Long.parseLong(userRegion1)); + asnGroupInfo=asnGroupInfoDao.getInfoByAsnNo(asnGroupInfo); //组织去除首尾空格 - entity.setOrganization(entity.getOrganization().trim()); - entity.setCountry(entity.getCountry().trim()); - entity.setDetail(entity.getDetail().trim()); + entity.setOrganization(asnGroupInfo.getOrganization().trim()); + entity.setCountry(asnGroupInfo.getCountry().trim()); + entity.setDetail(asnGroupInfo.getDetail().trim()); ConfigGroupInfo configGroupInfo=configGroupInfoDao.getAsnGroupByName(entity.getOrganization()); - AsnGroupInfo asnGroupInfo=asnGroupInfoDao.getGroupIdByNameAndASNId(entity.getOrganization(), entity.getCountry(), Long.parseLong(entity.getUserRegion1())); Integer orgGroup=0; Integer compileId=0; Integer asnIdGroup=0; @@ -257,42 +280,12 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { configGroupInfo.setGroupType(4); configGroupInfo.setInsertTime(new Date()); configGroupInfo.setIsIssued(0); - if(asnGroupInfo==null) { - List groupIdList=ConfigServiceUtil.getId(2, 2); - orgGroup=groupIdList.get(0); - - asnIdGroup=groupIdList.get(1); - }else { - List groupIdList=ConfigServiceUtil.getId(2, 1); - orgGroup=groupIdList.get(0); - configGroupInfo.setGroupId(orgGroup); - asnIdGroup=asnGroupInfo.getGroupId(); - } + List groupIdList=ConfigServiceUtil.getId(2, 2); + orgGroup=groupIdList.get(0); configGroupInfo.setGroupId(orgGroup); configGroupInfoDao.insertConfigGroupInfo(configGroupInfo); - }else { - orgGroup=configGroupInfo.getGroupId(); - if(asnGroupInfo==null) { - List groupIdList=ConfigServiceUtil.getId(2, 1); - asnIdGroup=groupIdList.get(0); - }else { - asnIdGroup=asnGroupInfo.getGroupId(); - } - } - if(asnGroupInfo==null) { - asnGroupInfo=new AsnGroupInfo(); - asnGroupInfo.setOrganization(entity.getOrganization()); - asnGroupInfo.setCountry(entity.getCountry()); - asnGroupInfo.setDetail(entity.getDetail()); - asnGroupInfo.setIsValid(0); - asnGroupInfo.setCreateTime(new Date()); - asnGroupInfo.setCreatorId(entity.getCurrentUser().getId()); - asnGroupInfo.setAsnId(Long.parseLong(entity.getUserRegion1())); - asnGroupInfo.setGroupId(asnIdGroup); - List compileIds=ConfigServiceUtil.getId(1, 1); - asnGroupInfo.setCompileId(compileIds.get(0)); - asnGroupInfoDao.insert(asnGroupInfo); } + asnIdGroup=asnGroupInfo.getGroupId(); entity.setAsnIpGroup(asnIdGroup); entity.setCompileId(asnGroupInfo.getCompileId()); List idList=ConfigServiceUtil.getId(3, entity.getAsnIpCfgs().size()); @@ -384,6 +377,12 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void deleteByAsnNo(List asnNoList) { +// for(Long asnNo:asnNoList) { +// int result=0; +// do { +// result=asnIpCfgDao.deleteByAsnId(String.valueOf(asnNo)); +// }while(result>0); +// } int pointsDataLimit = 1000;//限制条数 Integer size = asnNoList.size(); if(pointsDataLimit, AsnIpCfg> { asnNoList.clear(); } } - public void ajaxDeleteAsnIp(String ids) { + /*public void ajaxDeleteAsnIp(String ids) { asnIpCfgDao.ajaxDeleteAsnIp(ids); - } + }*/ /** * * auditIpBatch(非IP类配置用,审核区域IP) @@ -448,6 +447,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { //data.entrySet().stream().forEach( enrty->{ Long asn=enrty.getKey();//ans group 的group id List asnIpCfgs=enrty.getValue(); + int issuedNum=asnIpCfgs.size(); for(int index = 0; index < asnIpCfgs.size();index++){ AsnIpCfg t = asnIpCfgs.get(index); BaseIpCfg ipCfg=new BaseIpCfg(); @@ -474,6 +474,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { asnGroupInfo.setIsValid(1); asnGroupInfo.setEditorId(UserUtils.getUser().getId()); asnGroupInfo.setEditTime(new Date()); + asnGroupInfo.setIssuedIPs(issuedNum+0L); asnGroupInfoDao.updateValid(asnGroupInfo); maatCfg.initDefaultValue(); ToMaatBean maatBean = new ToMaatBean(); @@ -513,11 +514,15 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); logger.info("ASN IP配置下发响应信息:" + result.getMsg()); }else if(asnGroupInfo.getIsValid()==1){//已经下发过,走分组复用 + asnGroupInfo.setIssuedIPs(issuedNum+0l); + asnGroupInfoDao.update(asnGroupInfo); asnIPRegionSendToMaat(asnIpCfgs,isValid); }else { throw new RuntimeException("asnGroupInfo isValid value is "+asnGroupInfo.getIsValid()); } }else if(isValid==Constants.VALID_NO) {//取消审核通过 + asnGroupInfo.setIssuedIPs(0L-issuedNum); + asnGroupInfoDao.update(asnGroupInfo); //已经下发过的,调用分组复用配置删除接口 // GroupReuseAddBean maatBean = new GroupReuseAddBean(); // List groupReuseList=new ArrayList<>(); @@ -546,6 +551,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { // asnGroupInfo.setEditTime(new Date()); // asnGroupInfoDao.updateValid(asnGroupInfo); //} + }else { throw new RuntimeException("isValid value is "+isValid); } @@ -557,4 +563,9 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { } } } + + public AsnIpCfg getOne(AsnIpCfg cfg) { + // TODO Auto-generated method stub + return asnIpCfgDao.getOne(cfg); + } } diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index c7c02edb0..cc5edd54d 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -18,7 +18,9 @@ import com.nis.domain.Page; import com.nis.domain.basics.AsnGroupInfo; import com.nis.domain.callback.InlineIp; import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.AsnKeywordCfg; import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; @@ -153,7 +155,38 @@ public class IpCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } - + //保存asn组织信息 字符串域信息 + if(StringUtils.isNotBlank(entity.getUserRegion4())){ + List functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId()); + FunctionRegionDict regionDict=null; + for(FunctionRegionDict dict:functionRegionDicts) { + if("asn".equals(dict.getConfigServiceType())) { + regionDict=dict; + } + } + if(regionDict!=null) { + String org=entity.getUserRegion4(); + List asnGroupInfos=asnGroupInfoDao.getValidConfigGroupInfoByName(org); + for(AsnGroupInfo info:asnGroupInfos) { + BaseStringCfg asnKeywordCfg=new AsnKeywordCfg(); + BeanUtils.copyProperties(entity, asnKeywordCfg,new String[]{"cfgId","cfgDesc","cfgRegionCode","cfgType","userRegion1","userRegion2","userRegion3"}); + asnKeywordCfg.setTableName(AsnKeywordCfg.getTablename()); + asnKeywordCfg.setCfgKeywords("AS"+info.getAsnId()); + asnKeywordCfg.setExprType(0); + asnKeywordCfg.setMatchMethod(3); + asnKeywordCfg.setExType("0"); + asnKeywordCfg.setIsHexbin(0); + asnKeywordCfg.setCfgRegionCode(regionDict.getConfigRegionCode()); + asnKeywordCfg.setCfgType(regionDict.getConfigRegionValue()); + asnKeywordCfg.setCreateTime(entity.getCreateTime()); + asnKeywordCfg.setCreatorId(UserUtils.getUser().getId()); + asnKeywordCfg.setFunctionId(regionDict.getFunctionId()); + asnKeywordCfg.setCompileId(compileId); + stringCfgDao.saveStringCfgBatch(asnKeywordCfg); + } + } + + } }else{ entity.setEditTime(new Date()); entity.setEditorId(entity.getCurrentUser().getId()); @@ -189,6 +222,42 @@ public class IpCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + //保存asn组织信息 字符串域信息 + if(StringUtils.isNotBlank(entity.getUserRegion4())){ + List functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId()); + FunctionRegionDict regionDict=null; + for(FunctionRegionDict dict:functionRegionDicts) { + if("asn".equals(dict.getConfigServiceType())) { + regionDict=dict; + } + } + if(regionDict!=null) { + //先删除asn keyword + String org=entity.getUserRegion4(); + stringCfgDao.deleteAsnKeyword(entity); + List asnGroupInfos=asnGroupInfoDao.getValidConfigGroupInfoByName(org); + for(AsnGroupInfo info:asnGroupInfos) { + BaseStringCfg asnKeywordCfg=new AsnKeywordCfg(); + BeanUtils.copyProperties(entity, asnKeywordCfg,new String[]{"cfgId","cfgDesc","cfgRegionCode","cfgType","userRegion1","userRegion2","userRegion3"}); + asnKeywordCfg.setTableName(AsnKeywordCfg.getTablename()); + asnKeywordCfg.setCfgKeywords("AS"+info.getAsnId()); + asnKeywordCfg.setExprType(0); + asnKeywordCfg.setMatchMethod(3); + asnKeywordCfg.setExType("0"); + asnKeywordCfg.setIsHexbin(0); + asnKeywordCfg.setCfgRegionCode(regionDict.getConfigRegionCode()); + asnKeywordCfg.setCfgType(regionDict.getConfigRegionValue()); + asnKeywordCfg.setCreateTime(entity.getCreateTime()); + asnKeywordCfg.setCreatorId(UserUtils.getUser().getId()); + asnKeywordCfg.setFunctionId(regionDict.getFunctionId()); + asnKeywordCfg.setEditorId(entity.getEditorId()); + asnKeywordCfg.setEditTime(entity.getEditTime()); + asnKeywordCfg.setCompileId(entity.getCompileId()); + stringCfgDao.saveStringCfgBatch(asnKeywordCfg); + } + } + + } } } public void updateIpCfgValid(Integer isValid,String ids,Integer functionId){ @@ -217,6 +286,13 @@ public class IpCfgService extends CrudService { cfg.setTableName(NtcSubscribeIdCfg.getTablename()); ipCfgDao.updateCfgValid(cfg); } + if(entity.getAsnKeywords()!=null && entity.getAsnKeywords().size()>0) + { + AsnKeywordCfg cfg = new AsnKeywordCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AsnKeywordCfg.getTablename()); + ipCfgDao.updateCfgValid(cfg); + } //保存区域IP信息 if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ AreaIpCfg cfg = new AreaIpCfg(); @@ -507,6 +583,26 @@ public class IpCfgService extends CrudService { strRegionList=map.get("dstList"); } } + if(entity.getAsnKeywords()!=null && entity.getAsnKeywords().size()>0){ + String regionValue=entity.getAsnKeywords().get(0).getCfgType(); + if(regionValue!=null) { + for(FunctionRegionDict region:dictList) { + if(regionValue.equals(region.getConfigRegionValue())) { + maatType=region.getIsMaat(); + break; + } + } + } + AsnKeywordCfg cfg = new AsnKeywordCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AsnKeywordCfg.getTablename()); + ipCfgDao.auditCfg(cfg); + if(isAudit==1&&maatType==Constants.MAAT_TYPE){ + Map map = cfgConvert(strRegionList,entity.getAsnKeywords(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } //保存区域IP信息 List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); if(!StringUtil.isEmpty(areaIpCfgList)){ @@ -638,56 +734,73 @@ public class IpCfgService extends CrudService { * @param ids cfgId * @param functionId */ - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void auditAsnCfg(CfgIndexInfo entity,Integer isAudit){ - entity.setTableName(CfgIndexInfo.getTablename()); - entity.setIsAudit(isAudit); - ipCfgDao.auditCfg(entity); - ToMaatBean maatBean = new ToMaatBean(); - - List configCompileList = new ArrayList<>(); - - if(isAudit==Constants.AUDIT_YES) { - AsnGroupInfo asnGroupInfo=new AsnGroupInfo(); - asnGroupInfo.setOrganization(entity.getUserRegion4()); - asnGroupInfo.setIsValid(1); - List groups=asnGroupInfoDao.findAsnGroupInfoList(asnGroupInfo); - if(groups!=null&&groups.size()>0) { -// if(configGroupInfo.getIsIssued()==1) {//复用,只下编译跟分组 -// for(AsnGroupInfo group:groups) { -// MaatCfg maatCfg = new MaatCfg(); -// List groupRelationList = new ArrayList<>(); -// List ipRegionList = new ArrayList<>(); -// List strRegionList = new ArrayList<>(); -// List numRegionList = new ArrayList<>(); -// List digestRegionList = new ArrayList<>(); -// List areaIpRegionList = new ArrayList<>(); -// maatCfg.initDefaultValue(); -// BeanUtils.copyProperties(entity, maatCfg); -// maatCfg.setAction(entity.getAction()); -// maatCfg.setAuditTime(entity.getAuditTime()); -// maatCfg.setIpRegionList(ipRegionList); -// maatCfg.setStrRegionList(strRegionList); -// maatCfg.setNumRegionList(numRegionList); -// maatCfg.setDigestRegionList(digestRegionList); -// maatCfg.setGroupRelationList(groupRelationList); -// maatCfg.setAreaIpRegionList(areaIpRegionList); -// maatCfg.setIsValid(entity.getIsValid()); -// //group -// GroupCfg groupCfg=new GroupCfg(); -// groupCfg.setCompileId(entity.getCompileId()); -// groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4())); -// groupCfg.setIsValid(Constants.VALID_YES); -// groupCfg.setAuditTime(entity.getAuditTime()); -// groupRelationList.add(groupCfg); -// maatCfg.setGroupNum(groupRelationList.size()); -// if(group.getAsnId()!=null) { -// maatCfg.setUserRegion("ASN_ID="+group.getAsnId()); + +// @Transactional(readOnly=false,rollbackFor=RuntimeException.class) +// @Deprecated +// public void auditAsnCfg(CfgIndexInfo entity,Integer isAudit){ +// entity.setTableName(CfgIndexInfo.getTablename()); +// entity.setIsAudit(isAudit); +// ipCfgDao.auditCfg(entity); +// ToMaatBean maatBean = new ToMaatBean(); +// +// List configCompileList = new ArrayList<>(); +// +// if(isAudit==Constants.AUDIT_YES) { +// List asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity); +// if(asnKeywordCfgs!=null&&asnKeywordCfgs.size()>0) { +// MaatCfg maatCfg = new MaatCfg(); +// List groupRelationList = new ArrayList<>(); +// List ipRegionList = new ArrayList<>(); +// List strRegionList = new ArrayList<>(); +// List numRegionList = new ArrayList<>(); +// List digestRegionList = new ArrayList<>(); +// List areaIpRegionList = new ArrayList<>(); +// maatCfg.initDefaultValue(); +// BeanUtils.copyProperties(entity, maatCfg); +// maatCfg.setAction(entity.getAction()); +// maatCfg.setAuditTime(entity.getAuditTime()); +// +// maatCfg.setNumRegionList(numRegionList); +// maatCfg.setDigestRegionList(digestRegionList); +// maatCfg.setGroupRelationList(groupRelationList); +// maatCfg.setAreaIpRegionList(areaIpRegionList); +// maatCfg.setIsValid(entity.getIsValid()); +// //group +// List groupIds=ConfigServiceUtil.getId(2, 1); +// GroupCfg groupCfg=new GroupCfg(); +// groupCfg.setCompileId(entity.getCompileId()); +// //groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4())); +// groupCfg.setGroupId(groupIds.get(0)); +// groupCfg.setIsValid(Constants.VALID_YES); +// groupCfg.setAuditTime(entity.getAuditTime()); +// groupRelationList.add(groupCfg); +// maatCfg.setGroupNum(groupRelationList.size()); +// maatCfg.setIpRegionList(ipRegionList); +// List regions=ConfigServiceUtil.getId(3, asnKeywordCfgs.size()); +// int index=0; +// List functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId()); +// String cfgType=null; +// for(FunctionRegionDict dict:functionRegionDicts) { +// if("asn".equals(dict.getConfigServiceType())) { +// cfgType=dict.getCfgType(); // } -// configCompileList.add(maatCfg); // } -// -// +// for(AsnKeywordCfg keyword:asnKeywordCfgs) { +// StringCfg cfg=new StringCfg(); +// BeanUtils.copyProperties(keyword, cfg); +// cfg.setRegionId(index); +// //需要根据文档 +// //cfg.setCfgType(StringUtils.isBlank(cfgType)?"NTC_ASN_NUMBER":cfgType); +// cfg.setGroupId(groupIds.get(0)); +// cfg.setAuditTime(entity.getAuditTime()); +// cfg.setIsValid(entity.getIsValid()); +// cfg.setRegionId(regions.get(index)); +// //cfg.setGroupId(Integer.parseInt(entity.getUserRegion4())); +// strRegionList.add(cfg); +// index++; +// } +// maatCfg.setStrRegionList(strRegionList); +// configCompileList.add(maatCfg); // maatBean.setConfigCompileList(configCompileList); // maatBean.setAuditTime(entity.getAuditTime()); // maatBean.setCreatorName(entity.getCurrentUser().getName()); @@ -696,104 +809,35 @@ public class IpCfgService extends CrudService { // // //调用服务接口下发配置数据 // String json=gsonToJson(maatBean); -// logger.info("ipaddr asn组复用配置下发配置参数:"+json); +// logger.info("ipaddr asn配置下发配置参数:"+json); // //调用服务接口下发配置 // ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); -// logger.info("ipaddr asn组复用配置下发响应信息:"+result.getMsg()); -// }else {//首次下发 - MaatCfg maatCfg = new MaatCfg(); - List groupRelationList = new ArrayList<>(); - List ipRegionList = new ArrayList<>(); - List strRegionList = new ArrayList<>(); - List numRegionList = new ArrayList<>(); - List digestRegionList = new ArrayList<>(); - List areaIpRegionList = new ArrayList<>(); - maatCfg.initDefaultValue(); - BeanUtils.copyProperties(entity, maatCfg); - maatCfg.setAction(entity.getAction()); - maatCfg.setAuditTime(entity.getAuditTime()); - - maatCfg.setNumRegionList(numRegionList); - maatCfg.setDigestRegionList(digestRegionList); - maatCfg.setGroupRelationList(groupRelationList); - maatCfg.setAreaIpRegionList(areaIpRegionList); - maatCfg.setIsValid(entity.getIsValid()); - //group - List groupIds=ConfigServiceUtil.getId(2, 1); - GroupCfg groupCfg=new GroupCfg(); - groupCfg.setCompileId(entity.getCompileId()); - //groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4())); - groupCfg.setGroupId(groupIds.get(0)); - groupCfg.setIsValid(Constants.VALID_YES); - groupCfg.setAuditTime(entity.getAuditTime()); - groupRelationList.add(groupCfg); - maatCfg.setGroupNum(groupRelationList.size()); - maatCfg.setIpRegionList(ipRegionList); - List regions=ConfigServiceUtil.getId(3, groups.size()); - int index=0; - List functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - String cfgType=null; - for(FunctionRegionDict dict:functionRegionDicts) { - if("asn".equals(dict.getConfigServiceType())) { - cfgType=dict.getCfgType(); - } - } - for(AsnGroupInfo group:groups) { - StringCfg cfg=new StringCfg(); - cfg.setRegionId(index); - cfg.setCfgKeywords("AS"+group.getAsnId()); - cfg.setExprType(0); - cfg.setIsHexbin(0); - cfg.setMatchMethod(3); - //需要根据文档 - cfg.setCfgType(StringUtils.isBlank(cfgType)?"NTC_ASN_NUMBER":cfgType); - cfg.setGroupId(groupIds.get(0)); - cfg.setAuditTime(entity.getAuditTime()); - cfg.setIsValid(entity.getIsValid()); - cfg.setRegionId(regions.get(index)); - //cfg.setGroupId(Integer.parseInt(entity.getUserRegion4())); - strRegionList.add(cfg); - index++; - } - maatCfg.setStrRegionList(strRegionList); - configCompileList.add(maatCfg); - maatBean.setConfigCompileList(configCompileList); - maatBean.setAuditTime(entity.getAuditTime()); - maatBean.setCreatorName(entity.getCurrentUser().getName()); - maatBean.setVersion(Constants.MAAT_VERSION); - maatBean.setOpAction(Constants.INSERT_ACTION); - - //调用服务接口下发配置数据 - String json=gsonToJson(maatBean); - logger.info("ipaddr asn配置下发配置参数:"+json); - //调用服务接口下发配置 - ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); - logger.info("ipaddr asn配置下发响应信息:"+result.getMsg()); -// } - } - - }else if(isAudit==Constants.AUDIT_NOT_YES) {//取消审核通过 - MaatCfg maatCfg = new MaatCfg(); - maatCfg.setCompileId(entity.getCompileId()); - maatCfg.setServiceId(entity.getServiceId()); - maatCfg.setIsValid(0);//无效 - configCompileList.add(maatCfg); - maatBean.setConfigCompileList(configCompileList); - maatBean.setAuditTime(entity.getAuditTime()); - maatBean.setCreatorName(entity.getCurrentUser().getName()); - maatBean.setVersion(Constants.MAAT_VERSION); - maatBean.setOpAction(Constants.UPDATE_ACTION); - //调用服务接口取消配置 - String json=gsonToJson(maatBean); - logger.info("ipaddr asn取消下发配置参数:"+json); - //调用服务接口下发配置 - ToMaatResult result = ConfigServiceUtil.put(json,1); - logger.info("ipaddr asn取消配置响应信息:"+result.getMsg()); - }else { - throw new RuntimeException("unknown isAudit value "+isAudit); - } - - } +// logger.info("ipaddr asn配置下发响应信息:"+result.getMsg()); +//// } +// } +// +// }else if(isAudit==Constants.AUDIT_NOT_YES) {//取消审核通过 +// MaatCfg maatCfg = new MaatCfg(); +// maatCfg.setCompileId(entity.getCompileId()); +// maatCfg.setServiceId(entity.getServiceId()); +// maatCfg.setIsValid(0);//无效 +// configCompileList.add(maatCfg); +// maatBean.setConfigCompileList(configCompileList); +// maatBean.setAuditTime(entity.getAuditTime()); +// maatBean.setCreatorName(entity.getCurrentUser().getName()); +// maatBean.setVersion(Constants.MAAT_VERSION); +// maatBean.setOpAction(Constants.UPDATE_ACTION); +// //调用服务接口取消配置 +// String json=gsonToJson(maatBean); +// logger.info("ipaddr asn取消下发配置参数:"+json); +// //调用服务接口下发配置 +// ToMaatResult result = ConfigServiceUtil.put(json,1); +// logger.info("ipaddr asn取消配置响应信息:"+result.getMsg()); +// }else { +// throw new RuntimeException("unknown isAudit value "+isAudit); +// } +// +// } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void deleteIp(String ids,String compileIds,int functionId){ if(StringUtils.isNotBlank(compileIds)){ @@ -862,8 +906,8 @@ public class IpCfgService extends CrudService { entity.setIpPortList(ipPortList); entity.setNtcSubscribeIdCfgList(subscribeIdList); if(StringUtils.isNotBlank(entity.getUserRegion4())) { - List infos=asnGroupInfoDao.getValidConfigGroupInfoByName((entity.getUserRegion4().trim())); - entity.setAsnGroups(infos); + List asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity); + entity.setAsnKeywords(asnKeywordCfgs); } return entity; } @@ -871,8 +915,8 @@ public class IpCfgService extends CrudService { List ipPortList = ipCfgDao.getIpPortList(entity); entity.setIpPortList(ipPortList); if(StringUtils.isNotBlank(entity.getUserRegion4())) { - List infos=asnGroupInfoDao.getValidConfigGroupInfoByName(entity.getUserRegion4().trim()); - entity.setAsnGroups(infos); + List asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity); + entity.setAsnKeywords(asnKeywordCfgs); } return entity; } diff --git a/src/main/java/com/nis/web/service/specific/ConfigGroupInfoService.java b/src/main/java/com/nis/web/service/specific/ConfigGroupInfoService.java index 575047151..d16459b97 100644 --- a/src/main/java/com/nis/web/service/specific/ConfigGroupInfoService.java +++ b/src/main/java/com/nis/web/service/specific/ConfigGroupInfoService.java @@ -27,13 +27,16 @@ public class ConfigGroupInfoService extends BaseService{ public ConfigGroupInfo getConfigGroupInfoByGroupId(Integer groupId) { return configGroupInfoDao.getConfigGroupInfoByGroupId(groupId); } - public ConfigGroupInfo getInfoByAsnNo(Long asnNo) { + /*public ConfigGroupInfo getInfoByAsnNo(Long asnNo) { return configGroupInfoDao.getInfoByAsnNo(asnNo); - } + }*/ public Integer getIssuedConfigGroupInfoByGroupIds(String groupIds) { return configGroupInfoDao.getIssuedConfigGroupInfoByGroupIds(groupIds); } public List findAllList(ConfigGroupInfo entity){ return configGroupInfoDao.findAllListByGroupInfo(entity); } + public ConfigGroupInfo getAsnOrganization(String groupName){ + return configGroupInfoDao.getAsnGroupByName(groupName); + } } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 13af75260..37b537df6 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1213,7 +1213,7 @@ single_keyword_tip=Only single key input is allowed. ipv4_mask_range_tip=IP mask must between 16 and 32 ipv6_mask_range_tip=IP Mask must between 2 and 128 letter_cancel_info=Cancel Letter Info -import_tip_excel=Please choose a valid Excel file with which it's subfix is .xlsx to import. +import_tip_excel=Excel 2007 or later versions are supported http_keyword=Website Keyword http_keyword_monit=Website Keyword Monitor http_keyword_reject=Website Keyword Block @@ -1451,4 +1451,9 @@ asn_group=ASN Group can_not_edit_issued_ans_group=Can not edit valid ASN group can_not_delete_asn_group_with_audited_ip=Can not delete ASN group with approved IP organization=Organization -mismatch=Mismatch \ No newline at end of file +mismatch=Mismatch +can_not_delete_asn_group_with_audited_ip_address=Can not delete ASN group with approved packet IP address +country_code=Country Code +asn_name=ASN Name +details=Details +NTC_ASN_NUMBER=ASN \ 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 ca50a1542..30e81dbd6 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1213,7 +1213,7 @@ single_keyword_tip=\u0414\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\ ipv4_mask_range_tip=\u041c\u0430\u0441\u043a\u0430 IP \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0435\u0436\u0434\u0443 16 \u0438 32 ipv6_mask_range_tip=IP-\u043c\u0430\u0441\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043c\u0435\u0436\u0434\u0443 2 \u0438 128 letter_cancel_info=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u0438\u0441\u044c\u043c\u0430 -import_tip_excel=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Excel, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 .xlsx. +import_tip_excel=Excel 2007 or later versions are supported http_keyword=\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430 http_keyword_monit=\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430 http_keyword_reject=\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0432\u0435\u0431-c\u0430\u0439\u0442\u0430 @@ -1455,4 +1455,9 @@ asn_group=ASN Group can_not_edit_issued_ans_group=Can not edit valid ASN group can_not_delete_asn_group_with_audited_ip=Can not delete ASN group with approved IP organization=Organization -mismatch=Mismatch \ No newline at end of file +mismatch=Mismatch +can_not_delete_asn_group_with_audited_ip_address=Can not delete ASN group with approved packet IP address +country_code=Country Code +asn_name=ASN Name +details=Details +NTC_ASN_NUMBER=ASN \ 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 047278f7c..911efb1c9 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1208,7 +1208,7 @@ single_keyword_tip=Only single key input is allowed. ipv4_mask_range_tip=IP\u63a9\u7801\u5fc5\u987b\u4ecb\u4e8e16\u548c32\u4e4b\u95f4 ipv6_mask_range_tip=IP\u63a9\u7801\u5fc5\u987b\u4ecb\u4e8e2\u548c128\u4e4b\u95f4 letter_cancel_info=\u53d6\u6d88\u5ba1\u6838\u6765\u51fd -import_tip_excel=\u8bf7\u9009\u62e9\u6587\u4ef6\u7ed3\u5c3e\u4e3a.xlsx\u7684\u6709\u6548Excel\u6587\u4ef6\u5bfc\u5165 +import_tip_excel=\u4ec5\u652f\u6301Excel 2007\u4ee5\u53ca\u4e4b\u540e\u7248\u672c http_keyword=\u7f51\u9875\u5173\u952e\u5b57 http_keyword_monit=\u7f51\u9875\u5173\u952e\u5b57\u76d1\u6d4b http_keyword_reject=\u7f51\u9875\u5173\u952e\u5b57\u963b\u65ad @@ -1451,4 +1451,9 @@ asn_group=ASN\u7ec4 can_not_edit_issued_ans_group=\u4e0d\u80fd\u4fee\u6539\u6709\u6548\u7684ASN\u7ec4 can_not_delete_asn_group_with_audited_ip=\u4e0d\u80fd\u5220\u9664\u5305\u542b\u5ba1\u6838\u901a\u8fc7ip\u7684ASN\u7ec4 organization=\u7ec4\u7ec7 -mismatch=\u4e0d\u5339\u914d \ No newline at end of file +mismatch=\u4e0d\u5339\u914d +can_not_delete_asn_group_with_audited_ip_address=\u4e0d\u80fd\u5220\u9664\u5305\u542b\u5728\u5df2\u5ba1\u6838ip\u5730\u5740\u914d\u7f6e\u4e2d\u7684asn\u7ec4 +country_code=\u56fd\u5bb6\u4ee3\u7801 +asn_name=ASN\u7ec4\u7ec7\u540d +details=\u8BE6\u60C5 +NTC_ASN_NUMBER=ASN \ No newline at end of file diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 1656e7b0e..f8a4257d1 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -521,7 +521,7 @@ app_id_region=APP_ID #application spec service code scope app_spec_service_code_max_val=310000 app_spec_service_code_min_val=300001 -groupReuseSources=groupReuseSources +groupReuseSources=v1/groupReuseSources log_time_range=300000 log_time_start=2018-08-01 00:00:00 log_time_end=2018-10-01 00:00:00 @@ -550,7 +550,7 @@ mulity_thread_size=5 ntcRadiusReport=v2/ntcRadiusReport ntcCollectVoipLog=v1/ntcCollectVoipLogs ntcKeywordsUrlLog=v1/ntcKeywordsUrlLogs -save_and_del_thread_size=5 +save_and_del_thread_size=20 #mysql \u5355\u4e2asql\u5927\u5c0f\u9650\u5236,\u6839\u636emariadb\u76f8\u5173\u53c2\u6570\u914d\u7f6e max_allowed_packet=1048576 #http client\u8fde\u63a5\u6c60\u76f8\u5173\u53c2\u6570\uff0chttp_max_connection:\u6700\u5927\u8fde\u63a5\u6570\uff0cdefault_max_perroute:\u6bcf\u4e2a\u4e3b\u673a\u5730\u5740\u7684\u5e76\u53d1\u6570\uff0cpoolcm_socket_timeout:socket\u8d85\u65f6\u65f6\u95f4 diff --git a/src/main/resources/sql/20190106/asn_group_info.sql b/src/main/resources/sql/20190106/asn_group_info.sql new file mode 100644 index 000000000..688cd3ab9 --- /dev/null +++ b/src/main/resources/sql/20190106/asn_group_info.sql @@ -0,0 +1,42 @@ +#修改 org_group_id为issued_ips +/* + Navicat Premium Data Transfer + + Source Server : 204 + Source Server Type : MySQL + Source Server Version : 100214 + Source Host : 192.168.10.204:3306 + Source Schema : gwall_dev + + Target Server Type : MySQL + Target Server Version : 100214 + File Encoding : 65001 + + Date: 06/01/2019 10:11:01 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for asn_group_info +-- ---------------------------- +DROP TABLE IF EXISTS `asn_group_info`; +CREATE TABLE `asn_group_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `group_id` int(11) NOT NULL, + `organization` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `country` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `detail` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `create_time` datetime(0) NOT NULL, + `creator_id` int(11) NOT NULL, + `edit_time` datetime(0) NULL DEFAULT NULL, + `editor_id` int(11) NULL DEFAULT NULL, + `is_valid` int(2) NOT NULL COMMENT '-1删除 1有效0无效', + `asn_id` bigint(20) NOT NULL COMMENT 'asn号', + `issued_ips` int(11) NOT NULL DEFAULT 0, + `compile_id` int(11) NOT NULL COMMENT 'asn 号的编译ID', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 507295 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/main/resources/sql/20190106/asn_keyword_cfg.sql b/src/main/resources/sql/20190106/asn_keyword_cfg.sql new file mode 100644 index 000000000..75dff14b8 --- /dev/null +++ b/src/main/resources/sql/20190106/asn_keyword_cfg.sql @@ -0,0 +1,59 @@ +/* + Navicat Premium Data Transfer + + Source Server : 204 + Source Server Type : MySQL + Source Server Version : 100214 + Source Host : 192.168.10.204:3306 + Source Schema : gwall_dev + + Target Server Type : MySQL + Target Server Version : 100214 + File Encoding : 65001 + + Date: 06/01/2019 10:10:12 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for asn_keyword_cfg +-- ---------------------------- +DROP TABLE IF EXISTS `asn_keyword_cfg`; +CREATE TABLE `asn_keyword_cfg` ( + `cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `cfg_desc` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `cfg_keywords` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '对应maat规范的字符串表keywords字段', + `action` int(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单', + `is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0', + `is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过', + `creator_id` int(11) NOT NULL COMMENT '取自sys_user.id', + `create_time` datetime(0) NOT NULL, + `editor_id` int(11) NULL DEFAULT NULL COMMENT '取自sys_user.id', + `edit_time` datetime(0) NULL DEFAULT NULL, + `auditor_id` int(11) NULL DEFAULT NULL COMMENT '取自sys_user.id', + `audit_time` datetime(0) NULL DEFAULT NULL, + `service_id` int(11) NOT NULL COMMENT '参考系统业务类型管理表', + `request_id` int(11) NOT NULL COMMENT '取自request_info.id', + `compile_id` int(11) NOT NULL COMMENT '取自服务接口返回的maat配置的编译id,配置初始入库时获取。', + `is_area_effective` int(11) NOT NULL COMMENT '0否,1是', + `classify` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔', + `attribute` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔', + `lable` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签id,多个用英文逗号分隔', + `expr_type` int(11) NOT NULL COMMENT '0:无表达式,1:与表达式', + `match_method` int(11) NOT NULL COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配', + `is_hexbin` int(11) NOT NULL COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX', + `area_effective_ids` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '多个英文逗号分隔', + `function_id` int(11) NULL DEFAULT NULL, + `cfg_region_code` int(11) NULL DEFAULT NULL, + `cfg_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `user_region1` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域1', + `user_region2` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域2', + `user_region3` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域3', + `user_region4` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域4', + `user_region5` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域5', + PRIMARY KEY (`cfg_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/main/webapp/WEB-INF/views/basics/asnGroupList.jsp b/src/main/webapp/WEB-INF/views/basics/asnGroupList.jsp index d8cde8837..8a99ebe5c 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnGroupList.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnGroupList.jsp @@ -10,6 +10,10 @@ $("#intype").val("${cfg.organization}"); }else if(''!="${cfg.asnId}"){ $("#intype").val("${cfg.asnId}"); + }else if(''!="${cfg.country}"){ + $("#intype").val("${cfg.country}"); + }else if(''!="${cfg.detail}"){ + $("#intype").val("${cfg.detail}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -60,6 +64,20 @@ } } }); + if(canDel){ + tip='' + $.ajax({ + type:'post', + url:'${ctx}/basics/asnGroup/ajaxGetAuditedIPAddress', + data:{"asnIds":asnIds.join(',')}, + async:false, + success:function(data,textStatus){//处理返回结果 + if(data){ + canDel=false; + } + } + }); + } } if(canDel){ var added = ""; @@ -131,6 +149,8 @@ + +
@@ -213,7 +233,7 @@ - + diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp index e91057eba..bf30fa83b 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp @@ -17,9 +17,9 @@ $(function(){ $(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error); }, submitHandler: function(form){ - $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country")); + /* $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country")); $("[name='detail']").val($("[name='userRegion1'] option:selected").attr("detail")); - $("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); + $("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); */ loading('onloading...'); form.submit(); }, @@ -30,7 +30,7 @@ $(function(){ var asnId=$(this).find("option[value='"+$(this).val()+"']").attr("asnId"); $("#asnId").val(asnId); }); */ - var organization=$("[name='organization']").val(); + /* var organization=$("[name='organization']").val(); if(organization){ $.ajax({ type:'post', @@ -69,7 +69,7 @@ $(function(){ } } }); - }); + }); */ }); //业务窗口打开 var addContent = function(obj, contentClassName) { @@ -199,7 +199,7 @@ var reSort=function(obj,index){
--%> -
+ <%--
@@ -208,24 +208,25 @@ var reSort=function(obj,index){ - <%-- --%> +
-
-
-
+ --%> +
- - <%-- --%> + <%-- --%> +
+
+ <%--
-
+
--%>

diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp index 968b5013f..a24b75c02 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp @@ -14,9 +14,9 @@ $(function(){ $(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error); }, submitHandler: function(form){ - $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country")); + /* $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country")); $("[name='detail']").val($("[name='userRegion1'] option:selected").attr("detail")); - $("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); + $("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); */ loading('onloading...'); form.submit(); }, @@ -27,7 +27,7 @@ $(function(){ var asnId=$(this).find("option[value='"+$(this).val()+"']").attr("asnId"); $("#asnId").val(asnId); }); */ - var organization=$("[name='organization']").val(); + /* var organization=$("[name='organization']").val(); if(organization){ $.ajax({ type:'post', @@ -70,7 +70,7 @@ $(function(){ } } }); - }); + }); */ }); @@ -131,19 +131,30 @@ $(function(){
-
- -
- - <%-- --%> -
-
-
-
+
+ +
+ + +
+
+
+ + <%--
+
+ +
+ + +
+
+
+ +
--%> -
-
-
- -
- - <%-- --%> -
-
-
-
+ <%--
+
-
+
--%> <%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp index 7472e627f..267c88485 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp @@ -17,13 +17,14 @@
<%-- --%>
- +
- - + --%> +
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp index 3deeeb8bc..c4eaab89a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp @@ -705,7 +705,7 @@ var showHideIPSECProtocol=function(obj){ - ${_cfg.cfgType} +
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp index 534fcdc91..b6d41324f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp @@ -218,25 +218,15 @@ - - + +
-
-
-
-
-
-
- -
@@ -246,17 +236,7 @@
-
-
-
-
-
-
- -
diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index 153653db1..b4c892e78 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -959,6 +959,41 @@ jQuery.validator.addMethod("asnNoUnique",function(value, element) { }); return result; }); +jQuery.validator.addMethod("asnMustExists",function(value, element) { + var ctx=$(element).attr("ctx"); + //var id= $("[name='id']").val(); + var url = ctx+"/basics/asnGroup/checkAsnNo"; + var result = true; + $.ajax({ + type:'post', + async:false, + url: url, + data:{"asnId":value}, + success:function(data){ + if(data==true){ + result=false; + }else{ + result=true; + } + } + }); + return result; +}); +jQuery.validator.addMethod("orgMustExists",function(value, element) { + var ctx=$(element).attr("ctx"); + var url = ctx+"/basics/asnGroup/orgMustExists"; + var result = true; + $.ajax({ + type:'post', + async:false, + url: url, + data:{"organization":value}, + success:function(data){ + result = data; + } + }); + return result; +}); jQuery.validator.addMethod("areaUnique",function(value,element) { var flag = true; diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js index f7036346b..8df1f6668 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js @@ -78,6 +78,8 @@ netAddress:"The class C type of IP addresses must has the same network number bit field", addrPoolUnique:"Address Pool already exists.", asnNoUnique:"ASN already exists.", + asnMustExists:"ASN Must exists in ASN Group.", + orgMustExists:"ASN organization Must exists in ASN Group and have an approved ASN IP", areaUnique:"Area already exists.", config_sync_tip:"The system is being maintained and temporarily inaccessible.", ipMaskSole:"IP already exists.", diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js index ede3a49fb..ce196c9f8 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js @@ -78,6 +78,8 @@ netAddress:"Тип IP-адресов класса C должен иметь один и тот же номер сети бит поля.", addrPoolUnique:"Address Pool уже существует.", asnNoUnique:"ASN уже существует.", + asnMustExists:"ASN Must exists in ASN Group.", + orgMustExists:"ASN organization Must exists in ASN Group and have an approved ASN IP", areaUnique:"Регион уже существует.", config_sync_tip:"Система находится под техническим обслуживанием и временно недоступна.", ipMaskSole:"IP уже существует.", diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js index cad79f6bc..714a7ff30 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js @@ -78,6 +78,8 @@ netAddress:"C类IP地址网络位必须相同", addrPoolUnique:"地址池已存在", asnNoUnique:"ASN号已存在", + asnMustExists:"ASN号必须存在于ASN组中", + orgMustExists:"ASN组织 必须存在于ASN组中并且包含已审核ASN IP", areaUnique:"该区域已存在", config_sync_tip:"系统正在维护中,暂时不可访问!", ipMaskSole:"IP已存在", From c16c585a43483770b6d55fbbb29af786a4b18507 Mon Sep 17 00:00:00 2001 From: wangxin Date: Sun, 6 Jan 2019 11:49:48 +0800 Subject: [PATCH 6/7] =?UTF-8?q?asn=20ip=E4=BF=AE=E6=94=B9=E6=97=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9compileId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml | 3 +++ src/main/java/com/nis/web/service/basics/AsnIpCfgService.java | 1 + src/main/webapp/WEB-INF/views/basics/asnGroupForm.jsp | 1 + 3 files changed, 5 insertions(+) diff --git a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml index a3e363abc..49825a600 100644 --- a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml @@ -515,6 +515,9 @@ user_region1 = #{userRegion1,jdbcType=VARCHAR}, + + compile_id = #{compileId,jdbcType=INTEGER}, + diff --git a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java index 6d6886e82..527c7b563 100644 --- a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java +++ b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java @@ -113,6 +113,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { entity.setOrganization(org); entity.setCountry(country); entity.setDetail(detail); + entity.setCompileId(groupInfo.getCompileId()); asnIpCfgDao.update(entity); } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) diff --git a/src/main/webapp/WEB-INF/views/basics/asnGroupForm.jsp b/src/main/webapp/WEB-INF/views/basics/asnGroupForm.jsp index 248eca5d7..add96f316 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnGroupForm.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnGroupForm.jsp @@ -64,6 +64,7 @@ $(function(){ +
From b7f0f67bbd0cd2ea00abf2198170b72f27731b75 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Sun, 6 Jan 2019 13:06:19 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=B1=95=E7=A4=BA=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/WEB-INF/views/log/ntc/ipList.jsp | 56 ++++++++--------- .../WEB-INF/views/log/ntc/openVpnList.jsp | 61 +++++++++---------- 2 files changed, 58 insertions(+), 59 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp index 798d55cb1..9917e63b2 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp @@ -152,31 +152,6 @@
-
-
-
- - - - - - - -
-
- -
-
- - - - - - - -
-
-
@@ -196,12 +171,18 @@
+
- - + + + + + + +
-
+
@@ -209,6 +190,25 @@
+ +
+
+ + +
+
+ +
+
+ + + + + + + +
+
diff --git a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp index f9b7e4edb..cfd2f1559 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp @@ -128,6 +128,23 @@ $(document).ready(function(){
+
+
+ + + + + + + +
+
+
+
+ + +
+
@@ -140,7 +157,18 @@ $(document).ready(function(){
- +
+
+ + +
+
+
+
+ + +
+
@@ -150,36 +178,7 @@ $(document).ready(function(){ -
-
-
-
- - - - - - - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
+