From c7b86b08c6e5bdfca6b40e0315d6a6ef272c4cee Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 20 Dec 2018 21:09:48 +0800 Subject: [PATCH 001/147] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=A2=9E=E5=8A=A0=E8=A1=A8=E6=A0=BC=E5=AF=BC?= =?UTF-8?q?=E5=87=BAexcel=20,csv=20=EF=BC=8C=E8=A1=A8=E6=A0=BC=E5=90=8E?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0total=E7=BB=9F=E8=AE=A1=E5=88=97,=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=89=93=E5=8D=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrafficStatisticsInfoController.java | 24 ++-- .../views/dashboard/trafficAppTypeList.jsp | 30 ++++- .../views/dashboard/trafficDomainTrans.jsp | 3 +- .../dashboard/trafficHttpStatisticList.jsp | 34 +++++- .../views/dashboard/trafficIpActiveList.jsp | 111 ++++++++++-------- .../dashboard/trafficProtocolTypeList.jsp | 38 ++++-- .../views/dashboard/trafficWebTypeList.jsp | 109 ++++++++--------- .../plugins/highcharts/js/exporting-data.js | 27 +++++ .../global/plugins/highcharts/js/exporting.js | 60 ++++++---- .../plugins/highcharts/js/exporting.js.old | 26 ++++ .../plugins/tableExport-3.3.13/tableexport.js | 7 +- .../webapp/static/pages/scripts/echart.js | 13 +- 12 files changed, 316 insertions(+), 166 deletions(-) create mode 100644 src/main/webapp/static/global/plugins/highcharts/js/exporting-data.js create mode 100644 src/main/webapp/static/global/plugins/highcharts/js/exporting.js.old diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java index e8e002ddd..fd7f31cde 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -67,10 +67,6 @@ public class TrafficStatisticsInfoController extends BaseController { HashMap m = new HashMap(); List list = new ArrayList(); try { - String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.NTC_TOTAL_REPORT); - Gson gson = new GsonBuilder().create(); - fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); - list = (ArrayList) fromJsonList.get("data"); Random r = new Random(); Double rejectNum=0d; Double dropConnNum=0d; @@ -81,7 +77,11 @@ public class TrafficStatisticsInfoController extends BaseController { Double inoctetsNum=0d; Double outoctetsNum=0d; Double bandwidth=0d; - if(list!=null&&list.size()>0){ + String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.NTC_TOTAL_REPORT); + Gson gson = new GsonBuilder().create(); + fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); + list = (ArrayList) fromJsonList.get("data"); + if(fromJsonList!=null&&list!=null&&list.size()>0){ Map map = (Map) list.get(0); rejectNum = (Double) map.get("rejectNum") ; monitorNum = (Double) map.get("monitorNum"); @@ -265,8 +265,6 @@ public class TrafficStatisticsInfoController extends BaseController { Map fromJsonList = new HashMap(); Map map = new HashMap(); //String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_TWO; - //String url="http://192.168.11.78:8080/galaxy/service/log/v1/"+Constants.TRAFFIC_BANDWIDTH_TRANS_THREE; - //String url="http://192.168.11.78:8080/galaxy/service/log/v1/"+Constants.TRAFFIC_BANDWIDTH_TRANS_FOUR; String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_THREE; //String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_FOUR; try { @@ -502,9 +500,9 @@ public class TrafficStatisticsInfoController extends BaseController { logger.debug("website接口数据"+fromJsonList); list = (ArrayList) fromJsonList.get("data"); BigDecimal divisor=new BigDecimal(1024*1024*1024); - DecimalFormat df = new DecimalFormat("0.00"); + DecimalFormat df = new DecimalFormat("0.000000000"); DecimalFormat dl = new DecimalFormat("0"); - DecimalFormat pf = new DecimalFormat("0.00%"); + DecimalFormat pf = new DecimalFormat("0.000000000"); // Double totalLink=0d; Double totalGbyte=0d; Double totalPackets=0d; @@ -528,10 +526,10 @@ public class TrafficStatisticsInfoController extends BaseController { Map m=(Map)object; // Double perLink = ((Double)m.get("linkNum"))/totalLink; // m.put("perLink",pf.format(perLink)); - Double perPackets = ((Double)m.get("pktCount"))/totalPackets; - m.put("perPackets", pf.format(perPackets)); - Double perGbyte = ((Double)m.get("byteCount"))/totalGbyte; - m.put("perGbyte", pf.format(perGbyte)); +// Double perPackets = ((Double)m.get("pktCount"))/totalPackets; + m.put("totalPackets", pf.format(totalPackets)); +// Double perGbyte = ((Double)m.get("byteCount"))/totalGbyte; + m.put("totalGbyte", pf.format(totalGbyte/1024/1024/1024)); if(map.containsKey(Long.parseLong(dl.format(m.get("webId"))))){ m.put("website", map.get(Long.parseLong(dl.format(m.get("webId"))))); }else{ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 551936bd1..43b715095 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -80,8 +80,14 @@
-
- +
+ +


@@ -176,13 +182,14 @@ function ajaxAppList(start,end){ }); } // 导出列表 -$("#export-btn").click(function(){ +$(".export-btn").click(function(){ + var dataType = $(this).attr("data-type"); getPageData(1,999999);// 设置导出页条数 var te = $("#contentTable").tableExport({ headings:true, footers:true, - formats:["xlsx"], - fileName:"App", + formats:[dataType], + fileName:"service", bootstrap:false }); $("#myexport").click(); @@ -224,6 +231,8 @@ function htmlData(fileDataS){ }else{ $('.none-data').hide(); $('.M-box').show(); + var start=$("#beginDate").val(); + var end=$("#endDate").val(); $.each(fileDataS,function (index,data){ if(data!=null){ var totalLink = data.totalLink; @@ -250,6 +259,17 @@ function htmlData(fileDataS){ html+= ""+Math.round(data.GByte*100)/100+""; html+= ""+gbytper+"%"+""; html+="" + if(index==fileDataS.length-1){ + html+="" + html+= ""+""+""; + html+= ""+totalLink+""; + html+= "" +"100%"+""; + html+= ""+Math.round(totalPackets*100)/100+""; + html+= ""+"100%"+""; + html+= ""+Math.round(totalGByte*100)/100+""; + html+= ""+start+"--"+ end +""; + html+="" + } } $("#tableData").append(html); }); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index a5efa5c86..2a22f9bc1 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -3,7 +3,7 @@ - <spring:message code="traffic_ip_active"></spring:message> + <spring:message code="domain_name"></spring:message> @@ -37,6 +37,7 @@ <%-- --%> + + + <%-- --%> +
- +
+ + +
@@ -235,7 +197,6 @@ }, 500000);// 五分钟调用一次 }); function searchList() { - loading(); var start = $("#beginDate").val(); var end = $("#endDate").val(); if (start == '' || end == '' || end == null || start == null) { @@ -291,14 +252,15 @@ }); } // 导出列表 - $("#export-btn").click(function() { - getPageData(1, 999999);// 设置导出页条数 + $(".export-btn").click(function(){ + var dataType = $(this).attr("data-type"); + getPageData(1,999999);// 设置导出页条数 var te = $("#contentTable").tableExport({ - headings : true, - footers : true, - formats : [ "xlsx" ], - fileName : "Domain", - bootstrap : false + headings:true, + footers:true, + formats:[dataType], + fileName:"Domain", + bootstrap:false }); $("#myexport").click(); $("caption").remove(); @@ -341,18 +303,45 @@ } else { $('.none-data').hide(); $('.M-box').show(); + var start=$("#beginDate").val(); + var end=$("#endDate").val(); + var totalunique=0; + var totalpkt=0; + var totalGbyte=0; $.each(fileDataS, function(index, data) { if (data != null) { - + var packper=0; + var gbytper=0; + totalunique=totalunique+(data.uniqueNum); + var totalPackets= data.totalPackets; + var totalGbyte= data.totalGbyte; + if(totalPackets!=null&&totalPackets!=0 ){ + packper=((data.pktCount/totalPackets)*100).toFixed(2); + } + if(totalGbyte!=null&&totalGbyte!=0 ){ + gbytper=((data.Gbyte/(totalGbyte))*100).toFixed(2); + } var html = ''; html += "" + data.website + ""; html += "" + data.uniqueNum + ""; html += "" + (((data.entranceId)==1) ? "Astana":"Alamty") + ""; - html += "" + data.pktCount + ""; - html += "" + data.perPackets + ""; - html += "" + data.Gbyte + ""; - html += "" + data.perGbyte + ""; + html += "" + Math.round(data.pktCount*100)/100 + ""; + html += "" + packper + " %"; + html += "" + Math.round(data.Gbyte*100)/100 + ""; + html += "" + gbytper + " %"; html += "" + if(index==fileDataS.length-1){ + html+="" + html+= ""+""+""; + html+= ""+totalunique+""; + html+= "" +"--"+""; + html+= ""+totalPackets+""; + html+= ""+"100%"+""; + html+= ""+totalGbyte+""; + html+= ""+"100%"+""; + html+= ""+start+"--"+ end +""; + html+="" + } } $("#tableData").append(html); }); diff --git a/src/main/webapp/static/global/plugins/highcharts/js/exporting-data.js b/src/main/webapp/static/global/plugins/highcharts/js/exporting-data.js new file mode 100644 index 000000000..02e0889fc --- /dev/null +++ b/src/main/webapp/static/global/plugins/highcharts/js/exporting-data.js @@ -0,0 +1,27 @@ +/* + Highcharts JS v7.0.0 (2018-12-11) + Exporting module + + (c) 2010-2018 Torstein Honsi + + License: www.highcharts.com/license +*/ +(function(m){"object"===typeof module&&module.exports?module.exports=m:"function"===typeof define&&define.amd?define(function(){return m}):m("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(m){(function(a){a.ajax=function(f){var b=a.merge(!0,{url:!1,type:"GET",dataType:"json",success:!1,error:!1,data:!1,headers:{}},f);f={json:"application/json",xml:"application/xml",text:"text/plain",octet:"application/octet-stream"};var c=new XMLHttpRequest;if(!b.url)return!1;c.open(b.type.toUpperCase(), +b.url,!0);c.setRequestHeader("Content-Type",f[b.dataType]||f.text);a.objectEach(b.headers,function(a,f){c.setRequestHeader(f,a)});c.onreadystatechange=function(){var a;if(4===c.readyState){if(200===c.status){a=c.responseText;if("json"===b.dataType)try{a=JSON.parse(a)}catch(v){b.error&&b.error(c,v);return}return b.success&&b.success(a)}b.error&&b.error(c,c.responseText)}};try{b.data=JSON.stringify(b.data)}catch(k){}c.send(b.data||!0)}})(m);(function(a){var f=a.win,b=f.navigator,c=f.document,k=f.URL|| +f.webkitURL||f,v=/Edge\/\d+/.test(b.userAgent);a.dataURLtoBlob=function(a){if((a=a.match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/))&&3/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#x27;").replace(/\//g,"\x26#x2F;"):"Chart")+"\x3c/caption\x3e");for(var p=0,q=a.length;pe&&(e=a[p].length);b+=function(a,b,e){var h="\x3cthead\x3e",c=0;e=e||b&&b.length;var k,d,l=0;if(d=f&&a&&b){a:if(d=a.length,b.length===d){for(;d--;)if(a[d]!==b[d]){d=!1;break a}d=!0}else d=!1;d=!d}if(d){for(h+="\x3ctr\x3e";c< +e;++c)d=a[c],k=a[c+1],d===k?++l:l?(h+=m("th","highcharts-table-topheading",'scope\x3d"col" colspan\x3d"'+(l+1)+'"',d),l=0):(d===b[c]?g.exporting.useRowspanHeaders?(k=2,delete b[c]):(k=1,b[c]=""):k=1,h+=m("th","highcharts-table-topheading",'scope\x3d"col"'+(1(.*?$)/);e&&e[1]&&(e='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+b.chart.width+'" height\x3d"'+b.chart.height+'"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+e[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",a=a.replace("\x3c/svg\x3e",e+"\x3c/svg\x3e"))}a=a.replace(/zIndex="[^"]+"/g, -"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(\S+)("|")\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/.*?$/,"\x3c/svg\x3e").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1\x3d"rgb($2)" $1-opacity\x3d"$3"').replace(/ /g, -"\u00a0").replace(/­/g,"\u00ad");this.ieSanitizeSVG&&(a=this.ieSanitizeSVG(a));return a},getChartHTML:function(){return this.container.innerHTML},getSVG:function(a){var b,e,c,v,m,g=p(this.options,a);e=q("div",null,{position:"absolute",top:"-9999em",width:this.chartWidth+"px",height:this.chartHeight+"px"},z.body);c=this.renderTo.style.width;m=this.renderTo.style.height;c=g.exporting.sourceWidth||g.chart.width||/px$/.test(c)&&parseInt(c,10)||600;m=g.exporting.sourceHeight||g.chart.height||/px$/.test(m)&& -parseInt(m,10)||400;t(g.chart,{animation:!1,renderTo:e,forExport:!0,renderer:"SVGRenderer",width:c,height:m});g.exporting.enabled=!1;delete g.data;g.series=[];k(this.series,function(a){v=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});v.isInternal||g.series.push(v)});k(this.axes,function(a){a.userOptions.internalKey||(a.userOptions.internalKey=f.uniqueKey())});b=new f.Chart(g,this.callback);a&&k(["xAxis","yAxis","series"],function(c){var d={};a[c]&&(d[c]=a[c], -b.update(d))});k(this.axes,function(a){var c=f.find(b.axes,function(b){return b.options.internalKey===a.userOptions.internalKey}),d=a.getExtremes(),e=d.userMin,d=d.userMax;!c||void 0===e&&void 0===d||c.setExtremes(e,d,!0,!1)});c=b.getChartHTML();c=this.sanitizeSVG(c,g);g=null;b.destroy();B(e);return c},getSVGForExport:function(a,b){var e=this.options.exporting;return this.getSVG(p({chart:{borderRadius:0}},e.chartOptions,b,{exporting:{sourceWidth:a&&a.sourceWidth||e.sourceWidth,sourceHeight:a&&a.sourceHeight|| -e.sourceHeight}}))},exportChart:function(a,b){b=this.getSVGForExport(a,b);a=p(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale,svg:b},a.formAttributes)},print:function(){var a=this,b=a.container,e=[],c=b.parentNode,f=z.body,m=f.childNodes,g=a.options.exporting.printMaxWidth,d,n;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null,0);D(a,"beforePrint");if(n=g&&a.chartWidth>g)d=[a.options.chart.width,void 0,!1],a.setSize(g,void 0,!1); -k(m,function(a,b){1===a.nodeType&&(e[b]=a.style.display,a.style.display="none")});f.appendChild(b);C.focus();C.print();setTimeout(function(){c.appendChild(b);k(m,function(a,b){1===a.nodeType&&(a.style.display=e[b])});a.isPrinting=!1;n&&a.setSize.apply(a,d);D(a,"afterPrint")},1E3)}},contextMenu:function(a,b,e,c,v,m,g){var d=this,n=d.options.navigation,h=d.chartWidth,G=d.chartHeight,p="cache-"+a,l=d[p],x=Math.max(v,m),y,r;l||(d[p]=l=q("div",{className:a},{position:"absolute",zIndex:1E3,padding:x+"px"}, -d.container),y=q("div",{className:"highcharts-menu"},null,l),u(y,t({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},n.menuStyle)),r=function(){u(l,{display:"none"});g&&g.setState(0);d.openMenu=!1},d.exportEvents.push(w(l,"mouseleave",function(){l.hideTimer=setTimeout(r,500)}),w(l,"mouseenter",function(){f.clearTimeout(l.hideTimer)}),w(z,"mouseup",function(b){d.pointer.inClass(b.target,a)||r()})),k(b,function(a){"string"===typeof a&&(a=d.options.exporting.menuItemDefinitions[a]); -if(f.isObject(a,!0)){var b;a.separator?b=q("hr",null,null,y):(b=q("div",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();r();a.onclick&&a.onclick.apply(d,arguments)},innerHTML:a.text||d.options.lang[a.textKey]},null,y),b.onmouseover=function(){u(this,n.menuItemHoverStyle)},b.onmouseout=function(){u(this,n.menuItemStyle)},u(b,t({cursor:"pointer"},n.menuItemStyle)));d.exportDivElements.push(b)}}),d.exportDivElements.push(y,l),d.exportMenuWidth=l.offsetWidth,d.exportMenuHeight= -l.offsetHeight);b={display:"block"};e+d.exportMenuWidth>h?b.right=h-e-v-x+"px":b.left=e-x+"px";c+m+d.exportMenuHeight>G&&"top"!==g.alignOptions.verticalAlign?b.bottom=G-c-x+"px":b.top=c+m-x+"px";u(l,b);d.openMenu=!0},addButton:function(a){var b=this,e=b.renderer,c=p(b.options.navigation.buttonOptions,a),f=c.onclick,m=c.menuItems,g,d,n=c.symbolSize||12;b.btnCount||(b.btnCount=0);b.exportDivElements||(b.exportDivElements=[],b.exportSVGElements=[]);if(!1!==c.enabled){var h=c.theme,k=h.states,q=k&&k.hover, -k=k&&k.select,l;delete h.states;f?l=function(a){a.stopPropagation();f.call(b,a)}:m&&(l=function(){b.contextMenu(d.menuClassName,m,d.translateX,d.translateY,d.width,d.height,d);d.setState(2)});c.text&&c.symbol?h.paddingLeft=r(h.paddingLeft,25):c.text||t(h,{width:c.width,height:c.height,padding:0});d=e.button(c.text,0,0,l,h,q,k).addClass(a.className).attr({"stroke-linecap":"round",title:r(b.options.lang[c._titleKey],""),zIndex:3});d.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;c.symbol&& -(g=e.symbol(c.symbol,c.symbolX-n/2,c.symbolY-n/2,n,n,{width:n,height:n}).addClass("highcharts-button-symbol").attr({zIndex:1}).add(d),g.attr({stroke:c.symbolStroke,fill:c.symbolFill,"stroke-width":c.symbolStrokeWidth||1}));d.add().align(t(c,{width:d.width,x:r(c.x,b.buttonOffset)}),!0,"spacingBox");b.buttonOffset+=(d.width+c.buttonSpacing)*("right"===c.align?-1:1);b.exportSVGElements.push(d,g)}},destroyExport:function(a){var b=a?a.target:this;a=b.exportSVGElements;var e=b.exportDivElements,c=b.exportEvents, -h;a&&(k(a,function(a,c){a&&(a.onclick=a.ontouchstart=null,h="cache-"+a.menuClassName,b[h]&&delete b[h],b.exportSVGElements[c]=a.destroy())}),a.length=0);e&&(k(e,function(a,c){f.clearTimeout(a.hideTimer);H(a,"mouseleave");b.exportDivElements[c]=a.onmouseout=a.onmouseover=a.ontouchstart=a.onclick=null;B(a)}),e.length=0);c&&(k(c,function(a){a()}),c.length=0)}});J.menu=function(a,b,e,c){return["M",a,b+2.5,"L",a+e,b+2.5,"M",a,b+c/2+.5,"L",a+e,b+c/2+.5,"M",a,b+c-1.5,"L",a+e,b+c-1.5]};A.prototype.renderExporting= -function(){var a=this,b=a.options.exporting,e=b.buttons,c=a.isDirtyExporting||!a.exportSVGElements;a.buttonOffset=0;a.isDirtyExporting&&a.destroyExport();c&&!1!==b.enabled&&(a.exportEvents=[],E(e,function(b){a.addButton(b)}),a.isDirtyExporting=!1);w(a,"destroy",a.destroyExport)};A.prototype.callbacks.push(function(a){a.renderExporting();w(a,"redraw",a.renderExporting);k(["exporting","navigation"],function(b){a[b]={update:function(e,c){a.isDirtyExporting=!0;p(!0,a.options[b],e);r(c,!0)&&a.redraw()}}})})})(h)}); +/* + Highcharts JS v7.0.0 (2018-12-11) + Exporting module + + (c) 2010-2018 Torstein Honsi + + License: www.highcharts.com/license +*/ +(function(l){"object"===typeof module&&module.exports?module.exports=l:"function"===typeof define&&define.amd?define(function(){return l}):l("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(l){(function(g){var y=g.defaultOptions,z=g.doc,l=g.Chart,q=g.addEvent,I=g.removeEvent,C=g.fireEvent,t=g.createElement,D=g.discardElement,r=g.css,p=g.merge,u=g.pick,E=g.objectEach,x=g.extend,J=g.isTouchDevice,A=g.win,G=A.navigator.userAgent,F=g.SVGRenderer,H=g.Renderer.prototype.symbols,K=/Edge\/|Trident\/|MSIE /.test(G), +L=/firefox/i.test(G);x(y.lang,{printChart:"Print chart"/*,downloadPNG:"Download PNG image"*/,downloadJPEG:"Download image"/*,downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image"*/,contextButtonTitle:"Chart context menu"});y.navigation||(y.navigation={});p(!0,y.navigation,{buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}});p(!0,y.navigation,{menuStyle:{border:"1px solid #999999",background:"#ffffff", +padding:"5px 0"},menuItemStyle:{padding:"0.5em 1em",color:"#333333",background:"none",fontSize:J?"14px":"11px",transition:"background 250ms, color 250ms"},menuItemHoverStyle:{background:"#335cad",color:"#ffffff"},buttonOptions:{symbolFill:"#666666",symbolStroke:"#666666",symbolStrokeWidth:3,theme:{padding:5}}});y.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-contextbutton",menuClassName:"highcharts-contextmenu", +symbol:"menu",titleKey:"contextButtonTitle",menuItems:"printChart downloadJPEG".split(" ")}},menuItemDefinitions:{printChart:{textKey:"printChart",onclick:function(){this.print()}}/*,separator:{separator:!0},downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChart()}}*/,downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},/*downloadPDF:{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},*/ +/*downloadSVG:{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}*/}};g.post=function(b,a,d){var c=t("form",p({method:"post",action:b,enctype:"multipart/form-data"},d),{display:"none"},z.body);E(a,function(a,b){t("input",{type:"hidden",name:b,value:a},null,c)});c.submit();D(c)};x(l.prototype,{sanitizeSVG:function(b,a){if(a&&a.exporting&&a.exporting.allowHTML){var d=b.match(/<\/svg>(.*?$)/);d&&d[1]&&(d='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+a.chart.width+'" height\x3d"'+ +a.chart.height+'"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+d[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",b=b.replace("\x3c/svg\x3e",d+"\x3c/svg\x3e"))}b=b.replace(/zIndex="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(\S+)("|")\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/.*?$/, +"\x3c/svg\x3e").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1\x3d"rgb($2)" $1-opacity\x3d"$3"').replace(/ /g,"\u00a0").replace(/­/g,"\u00ad");this.ieSanitizeSVG&&(b=this.ieSanitizeSVG(b));return b},getChartHTML:function(){this.styledMode&&this.inlineStyles();return this.container.innerHTML},getSVG:function(b){var a,d,c,w,m,h=p(this.options,b);d=t("div",null,{position:"absolute",top:"-9999em",width:this.chartWidth+"px",height:this.chartHeight+"px"},z.body);c= +this.renderTo.style.width;m=this.renderTo.style.height;c=h.exporting.sourceWidth||h.chart.width||/px$/.test(c)&&parseInt(c,10)||(h.isGantt?800:600);m=h.exporting.sourceHeight||h.chart.height||/px$/.test(m)&&parseInt(m,10)||400;x(h.chart,{animation:!1,renderTo:d,forExport:!0,renderer:"SVGRenderer",width:c,height:m});h.exporting.enabled=!1;delete h.data;h.series=[];this.series.forEach(function(a){w=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});w.isInternal|| +h.series.push(w)});this.axes.forEach(function(a){a.userOptions.internalKey||(a.userOptions.internalKey=g.uniqueKey())});a=new g.Chart(h,this.callback);b&&["xAxis","yAxis","series"].forEach(function(c){var d={};b[c]&&(d[c]=b[c],a.update(d))});this.axes.forEach(function(b){var c=g.find(a.axes,function(a){return a.options.internalKey===b.userOptions.internalKey}),d=b.getExtremes(),e=d.userMin,d=d.userMax;c&&(void 0!==e&&e!==c.min||void 0!==d&&d!==c.max)&&c.setExtremes(e,d,!0,!1)});c=a.getChartHTML(); +C(this,"getSVG",{chartCopy:a});c=this.sanitizeSVG(c,h);h=null;a.destroy();D(d);return c},getSVGForExport:function(b,a){var d=this.options.exporting;return this.getSVG(p({chart:{borderRadius:0}},d.chartOptions,a,{exporting:{sourceWidth:b&&b.sourceWidth||d.sourceWidth,sourceHeight:b&&b.sourceHeight||d.sourceHeight}}))},getFilename:function(){var b=this.userOptions.title&&this.userOptions.title.text,a=this.options.exporting.filename;if(a)return a;"string"===typeof b&&(a=b.toLowerCase().replace(/<\/?[^>]+(>|$)/g, +"").replace(/[\s_]+/g,"-").replace(/[^a-z0-9\-]/g,"").replace(/^[\-]+/g,"").replace(/[\-]+/g,"-").substr(0,24).replace(/[\-]+$/g,""));if(!a||5>a.length)a="chart";return a},exportChart:function(b,a){a=this.getSVGForExport(b,a);b=p(this.options.exporting,b);g.post(b.url,{filename:b.filename||this.getFilename(),type:b.type,width:b.width||0,scale:b.scale,svg:a},b.formAttributes)},print:function(){function b(b){(a.fixedDiv?[a.fixedDiv,a.scrollingContainer]:[a.container]).forEach(function(a){b.appendChild(a)})} +var a=this,d=[],c=z.body,g=c.childNodes,m=a.options.exporting.printMaxWidth,h,e;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null,0);C(a,"beforePrint");if(e=m&&a.chartWidth>m)h=[a.options.chart.width,void 0,!1],a.setSize(m,void 0,!1);g.forEach(function(a,b){1===a.nodeType&&(d[b]=a.style.display,a.style.display="none")});b(c);setTimeout(function(){A.focus();A.print();setTimeout(function(){b(a.renderTo);g.forEach(function(a,b){1===a.nodeType&&(a.style.display=d[b])});a.isPrinting=!1;e&&a.setSize.apply(a, +h);C(a,"afterPrint")},1E3)},1)}},contextMenu:function(b,a,d,c,w,m,h){var e=this,n=e.options.navigation,k=e.chartWidth,v=e.chartHeight,l="cache-"+b,f=e[l],B=Math.max(w,m),p;f||(e.exportContextMenu=e[l]=f=t("div",{className:b},{position:"absolute",zIndex:1E3,padding:B+"px",pointerEvents:"auto"},e.fixedDiv||e.container),p=t("div",{className:"highcharts-menu"},null,f),e.styledMode||r(p,x({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},n.menuStyle)), +f.hideMenu=function(){r(f,{display:"none"});h&&h.setState(0);e.openMenu=!1;g.clearTimeout(f.hideTimer)},e.exportEvents.push(q(f,"mouseleave",function(){f.hideTimer=setTimeout(f.hideMenu,500)}),q(f,"mouseenter",function(){g.clearTimeout(f.hideTimer)}),q(z,"mouseup",function(a){e.pointer.inClass(a.target,b)||f.hideMenu()}),q(f,"click",function(){e.openMenu&&f.hideMenu()})),a.forEach(function(a){"string"===typeof a&&(a=e.options.exporting.menuItemDefinitions[a]);if(g.isObject(a,!0)){var b;a.separator? +b=t("hr",null,null,p):(b=t("div",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();f.hideMenu();a.onclick&&a.onclick.apply(e,arguments)},innerHTML:a.text||e.options.lang[a.textKey]},null,p),e.styledMode||(b.onmouseover=function(){r(this,n.menuItemHoverStyle)},b.onmouseout=function(){r(this,n.menuItemStyle)},r(b,x({cursor:"pointer"},n.menuItemStyle))));e.exportDivElements.push(b)}}),e.exportDivElements.push(p,f),e.exportMenuWidth=f.offsetWidth,e.exportMenuHeight=f.offsetHeight); +a={display:"block"};d+e.exportMenuWidth>k?a.right=k-d-w-B+"px":a.left=d-B+"px";c+m+e.exportMenuHeight>v&&"top"!==h.alignOptions.verticalAlign?a.bottom=v-c-B+"px":a.top=c+m-B+"px";r(f,a);e.openMenu=!0},addButton:function(b){var a=this,d=a.renderer,c=p(a.options.navigation.buttonOptions,b),g=c.onclick,m=c.menuItems,h,e,n=c.symbolSize||12;a.btnCount||(a.btnCount=0);a.exportDivElements||(a.exportDivElements=[],a.exportSVGElements=[]);if(!1!==c.enabled){var k=c.theme,v=k.states,l=v&&v.hover,v=v&&v.select, +f;a.styledMode||(k.fill=u(k.fill,"#ffffff"),k.stroke=u(k.stroke,"none"));delete k.states;g?f=function(b){b&&b.stopPropagation();g.call(a,b)}:m&&(f=function(b){b&&b.stopPropagation();a.contextMenu(e.menuClassName,m,e.translateX,e.translateY,e.width,e.height,e);e.setState(2)});c.text&&c.symbol?k.paddingLeft=u(k.paddingLeft,25):c.text||x(k,{width:c.width,height:c.height,padding:0});a.styledMode||(k["stroke-linecap"]="round",k.fill=u(k.fill,"#ffffff"),k.stroke=u(k.stroke,"none"));e=d.button(c.text,0, +0,f,k,l,v).addClass(b.className).attr({title:u(a.options.lang[c._titleKey||c.titleKey],"")});e.menuClassName=b.menuClassName||"highcharts-menu-"+a.btnCount++;c.symbol&&(h=d.symbol(c.symbol,c.symbolX-n/2,c.symbolY-n/2,n,n,{width:n,height:n}).addClass("highcharts-button-symbol").attr({zIndex:1}).add(e),a.styledMode||h.attr({stroke:c.symbolStroke,fill:c.symbolFill,"stroke-width":c.symbolStrokeWidth||1}));e.add(a.exportingGroup).align(x(c,{width:e.width,x:u(c.x,a.buttonOffset)}),!0,"spacingBox");a.buttonOffset+= +(e.width+c.buttonSpacing)*("right"===c.align?-1:1);a.exportSVGElements.push(e,h)}},destroyExport:function(b){var a=b?b.target:this;b=a.exportSVGElements;var d=a.exportDivElements,c=a.exportEvents,l;b&&(b.forEach(function(b,c){b&&(b.onclick=b.ontouchstart=null,l="cache-"+b.menuClassName,a[l]&&delete a[l],a.exportSVGElements[c]=b.destroy())}),b.length=0);a.exportingGroup&&(a.exportingGroup.destroy(),delete a.exportingGroup);d&&(d.forEach(function(b,c){g.clearTimeout(b.hideTimer);I(b,"mouseleave");a.exportDivElements[c]= +b.onmouseout=b.onmouseover=b.ontouchstart=b.onclick=null;D(b)}),d.length=0);c&&(c.forEach(function(a){a()}),c.length=0)}});F.prototype.inlineToAttributes="fill stroke strokeLinecap strokeLinejoin strokeWidth textAnchor x y".split(" ");F.prototype.inlineBlacklist=[/-/,/^(clipPath|cssText|d|height|width)$/,/^font$/,/[lL]ogical(Width|Height)$/,/perspective/,/TapHighlightColor/,/^transition/,/^length$/];F.prototype.unstyledElements=["clipPath","defs","desc"];l.prototype.inlineStyles=function(){function b(a){return a.replace(/([A-Z])/g, +function(a,b){return"-"+b.toLowerCase()})}function a(d){function m(a,f){q=t=!1;if(l){for(r=l.length;r--&&!t;)t=l[r].test(f);q=!t}"transform"===f&&"none"===a&&(q=!0);for(r=g.length;r--&&!q;)q=g[r].test(f)||"function"===typeof a;q||v[f]===a&&"svg"!==d.nodeName||e[d.nodeName][f]===a||(-1!==c.indexOf(f)?d.setAttribute(b(f),a):u+=b(f)+":"+a+";")}var f,v,u="",w,q,t,r;if(1===d.nodeType&&-1===h.indexOf(d.nodeName)){f=A.getComputedStyle(d,null);v="svg"===d.nodeName?{}:A.getComputedStyle(d.parentNode,null); +e[d.nodeName]||(n=k.getElementsByTagName("svg")[0],w=k.createElementNS(d.namespaceURI,d.nodeName),n.appendChild(w),e[d.nodeName]=p(A.getComputedStyle(w,null)),"text"===d.nodeName&&delete e.text.fill,n.removeChild(w));if(L||K)for(var x in f)m(f[x],x);else E(f,m);u&&(f=d.getAttribute("style"),d.setAttribute("style",(f?f+";":"")+u));"svg"===d.nodeName&&d.setAttribute("stroke-width","1px");"text"!==d.nodeName&&[].forEach.call(d.children||d.childNodes,a)}}var d=this.renderer,c=d.inlineToAttributes,g=d.inlineBlacklist, +l=d.inlineWhitelist,h=d.unstyledElements,e={},n,k,d=z.createElement("iframe");r(d,{width:"1px",height:"1px",visibility:"hidden"});z.body.appendChild(d);k=d.contentWindow.document;k.open();k.write('\x3csvg xmlns\x3d"http://www.w3.org/2000/svg"\x3e\x3c/svg\x3e');k.close();a(this.container.querySelector("svg"));n.parentNode.removeChild(n)};H.menu=function(b,a,d,c){return["M",b,a+2.5,"L",b+d,a+2.5,"M",b,a+c/2+.5,"L",b+d,a+c/2+.5,"M",b,a+c-1.5,"L",b+d,a+c-1.5]};H.menuball=function(b,a,d,c){b=[];c=c/3- +2;return b=b.concat(this.circle(d-c,a,c,c),this.circle(d-c,a+c+4,c,c),this.circle(d-c,a+2*(c+4),c,c))};l.prototype.renderExporting=function(){var b=this,a=b.options.exporting,d=a.buttons,c=b.isDirtyExporting||!b.exportSVGElements;b.buttonOffset=0;b.isDirtyExporting&&b.destroyExport();c&&!1!==a.enabled&&(b.exportEvents=[],b.exportingGroup=b.exportingGroup||b.renderer.g("exporting-group").attr({zIndex:3}).add(),E(d,function(a){b.addButton(a)}),b.isDirtyExporting=!1);q(b,"destroy",b.destroyExport)}; +q(l,"init",function(){var b=this;["exporting","navigation"].forEach(function(a){b[a]={update:function(d,c){b.isDirtyExporting=!0;p(!0,b.options[a],d);u(c,!0)&&b.redraw()}}})});l.prototype.callbacks.push(function(b){b.renderExporting();q(b,"redraw",b.renderExporting)})})(l)}); +//# sourceMappingURL=exporting.js.map \ No newline at end of file diff --git a/src/main/webapp/static/global/plugins/highcharts/js/exporting.js.old b/src/main/webapp/static/global/plugins/highcharts/js/exporting.js.old new file mode 100644 index 000000000..1cef1138e --- /dev/null +++ b/src/main/webapp/static/global/plugins/highcharts/js/exporting.js.old @@ -0,0 +1,26 @@ +/* + Highcharts JS v6.1.0 (2018-04-13) + Exporting module + + (c) 2010-2017 Torstein Honsi + + License: www.highcharts.com/license +*/ +(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(f){var h=f.defaultOptions,z=f.doc,A=f.Chart,w=f.addEvent,H=f.removeEvent,D=f.fireEvent,q=f.createElement,B=f.discardElement,u=f.css,p=f.merge,r=f.pick,k=f.each,E=f.objectEach,t=f.extend,I=f.isTouchDevice,C=f.win,F=C.navigator.userAgent,J=f.Renderer.prototype.symbols;/Edge\/|Trident\/|MSIE /.test(F);/firefox/i.test(F);t(h.lang,{/*printChart:"Print chart",*//*downloadPNG:"Download PNG image",*/downloadJPEG:"Download JPEG image", +/*downloadPDF:"Download PDF document",*//*downloadSVG:"Download SVG vector image",*/contextButtonTitle:"download"});h.navigation={buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}};p(!0,h.navigation,{menuStyle:{border:"1px solid #999999",background:"#ffffff",padding:"5px 0"},menuItemStyle:{padding:"0.5em 1em",background:"none",color:"#333333",fontSize:I?"14px":"11px",transition:"background 250ms, color 250ms"},menuItemHoverStyle:{background:"#335cad", +color:"#ffffff"},buttonOptions:{symbolFill:"#666666",symbolStroke:"#666666",symbolStrokeWidth:3,theme:{fill:"#ffffff",stroke:"none",padding:5}}});h.exporting={type:"image/jpeg",url:"${pageContext.request.contextPath}/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-contextbutton",menuClassName:"highcharts-contextmenu",symbol:"menu",_titleKey:"contextButtonTitle",menuItems:"downloadJPEG".split(" ")}},menuItemDefinitions:{/*printChart:{textKey:"printChart", +onclick:function(){this.print()}},*//*separator:{separator:!0},*//*downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChart()}},*/downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},/*downloadPDF:{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},*//*downloadSVG:{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}*/}};f.post=function(a,b,e){var c=q("form",p({method:"post",action:a,enctype:"multipart/form-data"}, +e),{display:"none"},z.body);E(b,function(a,b){q("input",{type:"hidden",name:b,value:a},null,c)});c.submit();B(c)};t(A.prototype,{sanitizeSVG:function(a,b){if(b&&b.exporting&&b.exporting.allowHTML){var e=a.match(/<\/svg>(.*?$)/);e&&e[1]&&(e='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+b.chart.width+'" height\x3d"'+b.chart.height+'"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+e[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",a=a.replace("\x3c/svg\x3e",e+"\x3c/svg\x3e"))}a=a.replace(/zIndex="[^"]+"/g, +"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(\S+)("|")\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/.*?$/,"\x3c/svg\x3e").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1\x3d"rgb($2)" $1-opacity\x3d"$3"').replace(/ /g, +"\u00a0").replace(/­/g,"\u00ad");this.ieSanitizeSVG&&(a=this.ieSanitizeSVG(a));return a},getChartHTML:function(){return this.container.innerHTML},getSVG:function(a){var b,e,c,v,m,g=p(this.options,a);e=q("div",null,{position:"absolute",top:"-9999em",width:this.chartWidth+"px",height:this.chartHeight+"px"},z.body);c=this.renderTo.style.width;m=this.renderTo.style.height;c=g.exporting.sourceWidth||g.chart.width||/px$/.test(c)&&parseInt(c,10)||600;m=g.exporting.sourceHeight||g.chart.height||/px$/.test(m)&& +parseInt(m,10)||400;t(g.chart,{animation:!1,renderTo:e,forExport:!0,renderer:"SVGRenderer",width:c,height:m});g.exporting.enabled=!1;delete g.data;g.series=[];k(this.series,function(a){v=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});v.isInternal||g.series.push(v)});k(this.axes,function(a){a.userOptions.internalKey||(a.userOptions.internalKey=f.uniqueKey())});b=new f.Chart(g,this.callback);a&&k(["xAxis","yAxis","series"],function(c){var d={};a[c]&&(d[c]=a[c], +b.update(d))});k(this.axes,function(a){var c=f.find(b.axes,function(b){return b.options.internalKey===a.userOptions.internalKey}),d=a.getExtremes(),e=d.userMin,d=d.userMax;!c||void 0===e&&void 0===d||c.setExtremes(e,d,!0,!1)});c=b.getChartHTML();c=this.sanitizeSVG(c,g);g=null;b.destroy();B(e);return c},getSVGForExport:function(a,b){var e=this.options.exporting;return this.getSVG(p({chart:{borderRadius:0}},e.chartOptions,b,{exporting:{sourceWidth:a&&a.sourceWidth||e.sourceWidth,sourceHeight:a&&a.sourceHeight|| +e.sourceHeight}}))},exportChart:function(a,b){b=this.getSVGForExport(a,b);a=p(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale,svg:b},a.formAttributes)},print:function(){var a=this,b=a.container,e=[],c=b.parentNode,f=z.body,m=f.childNodes,g=a.options.exporting.printMaxWidth,d,n;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null,0);D(a,"beforePrint");if(n=g&&a.chartWidth>g)d=[a.options.chart.width,void 0,!1],a.setSize(g,void 0,!1); +k(m,function(a,b){1===a.nodeType&&(e[b]=a.style.display,a.style.display="none")});f.appendChild(b);C.focus();C.print();setTimeout(function(){c.appendChild(b);k(m,function(a,b){1===a.nodeType&&(a.style.display=e[b])});a.isPrinting=!1;n&&a.setSize.apply(a,d);D(a,"afterPrint")},1E3)}},contextMenu:function(a,b,e,c,v,m,g){var d=this,n=d.options.navigation,h=d.chartWidth,G=d.chartHeight,p="cache-"+a,l=d[p],x=Math.max(v,m),y,r;l||(d[p]=l=q("div",{className:a},{position:"absolute",zIndex:1E3,padding:x+"px"}, +d.container),y=q("div",{className:"highcharts-menu"},null,l),u(y,t({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},n.menuStyle)),r=function(){u(l,{display:"none"});g&&g.setState(0);d.openMenu=!1},d.exportEvents.push(w(l,"mouseleave",function(){l.hideTimer=setTimeout(r,500)}),w(l,"mouseenter",function(){f.clearTimeout(l.hideTimer)}),w(z,"mouseup",function(b){d.pointer.inClass(b.target,a)||r()})),k(b,function(a){"string"===typeof a&&(a=d.options.exporting.menuItemDefinitions[a]); +if(f.isObject(a,!0)){var b;a.separator?b=q("hr",null,null,y):(b=q("div",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();r();a.onclick&&a.onclick.apply(d,arguments)},innerHTML:a.text||d.options.lang[a.textKey]},null,y),b.onmouseover=function(){u(this,n.menuItemHoverStyle)},b.onmouseout=function(){u(this,n.menuItemStyle)},u(b,t({cursor:"pointer"},n.menuItemStyle)));d.exportDivElements.push(b)}}),d.exportDivElements.push(y,l),d.exportMenuWidth=l.offsetWidth,d.exportMenuHeight= +l.offsetHeight);b={display:"block"};e+d.exportMenuWidth>h?b.right=h-e-v-x+"px":b.left=e-x+"px";c+m+d.exportMenuHeight>G&&"top"!==g.alignOptions.verticalAlign?b.bottom=G-c-x+"px":b.top=c+m-x+"px";u(l,b);d.openMenu=!0},addButton:function(a){var b=this,e=b.renderer,c=p(b.options.navigation.buttonOptions,a),f=c.onclick,m=c.menuItems,g,d,n=c.symbolSize||12;b.btnCount||(b.btnCount=0);b.exportDivElements||(b.exportDivElements=[],b.exportSVGElements=[]);if(!1!==c.enabled){var h=c.theme,k=h.states,q=k&&k.hover, +k=k&&k.select,l;delete h.states;f?l=function(a){a.stopPropagation();f.call(b,a)}:m&&(l=function(){b.contextMenu(d.menuClassName,m,d.translateX,d.translateY,d.width,d.height,d);d.setState(2)});c.text&&c.symbol?h.paddingLeft=r(h.paddingLeft,25):c.text||t(h,{width:c.width,height:c.height,padding:0});d=e.button(c.text,0,0,l,h,q,k).addClass(a.className).attr({"stroke-linecap":"round",title:r(b.options.lang[c._titleKey],""),zIndex:3});d.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;c.symbol&& +(g=e.symbol(c.symbol,c.symbolX-n/2,c.symbolY-n/2,n,n,{width:n,height:n}).addClass("highcharts-button-symbol").attr({zIndex:1}).add(d),g.attr({stroke:c.symbolStroke,fill:c.symbolFill,"stroke-width":c.symbolStrokeWidth||1}));d.add().align(t(c,{width:d.width,x:r(c.x,b.buttonOffset)}),!0,"spacingBox");b.buttonOffset+=(d.width+c.buttonSpacing)*("right"===c.align?-1:1);b.exportSVGElements.push(d,g)}},destroyExport:function(a){var b=a?a.target:this;a=b.exportSVGElements;var e=b.exportDivElements,c=b.exportEvents, +h;a&&(k(a,function(a,c){a&&(a.onclick=a.ontouchstart=null,h="cache-"+a.menuClassName,b[h]&&delete b[h],b.exportSVGElements[c]=a.destroy())}),a.length=0);e&&(k(e,function(a,c){f.clearTimeout(a.hideTimer);H(a,"mouseleave");b.exportDivElements[c]=a.onmouseout=a.onmouseover=a.ontouchstart=a.onclick=null;B(a)}),e.length=0);c&&(k(c,function(a){a()}),c.length=0)}});J.menu=function(a,b,e,c){return["M",a,b+2.5,"L",a+e,b+2.5,"M",a,b+c/2+.5,"L",a+e,b+c/2+.5,"M",a,b+c-1.5,"L",a+e,b+c-1.5]};A.prototype.renderExporting= +function(){var a=this,b=a.options.exporting,e=b.buttons,c=a.isDirtyExporting||!a.exportSVGElements;a.buttonOffset=0;a.isDirtyExporting&&a.destroyExport();c&&!1!==b.enabled&&(a.exportEvents=[],E(e,function(b){a.addButton(b)}),a.isDirtyExporting=!1);w(a,"destroy",a.destroyExport)};A.prototype.callbacks.push(function(a){a.renderExporting();w(a,"redraw",a.renderExporting);k(["exporting","navigation"],function(b){a[b]={update:function(e,c){a.isDirtyExporting=!0;p(!0,a.options[b],e);r(c,!0)&&a.redraw()}}})})})(h)}); diff --git a/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js b/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js index 13365f04e..a86601f50 100644 --- a/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js +++ b/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js @@ -236,13 +236,18 @@ } var $cols = $(val).find('th, td'); return $cols.map(function (i, val) { + // 当文字过长有省略时取title导出 + var titleText=$(val).text(); + if($(val).attr("title")!=null&&$(val).attr("title")!=""){ + titleText=$(val).attr("title"); + } if (!!~ignoreCols.indexOf(i) || $(val).is(ignoreCSS)) { return; } if ($(val).is(emptyCSS)) { return " " } - return '"' + TableExport.prototype.formatValue(isTrimWhitespace, $(val).text().replace(/"/g, '""')) + '"'; + return '"' + TableExport.prototype.formatValue(isTrimWhitespace, titleText.replace(/"/g, '""')) + '"'; }).get().join(colD); }).get().join(rdel), dataObject = TableExport.prototype.escapeHtml( diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 7734171a4..f09886b49 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -1,6 +1,17 @@ //蓝色系 colors:['#0026af', '#0032bc', '#004bbc', '#015bb1', '#2f74b5', '#4186c1', '#5597cd', '#67a7de', '#77b5dc', '#98cde7', '#b9e7f4', '#d9ffff'], //彩色系colors:[ '#fe392e','#fe7d2e','#febb1d', '#feff1d','#51d569','#51d5d5','#0032bc','#1d7cf9' ,'#77b5dc','#b9e7f4'], - + Highcharts.setOptions({ // Apply to all charts + chart: { + events: { + beforePrint: function () { + $(".highcharts-background").attr("fill","rgba(48,48,48,1)") + }, + afterPrint: function () { + $(".highcharts-background").attr("fill","rgba(255, 255, 255, 0)") + } + } + } + }); //协议统计分析 function echart_1(rs) { var data=new Array(); From 61e2e5ea82bec3c4bfb15fb6585f51cf95450b85 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 20 Dec 2018 21:15:24 +0800 Subject: [PATCH 002/147] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4-?= =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/dashboard/trafficAppTypeList.jsp | 2 +- .../WEB-INF/views/dashboard/trafficDomainTrans.jsp | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 43b715095..f92fe2739 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -189,7 +189,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:"service", + fileName:"APP", bootstrap:false }); $("#myexport").click(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 2a22f9bc1..405628527 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -94,10 +94,20 @@ function showDomainTrans(rs){ zoomType: 'x' }, exporting: { - filename:'Domain', + filename:'Domain-Trans', scale:1, sourceWidth: 1280, sourceHeight: 500, + buttons: { + contextButton: { + menuItems: [ + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs + ] + } + } }, title: { text: domainName From 06d94fc75f6980960899151249914c1d1a7aa0ca Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Fri, 21 Dec 2018 10:59:16 +0800 Subject: [PATCH 003/147] =?UTF-8?q?=E7=BD=91=E7=AB=99=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1-=E5=9F=9F=E5=90=8D=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=A4=9A=E9=80=89=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrafficStatisticsInfoController.java | 8 ++++++-- .../views/dashboard/trafficWebTypeList.jsp | 15 +++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java index fd7f31cde..e7f03a08b 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -475,7 +475,7 @@ public class TrafficStatisticsInfoController extends BaseController { */ @RequestMapping(value="websiteList") @ResponseBody - public List websiteList(Integer entranceId,Integer domain,Model model,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){ + public List websiteList(Integer entranceId,Integer[] domain,Model model,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){ Map fromJsonList = new HashMap(); List list = new ArrayList(); String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_WEBSITELIST_NOTIME; @@ -489,7 +489,11 @@ public class TrafficStatisticsInfoController extends BaseController { } url=urlAddDate(url, beginDate, endDate); if(domain!=null){ - url=url+"&domain="+domain; + for (Integer dom : domain) { + if(dom!=null){ + url=url+"&domain="+dom; + } + } } if(entranceId!=null){ url=url+"&entranceId="+entranceId; diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 943beb86a..ba5521dd4 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -47,7 +47,7 @@ code="begin_date" />
@@ -59,7 +59,7 @@ code="end_date" /> @@ -69,8 +69,8 @@
- + @@ -110,12 +110,6 @@
- <%-- --%> -
@@ -221,6 +215,7 @@ }, async : false, timeout : 40000, + traditional:true, success : function(data) { if (data != null && data.length > 0 && data[0].error != null) { From 618593ebd1da2a6ad3f96cd264115ba433febd29 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Fri, 21 Dec 2018 11:31:47 +0800 Subject: [PATCH 004/147] =?UTF-8?q?IP=E7=99=BD=E5=90=8D=E5=8D=95=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=A8=A1=E6=9D=BF=E5=A2=9E=E5=8A=A0=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=20=E6=96=B9=E5=90=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/IpWhitelistTemplate.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/com/nis/domain/configuration/template/IpWhitelistTemplate.java b/src/main/java/com/nis/domain/configuration/template/IpWhitelistTemplate.java index dd512c90a..728e672a8 100644 --- a/src/main/java/com/nis/domain/configuration/template/IpWhitelistTemplate.java +++ b/src/main/java/com/nis/domain/configuration/template/IpWhitelistTemplate.java @@ -28,6 +28,8 @@ public class IpWhitelistTemplate extends BasicTemplate{ private String destIpAddress; private String srcPort; private String destPort; + private Integer protocol; + private Integer direction; @ExcelField(title="config_describe",align=2,sort=1) public String getCfgDesc() { @@ -66,4 +68,20 @@ public class IpWhitelistTemplate extends BasicTemplate{ this.destPort = destPort; } + @ExcelField(title="protocol",align=2,sort=15) + public Integer getProtocol() { + return protocol; + } + public void setProtocol(Integer protocol) { + this.protocol = protocol; + } + + @ExcelField(title="direction",align=2,sort=16) + public Integer getDirection() { + return direction; + } + public void setDirection(Integer direction) { + this.direction = direction; + } + } From 7e0d1a44ba32677d5111ae3ae10eac806b2b5e89 Mon Sep 17 00:00:00 2001 From: wangxin Date: Fri, 21 Dec 2018 10:37:29 +0600 Subject: [PATCH 005/147] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DDNS=E5=85=B3=E9=94=AE=E5=AD=97=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/controller/configuration/ntc/IpController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 4cd4a0465..70413da54 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 @@ -315,7 +315,12 @@ public class IpController extends BaseController{ ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpPayloadTemplate.class, 2); excel.setDataList(pro,classList,null). write(request,response, fileName).dispose(); - }else if(regionDict.getFunctionId().equals(7)||regionDict.getFunctionId().equals(401)){ //Dns IP,DNS FAKE IP + }else if(regionDict.getFunctionId().equals(7)) { + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsIpTemplate.class, 2); + excel.setDataList(pro,classList,null). + write(request,response, fileName).dispose(); + }else if(regionDict.getFunctionId().equals(401)){ //Dns IP,DNS FAKE IP List classList=new ArrayList(); ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsFakeIpTemplate.class, 2); excel.setDataList(pro,classList,null). From 5236f5af2b0857215ed2bb9475f8914fe0899be9 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Fri, 21 Dec 2018 12:56:38 +0800 Subject: [PATCH 006/147] =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/dynamicpage/DynamicIndexController.java | 10 +++++----- .../webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java b/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java index 270c2e129..d8fabfdcf 100644 --- a/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java +++ b/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java @@ -101,14 +101,14 @@ public class DynamicIndexController extends BaseController { String nowString = DateUtils.formatDate(now, "yyyy-MM-dd HH:mm:ss"); String startString = DateUtils.formatDate(start, "yyyy-MM-dd HH:mm:ss"); - nowString = "2018-12-05 00:00:00"; - startString = "2018-12-04 17:00:00"; + /*nowString = "2018-12-05 00:00:00"; + startString = "2018-12-04 17:00:00";*/ String url = Constants.LOG_BASE_URL + Constants.TRAFFIC_AREA_STAT; //String url = "http://localhost:8080/ntc/helloworld/test"; Map params = new HashMap(); params.put("searchReportStartTime", startString); params.put("searchReportEndTime", nowString); - //params.put("baseNum", baseNum); + params.put("baseNum", baseNum); try { String recv = HttpClientUtil.getMsg(url, params, null); @@ -184,8 +184,8 @@ public class DynamicIndexController extends BaseController { Map params = new HashMap(); params.put("searchReportStartTime", startString); params.put("searchReportEndTime", nowString); - params.put("searchBusinessType", 1); - //params.put("baseNum", baseNum); + params.put("searchBusinessType", 2); + params.put("baseNum", baseNum); try { String recv = HttpClientUtil.getMsg(url, params, null); diff --git a/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp b/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp index 4679773e7..ce8223221 100644 --- a/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp @@ -1219,7 +1219,7 @@ /* 数字特效 */ function animalNum(dropNum){ - //var value = rand(100,999);; + //var dropNum = rand(100,99999);; $("#dataNums").rollNum({ deVal:dropNum }); From b553c27b15dc186aae23d21be8f59badb5965076 Mon Sep 17 00:00:00 2001 From: leijun Date: Fri, 21 Dec 2018 14:33:00 +0800 Subject: [PATCH 007/147] =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=AF=BC=E5=87=BA=20?= =?UTF-8?q?=E9=A6=96=E8=A1=8C=E6=B7=BB=E5=8A=A0=E6=A0=87=E9=A2=98=E5=92=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/domain/log/IrDnatLog.java | 20 +++-- .../java/com/nis/domain/log/IrSnatLog.java | 18 ++-- .../java/com/nis/util/excel/ExcelCsv.java | 4 +- .../java/com/nis/util/excel/ExportExcel.java | 4 +- .../nis/web/controller/BaseController.java | 12 ++- .../manipulation/DkBehaviorLogController.java | 3 +- .../controller/log/ntc/BgpLogController.java | 2 + .../log/ntc/CollectVoipLogController.java | 18 ++++ .../controller/log/ntc/DdosLogController.java | 3 +- .../controller/log/ntc/DnsLogController.java | 2 + .../controller/log/ntc/FtpLogController.java | 2 + .../log/ntc/HttpKeyLogController.java | 4 +- .../controller/log/ntc/HttpLogController.java | 4 +- .../controller/log/ntc/IpLogController.java | 26 ++---- .../log/ntc/IrDnatLogController.java | 70 +++++++++++++++- .../log/ntc/IrSnatLogController.java | 71 +++++++++++++++- .../controller/log/ntc/MailLogController.java | 2 + .../log/ntc/MmAvUrlLogController.java | 2 + .../log/ntc/MmFileDigestLogController.java | 3 +- .../log/ntc/MmPornAvSampleController.java | 2 + .../log/ntc/MmSampleAudioController.java | 3 +- .../log/ntc/MmSamplePicController.java | 7 +- .../log/ntc/MmSampleVideoController.java | 3 +- .../log/ntc/MmSampleVoipLogController.java | 2 + .../log/ntc/MmVoipIpLogController.java | 2 + .../ntc/NtcCollectRadiusLogController.java | 3 + .../log/ntc/NtcConnRecordLogController.java | 2 + .../log/ntc/OpenVpnLogController.java | 14 ++-- .../controller/log/ntc/P2pLogController.java | 2 + .../controller/log/ntc/SslLogController.java | 2 + .../log/pxy/PxyHttpLogController.java | 4 +- .../WEB-INF/views/log/ntc/irDnatLogList.jsp | 83 ++++++++++--------- .../WEB-INF/views/log/ntc/irSnatLogList.jsp | 81 ++++++++++-------- .../views/log/ntc/mmSampleAudioList.jsp | 4 +- 34 files changed, 353 insertions(+), 131 deletions(-) diff --git a/src/main/java/com/nis/domain/log/IrDnatLog.java b/src/main/java/com/nis/domain/log/IrDnatLog.java index 132c481e2..3c89a4add 100644 --- a/src/main/java/com/nis/domain/log/IrDnatLog.java +++ b/src/main/java/com/nis/domain/log/IrDnatLog.java @@ -1,19 +1,27 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class IrDnatLog extends BaseLogEntity { private static final long serialVersionUID = 5860838446015457328L; + @ExcelField(title = "user", sort = 8) protected String userId;// 用户名 + @ExcelField(title = "nat_ip", sort = 9) protected String natIp;// 复用的ip地址 + @ExcelField(title = "creat_time", sort = 10) protected String creatTime;// 链接建立时间 + @ExcelField(title = "close_time", sort = 11) protected String closeTime;// 链接结束时间 - protected String c2sPktNum;// c2s包数 - protected String s2cPktNum;// s2c包数 - protected String c2sByteNum;// c2s字节数 - protected String s2cByteNum;// s2c字节数 - - + @ExcelField(title = "c2s_pkt_num", sort = 12) + protected String c2sPktNum; + @ExcelField(title = "s2c_pkt_num", sort = 13) + protected String s2cPktNum; + @ExcelField(title = "c2s_byte_num", sort = 14) + protected String c2sByteNum; + @ExcelField(title = "s2c_byte_num", sort = 15) + protected String s2cByteNum; public String getUserId() { return userId; diff --git a/src/main/java/com/nis/domain/log/IrSnatLog.java b/src/main/java/com/nis/domain/log/IrSnatLog.java index 5b1fe3e2a..120f31763 100644 --- a/src/main/java/com/nis/domain/log/IrSnatLog.java +++ b/src/main/java/com/nis/domain/log/IrSnatLog.java @@ -1,17 +1,25 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class IrSnatLog extends BaseLogEntity { private static final long serialVersionUID = 5860838446015457328L; + @ExcelField(title = "nat_ip", sort = 9) protected String natIp;// 复用的ip地址 + @ExcelField(title = "creat_time", sort = 10) protected String creatTime;// 链接建立时间 + @ExcelField(title = "close_time", sort = 11) protected String closeTime;// 链接结束时间 - protected String c2sPktNum;// c2s包数 - protected String s2cPktNum;// s2c包数 - protected String c2sByteNum;// c2s字节数 - protected String s2cByteNum;// s2c字节数 - + @ExcelField(title = "c2s_pkt_num", sort = 12) + protected String c2sPktNum; + @ExcelField(title = "s2c_pkt_num", sort = 13) + protected String s2cPktNum; + @ExcelField(title = "c2s_byte_num", sort = 14) + protected String c2sByteNum; + @ExcelField(title = "s2c_byte_num", sort = 15) + protected String s2cByteNum; public String getNatIp() { return natIp; diff --git a/src/main/java/com/nis/util/excel/ExcelCsv.java b/src/main/java/com/nis/util/excel/ExcelCsv.java index dc9bd3447..6019e3212 100644 --- a/src/main/java/com/nis/util/excel/ExcelCsv.java +++ b/src/main/java/com/nis/util/excel/ExcelCsv.java @@ -225,14 +225,14 @@ public class ExcelCsv { for (int i = 0; i < replaceStr.length; i++) { String [] fields=replaceStr[i].split(":"); if(fields[0].equals(titleStr)){ - titleStr=msgProp.getProperty(fields[1]); + titleStr=msgProp.getProperty(fields[1],fields[1]); flag=false; break; } } } if(flag){ - titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr); + titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr,titleStr); } headerList.add(titleStr); commentList.add(commentStr); diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index 437c05430..11f28f167 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -2227,14 +2227,14 @@ public class ExportExcel { for (int i = 0; i < replaceStr.length; i++) { String [] fields=replaceStr[i].split(":"); if(fields[0].equals(titleStr)){ - titleStr=msgProp.getProperty(fields[1]); + titleStr=msgProp.getProperty(fields[1],fields[1]); flag=false; break; } } } if(flag){ - titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr); + titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr,titleStr); } headerList.add(titleStr); commentList.add(commentStr); diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 5a438b059..f36a6df61 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -2031,7 +2031,17 @@ public class BaseController { ByteArrayOutputStream out = new ByteArrayOutputStream(); ExcelCsv.writeCSVFile(response,titleList,headMap,dataList,fileName,titleTime,msgProp); } - + public String initLogMap(BaseLogEntity log,String title){ + Properties msgProp = getMsgProp(); + String logTime=msgProp.getProperty(title,title);; + if(log.getSearchFoundStartTime()!=null){ + logTime+=" "+msgProp.getProperty("begin_date")+":"+log.getSearchFoundStartTime(); + } + if(log.getSearchFoundEndTime()!=null){ + logTime+=" "+msgProp.getProperty("end_date")+":"+log.getSearchFoundStartTime(); + } + return logTime; + } public String initTimeMap(BaseCfg cfg){ Properties msgProp = getMsgProp(); diff --git a/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java b/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java index 12aefd626..df3c3dc4f 100644 --- a/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java +++ b/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java @@ -186,7 +186,8 @@ public class DkBehaviorLogController extends BaseController{ String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put(name, cfgIndexInfoNoExport); dataMap.put(name, list); - + String timeRange= initLogMap(entry,name); + noExportMap.put("timeRange", timeRange); if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, name, titleList, classMap, dataMap, noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java index eb0125fa9..5c0d5c205 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java @@ -124,6 +124,8 @@ public class BgpLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("bgp_control", cfgIndexInfoNoExport); dataMap.put("bgp_control", list); + String timeRange= initLogMap(log,"bgp_control"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(types)) { this._exportCsv(model, request, response, redirectAttributes, "bgp_control", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/CollectVoipLogController.java b/src/main/java/com/nis/web/controller/log/ntc/CollectVoipLogController.java index 057c42b21..5946ac71a 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/CollectVoipLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/CollectVoipLogController.java @@ -7,6 +7,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -31,6 +32,7 @@ import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.SysUser; +import com.nis.domain.log.BaseLogEntity; import com.nis.domain.log.NtcBGPLog; import com.nis.domain.log.NtcCollectRadiusLog; import com.nis.domain.log.NtcCollectVoipLog; @@ -278,6 +280,8 @@ public class CollectVoipLogController extends BaseController { String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns; noExportMap.put("collect_voip", cfgIndexInfoNoExport); dataMap.put("collect_voip", list); + String timeRange= initLogVoipMap(entry,"collect_voip"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "collect_voip", titleList, classMap, @@ -291,6 +295,20 @@ public class CollectVoipLogController extends BaseController { addMessage(redirectAttributes, "error", "export_failed"); } } + + public String initLogVoipMap(NtcCollectVoipLog log,String title){ + Properties msgProp = getMsgProp(); + String logTime=msgProp.getProperty(title,title);; + if(log.getSearchFoundStartTime()!=null){ + logTime+=" "+msgProp.getProperty("begin_date")+":"+log.getSearchFoundStartTime(); + } + if(log.getSearchFoundEndTime()!=null){ + logTime+=" "+msgProp.getProperty("end_date")+":"+log.getSearchFoundStartTime(); + } + return logTime; + } + + public List getList() { List list = new ArrayList(); diff --git a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java index fa11f78f1..09379299c 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java @@ -170,7 +170,8 @@ public class DdosLogController extends BaseController{ String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("target_ip_protect", cfgIndexInfoNoExport); dataMap.put("target_ip_protect", list); - + String timeRange= initLogMap(log,"target_ip_protect"); + noExportMap.put("timeRange", timeRange); if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "target_ip_protect", titleList, classMap, dataMap, noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java index 72da7d9be..90b39ff4e 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java @@ -133,6 +133,8 @@ public class DnsLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("DNS", cfgIndexInfoNoExport); dataMap.put("DNS", list); + String timeRange= initLogMap(log,"DNS"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "DNS", titleList, classMap, dataMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java index 533f495a3..5da87e518 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java @@ -144,6 +144,8 @@ public class FtpLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("ftp_control", cfgIndexInfoNoExport); dataMap.put("ftp_control", list); + String timeRange= initLogMap(log,"ftp_control"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "ftp_control", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/HttpKeyLogController.java b/src/main/java/com/nis/web/controller/log/ntc/HttpKeyLogController.java index d2a0eda84..d41662a61 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/HttpKeyLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/HttpKeyLogController.java @@ -147,8 +147,8 @@ public class HttpKeyLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("http_keyword", cfgIndexInfoNoExport); dataMap.put("http_keyword", list); -// String timeRange= initLogMap(log,"http_keyword"); -// noExportMap.put("timeRange", timeRange); + String timeRange= initLogMap(log,"http_keyword"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "http_keyword", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java index b81a6a001..a134cde6a 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java @@ -143,8 +143,8 @@ public class HttpLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("HTTP", cfgIndexInfoNoExport); dataMap.put("HTTP", list); - /*String timeRange= initLogMap(log,"HTTP"); - noExportMap.put("timeRange", timeRange);*/ + String timeRange= initLogMap(log,"HTTP"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "HTTP", titleList, classMap, dataMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java index 26eefdb35..c3c98872e 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java @@ -1,25 +1,18 @@ package com.nis.web.controller.log.ntc; -import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - import org.apache.commons.lang3.StringUtils; -import org.aspectj.util.FileUtil; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; @@ -27,11 +20,8 @@ import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.SysUser; -import com.nis.domain.log.NtcHttpLog; -import com.nis.domain.log.NtcIpLog; import com.nis.domain.log.NtcIpLog; import com.nis.domain.maat.LogRecvData; -import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; @@ -138,7 +128,6 @@ public class IpLogController extends BaseController { List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - String url = Constants.LOG_BASE_URL + Constants.NTC_IP_LOG; String recv = HttpClientUtil.getMsg(url, params, request); List list = new ArrayList(); @@ -156,8 +145,8 @@ public class IpLogController extends BaseController { setLogAction(l, serviceList); } - titleList.add("Ip"); - classMap.put("Ip", NtcIpLog.class); + titleList.add("ip_control"); + classMap.put("ip_control", NtcIpLog.class); SysUser user = UserUtils.getUser(); if (!user.isAdmin()) { hColumns += ",scene_file,"; @@ -165,14 +154,15 @@ public class IpLogController extends BaseController { hColumns += ","; } String cfgIndexInfoNoExport = "," + hColumns; - noExportMap.put("Ip", cfgIndexInfoNoExport); - dataMap.put("Ip", list); - + noExportMap.put("ip_control", cfgIndexInfoNoExport); + dataMap.put("ip_control", list); + String timeRange= initLogMap(log,"ip_control"); + noExportMap.put("timeRange", timeRange); if ("csv".equals(type)) { - this._exportCsv(model, request, response, redirectAttributes, "Ip", titleList, classMap, + this._exportCsv(model, request, response, redirectAttributes, "ip_control", titleList, classMap, dataMap, noExportMap); } else { - this._export(model, request, response, redirectAttributes, "Ip", titleList, classMap, dataMap, + this._export(model, request, response, redirectAttributes, "ip_control", titleList, classMap, dataMap, noExportMap); } } catch (Exception e) { diff --git a/src/main/java/com/nis/web/controller/log/ntc/IrDnatLogController.java b/src/main/java/com/nis/web/controller/log/ntc/IrDnatLogController.java index 918efb828..d83bd04e1 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/IrDnatLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/IrDnatLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -12,6 +13,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -19,13 +21,14 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.IrDnatLog; -import com.nis.domain.log.NtcIpsecLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/irDnatLogs") @@ -70,4 +73,69 @@ public class IrDnatLogController extends BaseController { return "/log/ntc/irDnatLogList"; } + + // Ip配置导出 + @RequestMapping(value = "exportDnat") + public void exportIp(@ModelAttribute("log") IrDnatLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + List list = new ArrayList(); + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.IR_DNAT_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (IrDnatLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + } + titleList.add("dnat_multiplex"); + classMap.put("dnat_multiplex", IrDnatLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("dnat_multiplex", cfgIndexInfoNoExport); + dataMap.put("dnat_multiplex", list); + String timeRange= initLogMap(log,"dnat_multiplex"); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "dnat_multiplex", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "dnat_multiplex", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("dnat_multiplex export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/IrSnatLogController.java b/src/main/java/com/nis/web/controller/log/ntc/IrSnatLogController.java index fd4f901b8..4860bf557 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/IrSnatLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/IrSnatLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -12,6 +13,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -19,13 +21,14 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; -import com.nis.domain.log.IrDnatLog; +import com.nis.domain.SysUser; import com.nis.domain.log.IrSnatLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/irSnatLogs") @@ -71,4 +74,70 @@ public class IrSnatLogController extends BaseController { return "/log/ntc/irSnatLogList"; } + // Ip配置导出 + @RequestMapping(value = "exportSnat") + public void exportIp(@ModelAttribute("log") IrSnatLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + List list = new ArrayList(); + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.IR_SNAT_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (IrSnatLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + } + + titleList.add("snat_multiplex"); + classMap.put("snat_multiplex", IrSnatLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("snat_multiplex", cfgIndexInfoNoExport); + dataMap.put("snat_multiplex", list); + String timeRange= initLogMap(log,"snat_multiplex"); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "snat_multiplex", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "snat_multiplex", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("snat_multiplex export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java index 91a085d3a..ec8df1b33 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java @@ -151,6 +151,8 @@ public class MailLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("mail_control", cfgIndexInfoNoExport); dataMap.put("mail_control", list); + String timeRange= initLogMap(log,"mail_control"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "mail_control", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java index 688e8dbaf..586959fc3 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java @@ -147,6 +147,8 @@ public class MmAvUrlLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("streaming_media", cfgIndexInfoNoExport); dataMap.put("streaming_media", list); + String timeRange= initLogMap(log,"streaming_media"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "streaming_media", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmFileDigestLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmFileDigestLogController.java index 4a8711f88..aaae8f60e 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmFileDigestLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmFileDigestLogController.java @@ -146,7 +146,8 @@ public class MmFileDigestLogController extends BaseController { String cfgIndexInfoNoExport = ",log_uri,direction," + hColumns; noExportMap.put("file_digest_control", cfgIndexInfoNoExport); dataMap.put("file_digest_control", list); - + String timeRange= initLogMap(log,"file_digest_control"); + noExportMap.put("timeRange", timeRange); if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "file_digest_control", titleList, classMap, dataMap, noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java b/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java index d6843ad90..19137f428 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java @@ -169,6 +169,8 @@ public class MmPornAvSampleController extends BaseController { String cfgIndexInfoNoExport=","+hColumns; noExportMap.put("av_sample_video_porn_control",cfgIndexInfoNoExport); dataMap.put("av_sample_video_porn_control",list); + String timeRange= initLogMap(log,"av_sample_video_porn_control"); + noExportMap.put("timeRange", timeRange); /*}*/ if("csv".equals(type)){ this._exportCsv(model, request, response, redirectAttributes,"av_sample_video_porn_control",titleList,classMap,dataMap,noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java index cdc4949d1..8945e4e49 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java @@ -127,7 +127,8 @@ public class MmSampleAudioController extends BaseController{ String cfgIndexInfoNoExport = ",direction," + hColumns; noExportMap.put("av_sample_audio_control", cfgIndexInfoNoExport); dataMap.put("av_sample_audio_control", list); - + String timeRange= initLogMap(log,"av_sample_audio_control"); + noExportMap.put("timeRange", timeRange); if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "av_sample_audio_control", titleList, classMap, dataMap, noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java index 000109e0f..de9b96ca8 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java @@ -112,8 +112,8 @@ public class MmSamplePicController extends BaseController{ l.setFunctionId(log.getFunctionId()); setLogAction(l, serviceList); } - titleList.add("SamplePic"); - classMap.put("SamplePic", MmSamplePicLog.class); + titleList.add("av_sample_picture_control"); + classMap.put("av_sample_picture_control", MmSamplePicLog.class); SysUser user = UserUtils.getUser(); if (!user.isAdmin()) { hColumns += ",scene_file,"; @@ -123,7 +123,8 @@ public class MmSamplePicController extends BaseController{ String cfgIndexInfoNoExport = ",direction," + hColumns; noExportMap.put("av_sample_picture_control", cfgIndexInfoNoExport); dataMap.put("av_sample_picture_control", list); - + String timeRange= initLogMap(log,"av_sample_picture_control"); + noExportMap.put("timeRange", timeRange); if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "av_sample_picture_control", titleList, classMap, dataMap, noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java index 7e584bbd3..431db7c9c 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java @@ -123,7 +123,8 @@ public class MmSampleVideoController extends BaseController{ String cfgIndexInfoNoExport = ",direction," + hColumns; noExportMap.put("av_sample_video_control", cfgIndexInfoNoExport); dataMap.put("av_sample_video_control", list); - + String timeRange= initLogMap(log,"av_sample_video_control"); + noExportMap.put("timeRange", timeRange); if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "av_sample_video_control", titleList, classMap, dataMap, noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java index 124ff3d2e..7eb385a2c 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java @@ -131,6 +131,8 @@ public class MmSampleVoipLogController extends BaseController { String cfgIndexInfoNoExport=","+hColumns; noExportMap.put("av_sample_voip_control",cfgIndexInfoNoExport); dataMap.put("av_sample_voip_control",list); + String timeRange= initLogMap(log,"av_sample_voip_control"); + noExportMap.put("timeRange", timeRange); /*}*/ if("csv".equals(type)){ this._exportCsv(model, request, response, redirectAttributes,"av_sample_voip_control",titleList,classMap,dataMap,noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java index 84000937c..eb7ab0876 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java @@ -142,6 +142,8 @@ public class MmVoipIpLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("av_voip_control", cfgIndexInfoNoExport); dataMap.put("av_voip_control", list); + String timeRange= initLogMap(log,"av_voip_control"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "av_voip_control", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/NtcCollectRadiusLogController.java b/src/main/java/com/nis/web/controller/log/ntc/NtcCollectRadiusLogController.java index 0cc9c7d53..ef7db0e73 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/NtcCollectRadiusLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/NtcCollectRadiusLogController.java @@ -127,6 +127,9 @@ public class NtcCollectRadiusLogController extends BaseController { String cfgIndexInfoNoExport=",cfg_id,action,"+hColumns; noExportMap.put("radius_log",cfgIndexInfoNoExport); dataMap.put("radius_log",list); + String timeRange= initLogMap(log,"radius_log"); + noExportMap.put("timeRange", timeRange); + /*}*/ if("csv".equals(type)){ this._exportCsv(model, request, response, redirectAttributes,"radius_log",titleList,classMap,dataMap,noExportMap); diff --git a/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java b/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java index c9e455bf1..f04c2d4e9 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java @@ -180,6 +180,8 @@ public class NtcConnRecordLogController extends BaseController { String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns; noExportMap.put("conn_record", cfgIndexInfoNoExport); dataMap.put("conn_record", list); + String timeRange= initLogMap(log,"conn_record"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "conn_record", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java index 75d0f48e2..7cad815c5 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java @@ -122,8 +122,8 @@ public class OpenVpnLogController extends BaseController{ list= data.getList(); } } - titleList.add("openVpn_log"); - classMap.put("openVpn_log", NtcOpenVpnLog.class); + titleList.add("spoofing_ip_policy"); + classMap.put("spoofing_ip_policy", NtcOpenVpnLog.class); SysUser user =UserUtils.getUser(); if (!user.isAdmin()){ hColumns+=",scene_file,"; @@ -131,13 +131,15 @@ public class OpenVpnLogController extends BaseController{ hColumns+=","; } String cfgIndexInfoNoExport=",cfg_id,action,"+hColumns; - noExportMap.put("openVpn_log",cfgIndexInfoNoExport); - dataMap.put("openVpn_log",list); + noExportMap.put("spoofing_ip_policy",cfgIndexInfoNoExport); + dataMap.put("spoofing_ip_policy",list); + String timeRange= initLogMap(log,"spoofing_ip_policy"); + noExportMap.put("timeRange", timeRange); /*}*/ if("csv".equals(type)){ - this._exportCsv(model, request, response, redirectAttributes,"openVpn_log",titleList,classMap,dataMap,noExportMap); + this._exportCsv(model, request, response, redirectAttributes,"spoofing_ip_policy",titleList,classMap,dataMap,noExportMap); }else{ - this._export(model, request, response, redirectAttributes,"openVpn_log",titleList,classMap,dataMap,noExportMap); + this._export(model, request, response, redirectAttributes,"spoofing_ip_policy",titleList,classMap,dataMap,noExportMap); } } catch (Exception e) { logger.error("openVpn export failed",e); diff --git a/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java b/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java index 16483b582..55f38c9cd 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java @@ -128,6 +128,8 @@ public class P2pLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("p2p_control", cfgIndexInfoNoExport); dataMap.put("p2p_control", list); + String timeRange= initLogMap(log,"p2p_control"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "p2p_control", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java b/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java index 5f97fda33..eda70858f 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java @@ -138,6 +138,8 @@ public class SslLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put("ssl_control", cfgIndexInfoNoExport); dataMap.put("ssl_control", list); + String timeRange= initLogMap(log,"ssl_control"); + noExportMap.put("timeRange", timeRange); /* } */ if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, "ssl_control", titleList, classMap, diff --git a/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java b/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java index 5cb6054ba..6b7742694 100644 --- a/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java +++ b/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java @@ -178,8 +178,8 @@ public class PxyHttpLogController extends BaseController { String cfgIndexInfoNoExport = "," + hColumns; noExportMap.put(pxyName, cfgIndexInfoNoExport); dataMap.put(pxyName, list); - /*String timeRange= initLogMap(log,pxyName); - noExportMap.put("timeRange", timeRange);*/ + String timeRange= initLogMap(log,pxyName); + noExportMap.put("timeRange", timeRange); if ("csv".equals(type)) { this._exportCsv(model, request, response, redirectAttributes, pxyName, titleList, classMap, dataMap, noExportMap); diff --git a/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp index e216bb4d9..940c40327 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp @@ -94,6 +94,16 @@
+
+ + +
href="javascript:;"> @@ -180,45 +190,44 @@ - - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp index f5fb9941d..1d2408069 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp @@ -286,8 +286,8 @@ - - + + From 4147e52b739a360e665490af552e29cf2d041c50 Mon Sep 17 00:00:00 2001 From: lihaochen Date: Fri, 21 Dec 2018 15:13:48 +0800 Subject: [PATCH 008/147] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E9=A6=96=E8=A1=8C=E5=A2=9E=E5=8A=A0=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=92=8C=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/AppCfgController.java | 2210 +++++++++-------- .../AppFeatureCfgController.java | 440 ++-- .../BasicProtocolController.java | 365 +-- .../EncryptedTunnelBehaviorController.java | 437 ++-- .../maintenance/DnsIpCfgController.java | 294 ++- .../maintenance/DnsResStrategyController.java | 283 ++- .../IpMultiplexPoolCfgController.java | 531 ++-- .../manipulation/DdosCfgController.java | 260 +- .../manipulation/IpMultiplexController.java | 661 ++--- .../ntc/AsnPolicyCfgController.java | 124 +- .../ntc/AvContentController.java | 1614 ++++++------ .../configuration/ntc/AvController.java | 921 +++---- .../configuration/ntc/BgpCfgController.java | 347 +-- .../ntc/FileTransferCfgController.java | 1118 +++++---- .../configuration/ntc/IpController.java | 24 +- .../configuration/ntc/MailCfgController.java | 420 ++-- .../configuration/ntc/WebsiteController.java | 1349 +++++----- .../ntc/WhiteListController.java | 607 +++-- .../proxy/HttpRedirectPolicyController.java | 588 ++--- .../proxy/InterceptController.java | 509 ++-- .../proxy/PxyObjKeyringController.java | 1443 +++++------ .../views/cfg/app/appDomainCfgList.jsp | 14 +- .../WEB-INF/views/cfg/app/appHttpCfgList.jsp | 14 +- .../WEB-INF/views/cfg/app/appIpCfgList.jsp | 14 +- .../views/cfg/app/appMultiFeatureCfgList.jsp | 36 +- .../views/cfg/app/appPolicyCfgList.jsp | 14 +- .../WEB-INF/views/cfg/app/appSslCfgList.jsp | 14 +- .../views/cfg/app/appTopicDomainCfgList.jsp | 14 +- .../views/cfg/av/contUrl/contUrlList.jsp | 14 +- .../WEB-INF/views/cfg/av/voip/voipList.jsp | 48 +- .../WEB-INF/views/cfg/basicprotocol/list.jsp | 14 +- .../WEB-INF/views/cfg/ddosIpCfgList.jsp | 78 +- .../webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp | 62 +- .../views/cfg/encryptedtunnelbehav/list.jsp | 14 +- .../views/cfg/fileTransfer/ftpList.jsp | 14 +- .../views/cfg/fileTransfer/p2pList.jsp | 14 +- .../views/cfg/intercept/interceptList.jsp | 32 +- .../views/cfg/intercept/strateagy/list.jsp | 14 +- .../intercept/strateagy/trustedCertList.jsp | 14 +- .../WEB-INF/views/cfg/ipaddr/ipList.jsp | 14 +- .../WEB-INF/views/cfg/mail/mailList.jsp | 14 +- .../cfg/maintenance/dnsResStrategy/list.jsp | 14 +- .../WEB-INF/views/cfg/other/bgpList.jsp | 14 +- .../WEB-INF/views/cfg/proxy/cache/list.jsp | 14 +- .../cfg/proxy/control/httpRedirectList.jsp | 64 +- .../views/cfg/proxy/spoofingIpPool/list.jsp | 40 +- .../webapp/WEB-INF/views/cfg/requestList.jsp | 42 +- .../WEB-INF/views/cfg/website/dnsList.jsp | 52 +- .../WEB-INF/views/cfg/website/httpList.jsp | 50 +- .../WEB-INF/views/cfg/website/sslList.jsp | 50 +- .../views/cfg/whitelist/domainList.jsp | 52 +- .../WEB-INF/views/cfg/whitelist/ipList.jsp | 50 +- 52 files changed, 8333 insertions(+), 7120 deletions(-) diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index b421742ac..00c2b9c13 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -58,6 +58,7 @@ import com.nis.web.security.UserUtils; /** * 特定协议相关配置控制类 + * * @author zhangwei * */ @@ -66,61 +67,69 @@ import com.nis.web.security.UserUtils; public class AppCfgController extends BaseController { /** * app策略列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"policyCfgList"}) - public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "policyCfgList" }) + public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppPolicyList(searchPage, cfg); -// for(AppPolicyCfg entity:page.getList()){ -// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); -// if(app!=null) { -// entity.setAppName(app.getSpecServiceName()); -// } -// } - //查找社交应用的所有有效二级特定服务 -// SpecificServiceCfg second=new SpecificServiceCfg(); -// second.setCfgType(1); -// second.setIsValid(Constants.VALID_YES); -// second.setIsLeaf(1); -// List secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null); - - //遍历,找到匹配项后将行为设置进去 -// for(AppPolicyCfg entity:page.getList()){ -// if(entity.getBehavCode()==null) continue; -// for(SpecificServiceCfg secondCfg:secondList) { -// if(secondCfg.getSpecServiceCode()==null) continue; -// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) { -// entity.setBehavName(secondCfg.getSpecServiceName()); -// break; -// } -// } -// } + // for(AppPolicyCfg entity:page.getList()){ + // SpecificServiceCfg app = + // specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + // if(app!=null) { + // entity.setAppName(app.getSpecServiceName()); + // } + // } + // 查找社交应用的所有有效二级特定服务 + // SpecificServiceCfg second=new SpecificServiceCfg(); + // second.setCfgType(1); + // second.setIsValid(Constants.VALID_YES); + // second.setIsLeaf(1); + // List + // secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, + // null); + + // 遍历,找到匹配项后将行为设置进去 + // for(AppPolicyCfg entity:page.getList()){ + // if(entity.getBehavCode()==null) continue; + // for(SpecificServiceCfg secondCfg:secondList) { + // if(secondCfg.getSpecServiceCode()==null) continue; + // if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) + // { + // entity.setBehavName(secondCfg.getSpecServiceName()); + // break; + // } + // } + // } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appPolicyCfgList"; } + /** * ajax设置Name + * * @param model * @param ids * @return */ - @RequestMapping(value="ajaxAppName",method=RequestMethod.POST) + @RequestMapping(value = "ajaxAppName", method = RequestMethod.POST) @ResponseBody - public List> ajaxAppName(Model model,String ids){ - List> dataList=new ArrayList<>(); - List serviceList=specificServiceCfgService.getBySpecServiceCodes(ids); - Map appMap=new HashMap<>(); - Map behavMap=new HashMap<>(); - for(SpecificServiceCfg cfg:serviceList) { - if(cfg.getIsLeaf().intValue()==0) { + public List> ajaxAppName(Model model, String ids) { + List> dataList = new ArrayList<>(); + List serviceList = specificServiceCfgService.getBySpecServiceCodes(ids); + Map appMap = new HashMap<>(); + Map behavMap = new HashMap<>(); + for (SpecificServiceCfg cfg : serviceList) { + if (cfg.getIsLeaf().intValue() == 0) { appMap.put(cfg.getSpecServiceCode().toString(), cfg.getSpecServiceName()); - }else { + } else { behavMap.put(cfg.getSpecServiceCode().toString(), cfg.getSpecServiceName()); } } @@ -128,61 +137,67 @@ public class AppCfgController extends BaseController { dataList.add(behavMap); return dataList; } + /** * 查询APP策略IP子配置 + * * @param model * @param cfgId * @param index * @return */ - @RequestMapping(value = {"ajaxAppPolicyIpList"}) - public String ajaxSslSubList(Model model,Long cfgId,Integer index,Integer compileId) { - AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId,compileId); + @RequestMapping(value = { "ajaxAppPolicyIpList" }) + public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) { + AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ - if(!ntc.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ntc.getCfgType()}); + for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) { + if (!ntc.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ntc.getCfgType() }); cfgType = ntc.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/app/appPolicySubList"; } + /** * 策略配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"policyCfgForm"}) - @RequiresPermissions(value={"app:policy:config"}) - public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) { - if(StringUtils.isNotBlank(ids)){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + @RequestMapping(value = { "policyCfgForm" }) + @RequiresPermissions(value = { "app:policy:config" }) + public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) { + if (StringUtils.isNotBlank(ids)) { + entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appPolicyCfgForm"; } + /** * 策略配置新增修改 + * * @param model * @param request * @param response @@ -190,31 +205,34 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppPolicyCfg"}) - @RequiresPermissions(value={"app:policy:config"}) - public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppPolicyCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppPolicyCfg" }) + @RequiresPermissions(value = { "app:policy:config" }) + public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppPolicyCfg entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppPolicyCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { - logger.error("saveAppPolicyCfg failed",e); + logger.error("saveAppPolicyCfg failed", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/policyCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/policyCfgList?functionId=" + entity.getFunctionId(); } + /** * 策略配置审核 + * * @param isAudit * @param isValid * @param ids @@ -222,21 +240,16 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppPolicyCfg"}) - @RequiresPermissions(value={"app:policy:confirm"}) - public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + @RequestMapping(value = { "auditAppPolicyCfg" }) + @RequiresPermissions(value = { "app:policy:confirm" }) + public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppPolicyCfg entity = new AppPolicyCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -244,96 +257,104 @@ public class AppCfgController extends BaseController { entity.setFunctionId(functionId); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP); try { - appCfgService.auditAppPolicyCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appCfgService.auditAppPolicyCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("app策略配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app策略配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return policyCfgList(model, cfg, request, response); } - - return "redirect:" + adminPath +"/app/policyCfgList?functionId="+functionId; + + return "redirect:" + adminPath + "/app/policyCfgList?functionId=" + functionId; } + /** * 策略配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppPolicyCfgValid"}) - @RequiresPermissions(value={"app:policy:config"}) - public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/policyCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppPolicyCfgValid" }) + @RequiresPermissions(value = { "app:policy:config" }) + public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId) { + appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/policyCfgList?functionId=" + functionId; } - + /** * app协议IP配置列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"ipCfgList"}) - public String ipCfgList(Model model,@ModelAttribute("cfg")AppIpCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "ipCfgList" }) + public String ipCfgList(Model model, @ModelAttribute("cfg") AppIpCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppIpList(searchPage, cfg); - for(AppIpCfg entity:page.getList()){ + for (AppIpCfg entity : page.getList()) { SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); entity.setAppName(app.getSpecServiceName()); } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appIpCfgList"; } + /** * 协议IP配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"ipCfgForm"}) - @RequiresPermissions(value={"app:ip:config"}) - public String ipCfgForm(Model model,String ids,AppIpCfg entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "ipCfgForm" }) + @RequiresPermissions(value = { "app:ip:config" }) + public String ipCfgForm(Model model, String ids, AppIpCfg entity) { + if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppIpCfg(Long.parseLong(ids)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appIpCfgForm"; } + /** * 协议IP配置新增修改 + * * @param model * @param request * @param response @@ -341,31 +362,34 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppIpCfg"}) - @RequiresPermissions(value={"app:ip:config"}) - public String saveAppIpCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppIpCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppIpCfg" }) + @RequiresPermissions(value = { "app:ip:config" }) + public String saveAppIpCfg(Model model, HttpServletRequest request, HttpServletResponse response, AppIpCfg entity, + RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppIpCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("saveAppIpCfg failed",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("saveAppIpCfg failed", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/ipCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/ipCfgList?functionId=" + entity.getFunctionId(); } + /** * 协议IP配置审核 + * * @param isAudit * @param isValid * @param ids @@ -373,22 +397,17 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppIpCfg"}) - @RequiresPermissions(value={"app:ip:confirm"}) - public String auditAppIpCfg(Model model,@ModelAttribute("cfg")AppIpCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)) { + @RequestMapping(value = { "auditAppIpCfg" }) + @RequiresPermissions(value = { "app:ip:confirm" }) + public String auditAppIpCfg(Model model, @ModelAttribute("cfg") AppIpCfg cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppIpCfg entity = new AppIpCfg(); String[] idArray = ids.split(","); - //同一编译IP的分组 - Map> dataMap=new HashMap<>(); - for(String id :idArray){ + // 同一编译IP的分组 + Map> dataMap = new HashMap<>(); + for (String id : idArray) { entity = appCfgService.getAppIpCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -396,106 +415,116 @@ public class AppCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); entity.setTableName(AppIpCfg.getTablename()); - if(dataMap.containsKey(entity.getCompileId())) { + if (dataMap.containsKey(entity.getCompileId())) { dataMap.get(entity.getCompileId()).add(entity); - }else { - List ipList=new ArrayList<>(); + } else { + List ipList = new ArrayList<>(); ipList.add(entity); dataMap.put(entity.getCompileId(), ipList); } } - for(List entitys:dataMap.values()) { + for (List entitys : dataMap.values()) { try { - appCfgService.auditAppIpCfg(entitys,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appCfgService.auditAppIpCfg(entitys, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("app协议IP配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app协议IP配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return ipCfgList(model, cfg, request, response); } - - return "redirect:" + adminPath +"/app/ipCfgList?functionId="+functionId; + + return "redirect:" + adminPath + "/app/ipCfgList?functionId=" + functionId; } + /** * IP配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppIpCfgValid"}) - @RequiresPermissions(value={"app:ip:config"}) - public String updateAppIpCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppIpCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/ipCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppIpCfgValid" }) + @RequiresPermissions(value = { "app:ip:config" }) + public String updateAppIpCfgValid(Integer isValid, String ids, Integer functionId) { + appCfgService.updateAppIpCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/ipCfgList?functionId=" + functionId; } + /** * app协议http配置列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"httpCfgList"}) - public String httpCfgList(Model model,@ModelAttribute("cfg")AppHttpCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "httpCfgList" }) + public String httpCfgList(Model model, @ModelAttribute("cfg") AppHttpCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppHttpList(searchPage, cfg); - for(AppHttpCfg entity:page.getList()){ + for (AppHttpCfg entity : page.getList()) { SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); entity.setAppName(app.getSpecServiceName()); -// entity.setCfgKeywords(entity.getCfgKeywords().replace(Constants.KEYWORD_EXPR, "&")); + // entity.setCfgKeywords(entity.getCfgKeywords().replace(Constants.KEYWORD_EXPR, + // "&")); } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appHttpCfgList"; } + /** * 协议http配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"httpCfgForm"}) - @RequiresPermissions(value={"app:http:config"}) - public String httpCfgForm(Model model,String ids,AppHttpCfg entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "httpCfgForm" }) + @RequiresPermissions(value = { "app:http:config" }) + public String httpCfgForm(Model model, String ids, AppHttpCfg entity) { + if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppHttpCfg(Long.parseLong(ids)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appHttpCfgForm"; } + /** * http配置新增修改 + * * @param model * @param request * @param response @@ -503,31 +532,34 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppHttpCfg"}) - @RequiresPermissions(value={"app:http:config"}) - public String saveAppHttpCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppHttpCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppHttpCfg" }) + @RequiresPermissions(value = { "app:http:config" }) + public String saveAppHttpCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppHttpCfg entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppHttpCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); logger.error("saveAppHttpCfg failed", e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/httpCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/httpCfgList?functionId=" + entity.getFunctionId(); } + /** * http配置审核 + * * @param isAudit * @param isValid * @param ids @@ -535,20 +567,15 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppHttpCfg"}) -// @RequiresPermissions(value={"app:http:confirm"}) - public String auditAppHttpCfg(Model model,@ModelAttribute("cfg")AppHttpCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + @RequestMapping(value = { "auditAppHttpCfg" }) + // @RequiresPermissions(value={"app:http:confirm"}) + public String auditAppHttpCfg(Model model, @ModelAttribute("cfg") AppHttpCfg cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppHttpCfg entity = new AppHttpCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = appCfgService.getAppHttpCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -556,94 +583,103 @@ public class AppCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppHttpCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appCfgService.auditAppHttpCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("app http配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app http配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return httpCfgList(model, cfg, request, response); } - return "redirect:" + adminPath +"/app/httpCfgList?functionId="+functionId; + return "redirect:" + adminPath + "/app/httpCfgList?functionId=" + functionId; } + /** * http配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppHttpCfgValid"}) - @RequiresPermissions(value={"app:http:config"}) - public String updateAppHttpCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppHttpCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/httpCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppHttpCfgValid" }) + @RequiresPermissions(value = { "app:http:config" }) + public String updateAppHttpCfgValid(Integer isValid, String ids, Integer functionId) { + appCfgService.updateAppHttpCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/httpCfgList?functionId=" + functionId; } + /** * app协议domain配置列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"domainCfgList"}) - public String domainCfgList(Model model,@ModelAttribute("cfg")AppDomainCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "domainCfgList" }) + public String domainCfgList(Model model, @ModelAttribute("cfg") AppDomainCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppDomainList(searchPage, cfg); - for(AppDomainCfg entity:page.getList()){ + for (AppDomainCfg entity : page.getList()) { SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); entity.setAppName(app.getSpecServiceName()); } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appDomainCfgList"; } + /** * 协议domain配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"domainCfgForm"}) - @RequiresPermissions(value={"app:domain:config"}) - public String domainCfgForm(Model model,String ids,AppDomainCfg entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "domainCfgForm" }) + @RequiresPermissions(value = { "app:domain:config" }) + public String domainCfgForm(Model model, String ids, AppDomainCfg entity) { + if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppDomainCfg(Long.parseLong(ids)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appDomainCfgForm"; } -/** + + /** * domain配置新增修改 + * * @param model * @param request * @param response @@ -651,30 +687,33 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppDomainCfg"}) - @RequiresPermissions(value={"app:domain:config"}) - public String saveAppDomainCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppDomainCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppDomainCfg" }) + @RequiresPermissions(value = { "app:domain:config" }) + public String saveAppDomainCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppDomainCfg entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppDomainCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/domainCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/domainCfgList?functionId=" + entity.getFunctionId(); } + /** * domain配置审核 + * * @param isAudit * @param isValid * @param ids @@ -682,20 +721,15 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppDomainCfg"}) -// @RequiresPermissions(value={"app:domain:confirm"}) - public String auditAppDomainCfg(Model model,@ModelAttribute("cfg")AppDomainCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + @RequestMapping(value = { "auditAppDomainCfg" }) + // @RequiresPermissions(value={"app:domain:confirm"}) + public String auditAppDomainCfg(Model model, @ModelAttribute("cfg") AppDomainCfg cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppDomainCfg entity = new AppDomainCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = appCfgService.getAppDomainCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -703,94 +737,103 @@ public class AppCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppDomainCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appCfgService.auditAppDomainCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("app协议domain配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app协议domain配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return domainCfgList(model, cfg, request, response); } - return "redirect:" + adminPath +"/app/domainCfgList?functionId="+functionId; + return "redirect:" + adminPath + "/app/domainCfgList?functionId=" + functionId; } + /** * domain配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppDomainCfgValid"}) - @RequiresPermissions(value={"app:domain:config"}) - public String updateAppDomainCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppDomainCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/domainCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppDomainCfgValid" }) + @RequiresPermissions(value = { "app:domain:config" }) + public String updateAppDomainCfgValid(Integer isValid, String ids, Integer functionId) { + appCfgService.updateAppDomainCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/domainCfgList?functionId=" + functionId; } + /** * app协议byte配置列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"byteCfgList"}) - public String byteCfgList(Model model,@ModelAttribute("cfg")AppByteCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "byteCfgList" }) + public String byteCfgList(Model model, @ModelAttribute("cfg") AppByteCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppByteList(searchPage, cfg); - for(AppByteCfg entity:page.getList()){ + for (AppByteCfg entity : page.getList()) { SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); entity.setAppName(app.getSpecServiceName()); } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appByteCfgList"; } + /** * 协议byte配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"byteCfgForm"}) - @RequiresPermissions(value={"app:byte:config"}) - public String byteCfgForm(Model model,String ids,AppByteCfg entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "byteCfgForm" }) + @RequiresPermissions(value = { "app:byte:config" }) + public String byteCfgForm(Model model, String ids, AppByteCfg entity) { + if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppByteCfg(Long.parseLong(ids)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appByteCfgForm"; } -/** + + /** * byte配置新增修改 + * * @param model * @param request * @param response @@ -798,31 +841,34 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppByteCfg"}) - @RequiresPermissions(value={"app:byte:config"}) - public String saveAppByteCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppByteCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppByteCfg" }) + @RequiresPermissions(value = { "app:byte:config" }) + public String saveAppByteCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppByteCfg entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppByteCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("saveAppByteCfg failed",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("saveAppByteCfg failed", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/byteCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/byteCfgList?functionId=" + entity.getFunctionId(); } + /** * byte配置审核 + * * @param isAudit * @param isValid * @param ids @@ -830,12 +876,13 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppByteCfg"}) -// @RequiresPermissions(value={"app:byte:confirm"}) - public String auditAppByteCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "auditAppByteCfg" }) + // @RequiresPermissions(value={"app:byte:confirm"}) + public String auditAppByteCfg(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { AppByteCfg entity = new AppByteCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = appCfgService.getAppByteCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -843,75 +890,83 @@ public class AppCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppByteCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appCfgService.auditAppByteCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("app协议byte配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app协议byte配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - return "redirect:" + adminPath +"/app/byteCfgList?functionId="+functionId; + return "redirect:" + adminPath + "/app/byteCfgList?functionId=" + functionId; } + /** * byte配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppByteCfgValid"}) - @RequiresPermissions(value={"app:byte:config"}) - public String updateAppByteCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppByteCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/byteCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppByteCfgValid" }) + @RequiresPermissions(value = { "app:byte:config" }) + public String updateAppByteCfgValid(Integer isValid, String ids, Integer functionId) { + appCfgService.updateAppByteCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/byteCfgList?functionId=" + functionId; } - + /** * APP ssl证书特征配置 列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"sslCfgList"}) - public String sslCfgList(Model model,@ModelAttribute("cfg")AppSslCertCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "sslCfgList" }) + public String sslCfgList(Model model, @ModelAttribute("cfg") AppSslCertCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppSslList(searchPage, cfg); - for(AppSslCertCfg entity:page.getList()){ + for (AppSslCertCfg entity : page.getList()) { SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); entity.setAppName(app.getSpecServiceName()); } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appSslCfgList"; } + /** * APP ssl证书特征配置表单(新增/修改) + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"sslCfgForm"}) - @RequiresPermissions(value={"app:ssl:config"}) - public String sslCfgForm(Model model,String ids,AppSslCertCfg entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "sslCfgForm" }) + @RequiresPermissions(value = { "app:ssl:config" }) + public String sslCfgForm(Model model, String ids, AppSslCertCfg entity) { + if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppSslCfg(Long.parseLong(ids)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appSslCfgForm"; } + /** * APP ssl证书特征配置(新增/修改)提交 + * * @param model * @param request * @param response @@ -919,31 +974,34 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppSslCfg"}) - @RequiresPermissions(value={"app:ssl:config"}) - public String saveAppSslCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppSslCertCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppSslCfg" }) + @RequiresPermissions(value = { "app:ssl:config" }) + public String saveAppSslCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppSslCertCfg entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppSslCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); logger.error("saveAppSslCfg failed", e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/sslCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/sslCfgList?functionId=" + entity.getFunctionId(); } + /** * APP ssl证书特征配置 审核 + * * @param isAudit * @param isValid * @param ids @@ -951,20 +1009,15 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppSslCfg"}) - @RequiresPermissions(value={"app:ssl:confirm"}) - public String auditAppSslCfg(Model model,@ModelAttribute("cfg")AppSslCertCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + @RequestMapping(value = { "auditAppSslCfg" }) + @RequiresPermissions(value = { "app:ssl:confirm" }) + public String auditAppSslCfg(Model model, @ModelAttribute("cfg") AppSslCertCfg cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppSslCertCfg entity = new AppSslCertCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = appCfgService.getAppSslCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -972,98 +1025,103 @@ public class AppCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppSslCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appCfgService.auditAppSslCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("app SSL配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app SSL配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return sslCfgList(model, cfg, request, response); } - - return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId; + + return "redirect:" + adminPath + "/app/sslCfgList?functionId=" + functionId; } + /** * APP ssl证书特征配置 删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppSslCfgValid"}) - @RequiresPermissions(value={"app:ssl:config"}) - public String updateAppSslCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppSslCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppSslCfgValid" }) + @RequiresPermissions(value = { "app:ssl:config" }) + public String updateAppSslCfgValid(Integer isValid, String ids, Integer functionId) { + appCfgService.updateAppSslCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/sslCfgList?functionId=" + functionId; } - /** * APP TCP会话字节数特征 列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"tcpCfgList"}) - public String tcpCfgList(Model model,@ModelAttribute("cfg")AppTcpCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "tcpCfgList" }) + public String tcpCfgList(Model model, @ModelAttribute("cfg") AppTcpCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppTcpList(searchPage, cfg); - for(AppTcpCfg entity:page.getList()){ + for (AppTcpCfg entity : page.getList()) { SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); entity.setAppName(app.getSpecServiceName()); } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appTcpCfgList"; } - + /** * APP TCP会话字节数特征表单(新增/修改) + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"tcpCfgForm"}) - @RequiresPermissions(value={"app:tcp:config"}) - public String tcpCfgForm(Model model,String ids,AppTcpCfg entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "tcpCfgForm" }) + @RequiresPermissions(value = { "app:tcp:config" }) + public String tcpCfgForm(Model model, String ids, AppTcpCfg entity) { + if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppTcpCfg(Long.parseLong(ids)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appTcpCfgForm"; } - + /** * APP TCP会话字节数特征配置(新增/修改)提交 + * * @param model * @param request * @param response @@ -1071,47 +1129,49 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppTcpCfg"}) - @RequiresPermissions(value={"app:tcp:config"}) - public String saveAppTcpCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppTcpCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppTcpCfg" }) + @RequiresPermissions(value = { "app:tcp:config" }) + public String saveAppTcpCfg(Model model, HttpServletRequest request, HttpServletResponse response, AppTcpCfg entity, + RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppTcpeCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("saveAppTcpCfg failed",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("saveAppTcpCfg failed", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/tcpCfgList?functionId=" + entity.getFunctionId(); } - + /** * APP TCP会话字节数特征配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppTcpCfgValid"}) - @RequiresPermissions(value={"app:tcp:config"}) - public String updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppTcpCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppTcpCfgValid" }) + @RequiresPermissions(value = { "app:tcp:config" }) + public String updateAppTcpCfgValid(Integer isValid, String ids, Integer functionId) { + appCfgService.updateAppTcpCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/tcpCfgList?functionId=" + functionId; } - - + /** * APP TCP会话字节数特征配置 审核 + * * @param isAudit * @param isValid * @param ids @@ -1119,12 +1179,13 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppTcpCfg"}) - @RequiresPermissions(value={"app:tcp:confirm"}) - public String auditAppTcpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "auditAppTcpCfg" }) + @RequiresPermissions(value = { "app:tcp:confirm" }) + public String auditAppTcpCfg(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { AppTcpCfg entity = new AppTcpCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = appCfgService.getAppTcpCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -1132,64 +1193,67 @@ public class AppCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppTcpCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appCfgService.auditAppTcpCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("app SSL配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app SSL配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId; + return "redirect:" + adminPath + "/app/tcpCfgList?functionId=" + functionId; } - - - - + /** * APP header特征配置 列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"headerCfgList"}) - public String headerCfgList(Model model,@ModelAttribute("cfg")AppHeaderCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "headerCfgList" }) + public String headerCfgList(Model model, @ModelAttribute("cfg") AppHeaderCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppHeaderList(searchPage, cfg); - for(AppHeaderCfg entity:page.getList()){ + for (AppHeaderCfg entity : page.getList()) { SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); entity.setAppName(app.getSpecServiceName()); } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appHeaderCfgList"; } + /** * APP header特征配置表单 (修改/新增) + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"headerCfgForm"}) - @RequiresPermissions(value={"app:header:config"}) - public String headerCfgForm(Model model,String ids,AppHeaderCfg entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "headerCfgForm" }) + @RequiresPermissions(value = { "app:header:config" }) + public String headerCfgForm(Model model, String ids, AppHeaderCfg entity) { + if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppHeaderCfg(Long.parseLong(ids)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appHeaderCfgForm"; } + /** * APP header特征配置 (新增/修改)表单提交 + * * @param model * @param request * @param response @@ -1197,31 +1261,34 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppHeaderCfg"}) - @RequiresPermissions(value={"app:header:config"}) - public String saveAppHeaderCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppHeaderCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppHeaderCfg" }) + @RequiresPermissions(value = { "app:header:config" }) + public String saveAppHeaderCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppHeaderCfg entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppHeaderCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("saveAppHeaderCfg failed",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("saveAppHeaderCfg failed", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/headerCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/headerCfgList?functionId=" + entity.getFunctionId(); } + /** * APP header特征配置 审核 + * * @param isAudit * @param isValid * @param ids @@ -1229,12 +1296,13 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppHeaderCfg"}) - @RequiresPermissions(value={"app:header:confirm"}) - public String auditAppHeaderCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "auditAppHeaderCfg" }) + @RequiresPermissions(value = { "app:header:confirm" }) + public String auditAppHeaderCfg(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { AppHeaderCfg entity = new AppHeaderCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = appCfgService.getAppHeaderCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -1242,96 +1310,109 @@ public class AppCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppHeaderCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appCfgService.auditAppHeaderCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("app Header配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app Header配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - return "redirect:" + adminPath +"/app/headerCfgList?functionId="+functionId; + return "redirect:" + adminPath + "/app/headerCfgList?functionId=" + functionId; } + /** * APP header特征配置 删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppHeaderCfgValid"}) - @RequiresPermissions(value={"app:header:config"}) - public String updateAppHeaderCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppHeaderCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/headerCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppHeaderCfgValid" }) + @RequiresPermissions(value = { "app:header:config" }) + public String updateAppHeaderCfgValid(Integer isValid, String ids, Integer functionId) { + appCfgService.updateAppHeaderCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/headerCfgList?functionId=" + functionId; } - + /** * 主题网站配置列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"topicDomainCfgList"}) - public String TopicDomainCfgList(Model model,@ModelAttribute("cfg")AppTopicDomainCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "topicDomainCfgList" }) + public String TopicDomainCfgList(Model model, @ModelAttribute("cfg") AppTopicDomainCfg cfg, + HttpServletRequest request, HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppTopicDomainList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appTopicDomainCfgList"; } + /** * * 获取服务与主题关系表中的域名 + * * @param websiteDomainTopic * @param response * @return */ @ResponseBody - @RequestMapping(value = "WebsiteDomainTopicList",method=RequestMethod.GET) - public List> WebsiteDomainTopicList(@ModelAttribute("websiteDomainTopic")WebsiteDomainTopic websiteDomainTopic,@RequestParam("websiteServiceId") Long websiteServiceId,@RequestParam("topicId") Long topicId,HttpServletResponse response){ + @RequestMapping(value = "WebsiteDomainTopicList", method = RequestMethod.GET) + public List> WebsiteDomainTopicList( + @ModelAttribute("websiteDomainTopic") WebsiteDomainTopic websiteDomainTopic, + @RequestParam("websiteServiceId") Long websiteServiceId, @RequestParam("topicId") Long topicId, + HttpServletResponse response) { List> mapList = Lists.newArrayList(); - if(websiteServiceId!=null&&topicId!=null){ + if (websiteServiceId != null && topicId != null) { List list = appCfgService.getDomainDict(websiteDomainTopic); - if(list!=null&&list.size()>0){ + if (list != null && list.size() > 0) { for (WebsiteDomainTopic domain : list) { Map map = Maps.newHashMap(); - map.put("domain",domain.getDomain()); - map.put("domainId",domain.getId()); - + map.put("domain", domain.getDomain()); + map.put("domainId", domain.getId()); + mapList.add(map); } } } return mapList; } + /** * app主题网站配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"topicDomainCfgForm"}) - @RequiresPermissions(value={"app:topic:config"}) - public String topicDomainCfgForm(Model model,String ids,@ModelAttribute("_cfg")AppTopicDomainCfg entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "topicDomainCfgForm" }) + @RequiresPermissions(value = { "app:topic:config" }) + public String topicDomainCfgForm(Model model, String ids, @ModelAttribute("_cfg") AppTopicDomainCfg entity) { + if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(ids)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appTopicDomainCfgForm"; } -/** + + /** * app主题网站配置新增修改 + * * @param model * @param request * @param response @@ -1339,52 +1420,56 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppTopicDomainCfg"}) - @RequiresPermissions(value={"app:topic:config"}) - public String saveAppTopicDomainCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppTopicDomainCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppTopicDomainCfg" }) + @RequiresPermissions(value = { "app:topic:config" }) + public String saveAppTopicDomainCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppTopicDomainCfg entity, RedirectAttributes redirectAttributes) { try { - //验证域名的重复行 - if(!StringUtil.isBlank(entity.getCfgKeywords())){ + // 验证域名的重复行 + if (!StringUtil.isBlank(entity.getCfgKeywords())) { WebsiteDomainTopic websiteDomainTopic = new WebsiteDomainTopic(); websiteDomainTopic.setDomain(entity.getCfgKeywords()); List domainDict = appCfgService.getDomainDict(websiteDomainTopic); - if((domainDict==null || domainDict.size()==0)){ - //保存到域名关联表中 - if(entity!=null&&entity.getWebsiteServiceId()!=null&&entity.getTopicId()!=null){ + if ((domainDict == null || domainDict.size() == 0)) { + // 保存到域名关联表中 + if (entity != null && entity.getWebsiteServiceId() != null && entity.getTopicId() != null) { websiteDomainTopic.setWebsiteServiceId(entity.getWebsiteServiceId()); websiteDomainTopic.setTopicId(entity.getTopicId()); websiteDomainTopic.setCreateTime(new Date()); websiteDomainTopic.setCreatorId(Integer.valueOf(UserUtils.getUser().getId().toString())); websiteDomainTopic.setIsValid(Constants.VALID_YES); appCfgService.saveDomainDict(websiteDomainTopic); - }else{ - addMessage(redirectAttributes,"error","save_failed"); - return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+entity.getFunctionId(); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + return "redirect:" + adminPath + "/app/topicDomainCfgList?functionId=" + entity.getFunctionId(); } } } - if(entity!=null&&StringUtil.isBlank(entity.getCfgKeywords())&&!StringUtil.isBlank(entity.getCfgKeywords())){ + if (entity != null && StringUtil.isBlank(entity.getCfgKeywords()) + && !StringUtil.isBlank(entity.getCfgKeywords())) { entity.setCfgKeywords(entity.getCfgKeywords()); } appCfgService.saveOrUpdateAppTopicDomainCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.info("app主题网站配置下发失败:"+e.getMessage());; - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.info("app主题网站配置下发失败:" + e.getMessage()); + ; + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("app主题网站配置下发失败",e); - addMessage(redirectAttributes,"error","save_failed"); + logger.error("app主题网站配置下发失败", e); + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/topicDomainCfgList?functionId=" + entity.getFunctionId(); } + /** * domain配置审核 + * * @param isAudit * @param isValid * @param ids @@ -1392,20 +1477,15 @@ public class AppCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppTopicDomainCfg"}) -// @RequiresPermissions(value={"app:domain:confirm"}) - public String auditAppTopicDomainCfg(Model model,@ModelAttribute("cfg")AppTopicDomainCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + @RequestMapping(value = { "auditAppTopicDomainCfg" }) + // @RequiresPermissions(value={"app:domain:confirm"}) + public String auditAppTopicDomainCfg(Model model, @ModelAttribute("cfg") AppTopicDomainCfg cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppTopicDomainCfg entity = new AppTopicDomainCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -1413,500 +1493,648 @@ public class AppCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppTopicDomainCfg(entity,isAudit); - addMessage(redirectAttributes,"success","audit_success"); + appCfgService.auditAppTopicDomainCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("app主题网站配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app主题网站配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return TopicDomainCfgList(model, cfg, request, response); } - return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId; + return "redirect:" + adminPath + "/app/topicDomainCfgList?functionId=" + functionId; } + /** * 网站主题配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppTopicDomainCfgValid"}) - @RequiresPermissions(value={"app:topic:config"}) - public String updateAppTopicDomainCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "updateAppTopicDomainCfgValid" }) + @RequiresPermissions(value = { "app:topic:config" }) + public String updateAppTopicDomainCfgValid(Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { try { - appCfgService.updateAppTopicDomainCfgValid(isValid,ids,functionId); - addMessage(redirectAttributes,"success","delete_success"); + appCfgService.updateAppTopicDomainCfgValid(isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); } catch (Exception e) { - logger.error("app主题网站删除失败",e); - if(e instanceof MaatConvertException) { + logger.error("app主题网站删除失败", e); + if (e instanceof MaatConvertException) { e.printStackTrace(); - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { e.printStackTrace(); - addMessage(redirectAttributes,"error","delete_failed"); + addMessage(redirectAttributes, "error", "delete_failed"); } } - return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId; + return "redirect:" + adminPath + "/app/topicDomainCfgList?functionId=" + functionId; } - - - /**********************内置APP特征文件上传*******************************/ - @RequestMapping(value = {"/appBuiltinFeatureFileForm"}) - @RequiresPermissions(value={"app:built_in_file:config"}) - public String from(Model model, - HttpServletRequest request, - HttpServletResponse response, - String ids, - @ModelAttribute("cfg")AppBuiltInFeatureFile cfg - ,RedirectAttributes redirectAttributes){ - if(cfg == null){ - cfg=new AppBuiltInFeatureFile(); + + /********************** 内置APP特征文件上传 *******************************/ + @RequestMapping(value = { "/appBuiltinFeatureFileForm" }) + @RequiresPermissions(value = { "app:built_in_file:config" }) + public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") AppBuiltInFeatureFile cfg, RedirectAttributes redirectAttributes) { + if (cfg == null) { + cfg = new AppBuiltInFeatureFile(); } - if(!StringUtil.isEmpty(ids)){ - cfg = appBuiltInFeatureService.getAppBuiltInFeatureFile(Long.valueOf(ids),-1); + if (!StringUtil.isEmpty(ids)) { + cfg = appBuiltInFeatureService.getAppBuiltInFeatureFile(Long.valueOf(ids), -1); initFormCondition(model, cfg); model.addAttribute("isAdd", false); - }else{ + } else { initFormCondition(model, cfg); model.addAttribute("isAdd", true); } - + model.addAttribute("_cfg", cfg); return "/cfg/app/appBuiltinFeatureFileForm"; } - - @RequestMapping(value = {"/appBuiltinFeatureFileSaveOrUpdate"}) - @RequiresPermissions(value={"app:built_in_file:config"}) - public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppBuiltInFeatureFile cfg, - MultipartFile file, - RedirectAttributes redirectAttributes){ - File fileD=null; - try{ - - if(file != null) { - String filename = file.getOriginalFilename(); - String prefix = FileUtils.getPrefix(filename, false); - String suffix = FileUtils.getSuffix(filename, false); - fileD = File.createTempFile("file_"+ prefix, suffix); - file.transferTo(fileD);//复制文件 - String md5 = FileUtils.getFileMD5(fileD); - Map srcMap = Maps.newHashMap(); - srcMap.put("filetype", suffix); - srcMap.put("datatype", "dbSystem");//源文件存入数据中心 - srcMap.put("createTime",new Date()); - srcMap.put("key",prefix); - srcMap.put("fileName", filename); - srcMap.put("checksum", md5); - ToMaatResult result = ConfigServiceUtil.postFileCfg(null, fileD, JsonMapper.toJsonString(srcMap)); - logger.info("APP 内置特征 文件上传响应信息:"+JsonMapper.toJsonString(result)); - String accessUrl = null; - if(!StringUtil.isEmpty(result)){ - ResponseData data = result.getData(); - accessUrl=data.getAccessUrl(); - cfg.setFilePath(accessUrl);; - } - } - appBuiltInFeatureService.saveOrUpdate(cfg); - - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ + + @RequestMapping(value = { "/appBuiltinFeatureFileSaveOrUpdate" }) + @RequiresPermissions(value = { "app:built_in_file:config" }) + public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppBuiltInFeatureFile cfg, MultipartFile file, + RedirectAttributes redirectAttributes) { + File fileD = null; + try { + + if (file != null) { + String filename = file.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + fileD = File.createTempFile("file_" + prefix, suffix); + file.transferTo(fileD);// 复制文件 + String md5 = FileUtils.getFileMD5(fileD); + Map srcMap = Maps.newHashMap(); + srcMap.put("filetype", suffix); + srcMap.put("datatype", "dbSystem");// 源文件存入数据中心 + srcMap.put("createTime", new Date()); + srcMap.put("key", prefix); + srcMap.put("fileName", filename); + srcMap.put("checksum", md5); + ToMaatResult result = ConfigServiceUtil.postFileCfg(null, fileD, JsonMapper.toJsonString(srcMap)); + logger.info("APP 内置特征 文件上传响应信息:" + JsonMapper.toJsonString(result)); + String accessUrl = null; + if (!StringUtil.isEmpty(result)) { + ResponseData data = result.getData(); + accessUrl = data.getAccessUrl(); + cfg.setFilePath(accessUrl); + ; + } + } + appBuiltInFeatureService.saveOrUpdate(cfg); + + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { e.printStackTrace(); - logger.error("appBuiltinFeatureFileSaveOrUpdate failed",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("appBuiltinFeatureFileSaveOrUpdate failed", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/appBuiltinFeatureFileList?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/app/appBuiltinFeatureFileList?functionId=" + cfg.getFunctionId(); } - - @RequestMapping(value = {"/appBuiltinFeatureFileList"}) - public String list(Model model,HttpServletRequest request,HttpServletResponse response - ,@ModelAttribute("cfg")AppBuiltInFeatureFile entity - ,RedirectAttributes redirectAttributes){ - Page page = appBuiltInFeatureService.findPage(new Page(request, response,"r"), entity); + + @RequestMapping(value = { "/appBuiltinFeatureFileList" }) + public String list(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppBuiltInFeatureFile entity, RedirectAttributes redirectAttributes) { + Page page = appBuiltInFeatureService + .findPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); initPageCondition(model); return "/cfg/app/appBuiltinFeatureFileList"; } - - @RequestMapping(value = {"/appBuiltinFeatureFileDelete"}) - @RequiresPermissions(value={"app:built_in_file:config"}) - public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId - ,Model model,HttpServletRequest request - ,HttpServletResponse response - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(ids)){ - appBuiltInFeatureService.delete(isAudit,isValid,ids,functionId); + + @RequestMapping(value = { "/appBuiltinFeatureFileDelete" }) + @RequiresPermissions(value = { "app:built_in_file:config" }) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { + appBuiltInFeatureService.delete(isAudit, isValid, ids, functionId); } - - return "redirect:" + adminPath +"/app/appBuiltinFeatureFileList?functionId="+functionId; + + return "redirect:" + adminPath + "/app/appBuiltinFeatureFileList?functionId=" + functionId; } - - @RequestMapping(value = {"/audit"}) - @RequiresPermissions(value={"app:built_in_file:confirm"}) - public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId, + + @RequestMapping(value = { "/audit" }) + @RequiresPermissions(value = { "app:built_in_file:confirm" }) + public String audit(Integer isAudit, Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(ids)){ + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - appBuiltInFeatureService.audit(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + appBuiltInFeatureService.audit(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); logger.error("appBuiltinFeature audit failed", e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - + } - return "redirect:" + adminPath +"/app/appBuiltinFeatureFileList?functionId="+functionId; + return "redirect:" + adminPath + "/app/appBuiltinFeatureFileList?functionId=" + functionId; } + @ResponseBody @RequestMapping(value = "/validCfgId") public boolean validCfgId(Long cfgId) { - AppBuiltInFeatureFile dns=appBuiltInFeatureService.getAppBuiltInFeatureFile(cfgId,null); - if(dns == null ){ + AppBuiltInFeatureFile dns = appBuiltInFeatureService.getAppBuiltInFeatureFile(cfgId, null); + if (dns == null) { return false; - }else{ + } else { return true; } } - - //ip配置导出 - @RequestMapping(value = "exportIpAddr") - public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppPolicyCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=appCfgService.findAppByPolicyList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppPolicyList(pageInfo, entity); - ipLists=page.getList(); - } - - for(AppPolicyCfg policy:ipLists){ - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); - if(app!=null) { - policy.setSocialName(app.getSpecServiceName()); - } - } - //查找社交应用的所有有效二级特定服务 - SpecificServiceCfg second=new SpecificServiceCfg(); - for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { - if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { - second.setCfgType(Integer.parseInt(dict.getItemCode())); - break; - } - } - second.setIsValid(Constants.VALID_YES); - second.setIsLeaf(1); - List secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null); - //遍历,找到匹配项后将行为设置进去 - for(AppPolicyCfg policy:ipLists){ - if(policy.getBehavCode()==null) continue; - for(SpecificServiceCfg secondCfg:secondList) { - if(secondCfg.getSpecServiceCode()==null) continue; - if(secondCfg.getSpecServiceCode().intValue()==policy.getBehavCode().intValue()) { - policy.setBehavName(secondCfg.getSpecServiceName()); - break; - } - } - } - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_IP"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class); - classMap.put("NTC_IP", IpPortCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - String cfgIndexInfoNoExport=",encrypted_tunnel_behavior,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 subscribeInfoNoExport=",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,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_IP", ipPortInfoNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - for (AppPolicyCfg cfg : ipLists) { - AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg); - ipList.addAll(cfgIndexInfo.getIpPortList()); - subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); - } - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_IP", ipList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("ip addr export failed",e); - addMessage(redirectAttributes,"error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + + // ip配置导出 + @RequestMapping(value = "exportIpAddr") + public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppPolicyCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = appCfgService.findAppByPolicyList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppPolicyList(pageInfo, entity); + ipLists = page.getList(); } - - //top - @RequestMapping(value = "exportTop") - public void exportTop(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppTopicDomainCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=appCfgService.findAppByTopicDomainList(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppTopicDomainList(pageInfo, entity); - ipLists=page.getList(); - } - - for (int i = 0; i < ipLists.size(); i++) { - AppTopicDomainCfg appTop=ipLists.get(i); - appTop.setIsHex(appTop.getIsHexbin()); - appTop.setIsCaseInsenstive(appTop.getIsHexbin()); - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), AppTopicDomainCfg.class); - String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("top export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + + for (AppPolicyCfg policy : ipLists) { + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); + if (app != null) { + policy.setSocialName(app.getSpecServiceName()); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } - - //appIp配置导出 - @RequestMapping(value = "exportAppIp") - public void exportAppIp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppIpCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=appCfgService.findAppByIpList(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppIpList(pageInfo, entity); - ipLists=page.getList(); - } - - - for(AppIpCfg appIp:ipLists){ - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(appIp.getSpecServiceId()); - appIp.setAppName(app.getSpecServiceName()); - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), AppIpCfg.class); - String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(),ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("appIp export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + // 查找社交应用的所有有效二级特定服务 + SpecificServiceCfg second = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + second.setCfgType(Integer.parseInt(dict.getItemCode())); + break; } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } - - //appHttp配置导出 - @RequestMapping(value = "exportAppHttp") - public void exportAppHttp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppHttpCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=appCfgService.findAppByHttpList(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppHttpList(pageInfo, entity); - ipLists=page.getList(); - } - - for(AppHttpCfg http:ipLists){ - http.setIsHex(http.getIsHexbin()); - http.setIsCaseInsenstive(http.getIsHexbin()); - http.setCfgKeywords(Functions.replace(http.getCfgKeywords(), "***and***"," ")); - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(http.getSpecServiceId()); - http.setAppName(app.getSpecServiceName()); - } - - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), AppHttpCfg.class); - String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("http export failed",e); - addMessage(redirectAttributes,"error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); - } - - //appdomain配置导出 - @RequestMapping(value = "exportDomain") - public void exportDomain(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppDomainCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists= new ArrayList(); - if(!StringUtil.isEmpty(ids)){ - ipLists=appCfgService.findAppByDomainList(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppDomainList(pageInfo, entity); - ipLists=page.getList(); - } - for(AppDomainCfg domain:ipLists){ - domain.setIsHex(domain.getIsHexbin()); - domain.setIsCaseInsenstive(domain.getIsHexbin()); - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(domain.getSpecServiceId()); - domain.setAppName(app.getSpecServiceName()); - } - - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), AppDomainCfg.class); - String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("Domain export failed",e); - addMessage(redirectAttributes,"error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); - } - - //appssl配置导出 - @RequestMapping(value = "exportAppSsl") - public void exportAppSsl(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppSslCertCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists= new ArrayList(); - if(!StringUtil.isEmpty(ids)){ - ipLists=appCfgService.findAppBySslList(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppSslList(pageInfo, entity); - ipLists=page.getList(); + second.setIsValid(Constants.VALID_YES); + second.setIsLeaf(1); + List secondList = specificServiceCfgService.findAllSpecificServiceCfg(second, null); + // 遍历,找到匹配项后将行为设置进去 + for (AppPolicyCfg policy : ipLists) { + if (policy.getBehavCode() == null) + continue; + for (SpecificServiceCfg secondCfg : secondList) { + if (secondCfg.getSpecServiceCode() == null) + continue; + if (secondCfg.getSpecServiceCode().intValue() == policy.getBehavCode().intValue()) { + policy.setBehavName(secondCfg.getSpecServiceName()); + break; } - - for(AppSslCertCfg ssl:ipLists){ - ssl.setIsHex(ssl.getIsHexbin()); - ssl.setIsCaseInsenstive(ssl.getIsHexbin()); - ssl.setCfgKeywords(Functions.replace(ssl.getCfgKeywords(), "***and***"," ")); - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(ssl.getSpecServiceId()); - ssl.setAppName(app.getSpecServiceName()); - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), AppSslCertCfg.class); - String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(),ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("App ssl export failed",e); - addMessage(redirectAttributes,"error","export_failed"); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_IP"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class); + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + String cfgIndexInfoNoExport = ",encrypted_tunnel_behavior,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 subscribeInfoNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + for (AppPolicyCfg cfg : ipLists) { + AppPolicyCfg cfgIndexInfo = appCfgService.exportIpInfo(cfg); + ipList.addAll(cfgIndexInfo.getIpPortList()); + subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); + } + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("ip addr export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // top + @RequestMapping(value = "exportTop") + public void exportTop(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppTopicDomainCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = appCfgService.findAppByTopicDomainList(ids); + } else { + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppTopicDomainList(pageInfo, entity); + ipLists = page.getList(); + } + + for (int i = 0; i < ipLists.size(); i++) { + AppTopicDomainCfg appTop = ipLists.get(i); + appTop.setIsHex(appTop.getIsHexbin()); + appTop.setIsCaseInsenstive(appTop.getIsHexbin()); + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), AppTopicDomainCfg.class); + String cfgIndexInfoNoExport = ",letter,whether_area_block,classification,attribute,label,do_log,block_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("top export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // appIp配置导出 + @RequestMapping(value = "exportAppIp") + public void exportAppIp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppIpCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = appCfgService.findAppByIpList(ids); + } else { + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppIpList(pageInfo, entity); + ipLists = page.getList(); + } + + for (AppIpCfg appIp : ipLists) { + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(appIp.getSpecServiceId()); + appIp.setAppName(app.getSpecServiceName()); + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), AppIpCfg.class); + String cfgIndexInfoNoExport = ",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("appIp export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // appHttp配置导出 + @RequestMapping(value = "exportAppHttp") + public void exportAppHttp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppHttpCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = appCfgService.findAppByHttpList(ids); + } else { + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppHttpList(pageInfo, entity); + ipLists = page.getList(); + } + + for (AppHttpCfg http : ipLists) { + http.setIsHex(http.getIsHexbin()); + http.setIsCaseInsenstive(http.getIsHexbin()); + http.setCfgKeywords(Functions.replace(http.getCfgKeywords(), "***and***", " ")); + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(http.getSpecServiceId()); + http.setAppName(app.getSpecServiceName()); + } + + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), AppHttpCfg.class); + String cfgIndexInfoNoExport = ",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("http export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // appdomain配置导出 + @RequestMapping(value = "exportDomain") + public void exportDomain(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppDomainCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + if (!StringUtil.isEmpty(ids)) { + ipLists = appCfgService.findAppByDomainList(ids); + } else { + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppDomainList(pageInfo, entity); + ipLists = page.getList(); + } + for (AppDomainCfg domain : ipLists) { + domain.setIsHex(domain.getIsHexbin()); + domain.setIsCaseInsenstive(domain.getIsHexbin()); + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(domain.getSpecServiceId()); + domain.setAppName(app.getSpecServiceName()); + } + + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), AppDomainCfg.class); + String cfgIndexInfoNoExport = ",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("Domain export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // appssl配置导出 + @RequestMapping(value = "exportAppSsl") + public void exportAppSsl(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppSslCertCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + if (!StringUtil.isEmpty(ids)) { + ipLists = appCfgService.findAppBySslList(ids); + } else { + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppSslList(pageInfo, entity); + ipLists = page.getList(); + } + + for (AppSslCertCfg ssl : ipLists) { + ssl.setIsHex(ssl.getIsHexbin()); + ssl.setIsCaseInsenstive(ssl.getIsHexbin()); + ssl.setCfgKeywords(Functions.replace(ssl.getCfgKeywords(), "***and***", " ")); + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(ssl.getSpecServiceId()); + ssl.setAppName(app.getSpecServiceName()); + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), AppSslCertCfg.class); + String cfgIndexInfoNoExport = ",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("App ssl export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java index b1e3b7154..ef626a469 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java @@ -64,6 +64,7 @@ import com.nis.web.security.UserUtils; /** * 特定协议相关配置控制类 + * * @author zhangwei * */ @@ -72,48 +73,58 @@ import com.nis.web.security.UserUtils; public class AppFeatureCfgController extends BaseController { /** * app协议复杂特征配置列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"multiFeatureCfgList"}) - public String multiFeatureCfgList(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "multiFeatureCfgList" }) + public String multiFeatureCfgList(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg, + HttpServletRequest request, HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appMultiFeatureCfgService.findAppFeatureIndexList(searchPage, cfg); - for(AppFeatureIndex entity:page.getList()){ + for (AppFeatureIndex entity : page.getList()) { SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); entity.setAppName(app.getSpecServiceName()); } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/app/appMultiFeatureCfgList"; } + /** * 特征配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"multiFeatureCfgForm"}) - public String multiFeatureCfgForm(Model model,String ids,AppFeatureIndex entity) { - if(StringUtils.isNotBlank(ids)){ + @RequestMapping(value = { "multiFeatureCfgForm" }) + public String multiFeatureCfgForm(Model model, String ids, AppFeatureIndex entity) { + if (StringUtils.isNotBlank(ids)) { entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(ids)); - entity.setIpPortList(appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId())); - entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null)); - entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null)); - entity.setNumCfgList(appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(),null)); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + entity.setIpPortList( + appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId())); + entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(), + entity.getFunctionId(), null)); + entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(), + entity.getFunctionId(), null)); + entity.setNumCfgList( + appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(), null)); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/app/appMultiFeatureCfgForm"; } + /** * 特征配置新增修改 + * * @param model * @param request * @param response @@ -121,29 +132,32 @@ public class AppFeatureCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"saveAppMultiFeatureCfg"}) - public String saveAppMultiFeatureCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppFeatureIndex entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "saveAppMultiFeatureCfg" }) + public String saveAppMultiFeatureCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppFeatureIndex entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity); - addMessage(redirectAttributes,"success", "save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + entity.getFunctionId(); } + /** * 特征配置审核 + * * @param isAudit * @param isValid * @param ids @@ -151,19 +165,14 @@ public class AppFeatureCfgController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"auditAppFeatureCfg"}) - public String auditAppFeatureCfg(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + @RequestMapping(value = { "auditAppFeatureCfg" }) + public String auditAppFeatureCfg(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppFeatureIndex entity = new AppFeatureIndex(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); @@ -171,247 +180,264 @@ public class AppFeatureCfgController extends BaseController { entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appMultiFeatureCfgService.auditAppFeatureCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); - logger.error("app 特征配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "request_service_failed"); + logger.error("app 特征配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { e.printStackTrace(); - logger.error("app 特征配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("app 特征配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "audit_failed"); } } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return multiFeatureCfgList(model, cfg, request, response); } - - return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+functionId; + + return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId; } + /** * 特征配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateAppFeatureCfgValid"}) - public String updateAppFeatureCfgValid(Integer isValid,String ids,Integer functionId) { - appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+functionId; + @RequestMapping(value = { "updateAppFeatureCfgValid" }) + public String updateAppFeatureCfgValid(Integer isValid, String ids, Integer functionId) { + appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId; } - + /** * 查询特征子配置 + * * @param model * @param cfgId * @param index * @return */ - @RequestMapping(value = {"ajaxAppFeatureList"}) - public String ajaxAppFeatureList(Model model,Long cfgId,Integer compileId,Integer functionId,Integer index) { - List ipRangeList = appMultiFeatureCfgService.getAppIpRangeCfg(compileId,functionId); + @RequestMapping(value = { "ajaxAppFeatureList" }) + public String ajaxAppFeatureList(Model model, Long cfgId, Integer compileId, Integer functionId, Integer index) { + List ipRangeList = appMultiFeatureCfgService.getAppIpRangeCfg(compileId, functionId); AppFeatureIndex cfg = appMultiFeatureCfgService.getAppFeatureIndex(cfgId); - List> tabList = new ArrayList(); + List> tabList = new ArrayList(); String[] cfgRegionValue = cfg.getCfgRegionValue().split(","); String[] cfgRegionType = cfg.getCfgRegionType().split(","); String[] cfgRegionCode = cfg.getCfgRegionCode1().split(","); - if(cfgRegionValue.length == cfgRegionType.length && cfgRegionValue.length==cfgRegionCode.length){ - for(int i=0;i map = new HashMap(); + if (cfgRegionValue.length == cfgRegionType.length && cfgRegionValue.length == cfgRegionCode.length) { + for (int i = 0; i < cfgRegionValue.length; i++) { + Map map = new HashMap(); map.put("regionType", cfgRegionType[i]); map.put("regionValue", cfgRegionValue[i]); - if("1".equals(cfgRegionType[i])){ + if ("1".equals(cfgRegionType[i])) { map.put("ipRangeList", ipRangeList); } - if("2".equals(cfgRegionType[i])){ - List strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i])); + if ("2".equals(cfgRegionType[i])) { + List strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId, + functionId, Integer.valueOf(cfgRegionCode[i])); map.put("strList", strList); } - if("3".equals(cfgRegionType[i])){ - List complexList = appMultiFeatureCfgService.getAppComplexFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i])); + if ("3".equals(cfgRegionType[i])) { + List complexList = appMultiFeatureCfgService + .getAppComplexFeatureCfg(compileId, functionId, Integer.valueOf(cfgRegionCode[i])); map.put("complexList", complexList); } - if("4".equals(cfgRegionType[i])){ - List numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i])); + if ("4".equals(cfgRegionType[i])) { + List numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId, functionId, + Integer.valueOf(cfgRegionCode[i])); map.put("numCfgList", numCfgList); } tabList.add(map); } - }else{ - Map map = new HashMap(); + } else { + Map map = new HashMap(); map.put("regionType", "0"); map.put("regionValue", "query config detail error"); tabList.add(map); } - - /*if(ipRangeList!=null){ - String cfgType = null; - for(AppIpCfg ip:ipRangeList){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); - cfgType = ip.getCfgType(); - } - } - } - if(strList!=null){ - String cfgType = null; - for(AppStringFeatureCfg cfg:strList){ - if(!cfg.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",cfg.getCfgType()}); - cfgType = cfg.getCfgType(); - } - } - } - if(complexList!=null){ - String cfgType = null; - for(AppComplexFeatureCfg cfg:complexList){ - if(!cfg.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"3",cfg.getCfgType()}); - cfgType = cfg.getCfgType();0. - - } - } - }*/ + + /* + * if(ipRangeList!=null){ String cfgType = null; for(AppIpCfg + * ip:ipRangeList){ if(!ip.getCfgType().equals(cfgType)){ + * tabList.add(new String[]{"1",ip.getCfgType()}); cfgType = + * ip.getCfgType(); } } } if(strList!=null){ String cfgType = null; + * for(AppStringFeatureCfg cfg:strList){ + * if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new + * String[]{"2",cfg.getCfgType()}); cfgType = cfg.getCfgType(); } } } + * if(complexList!=null){ String cfgType = null; + * for(AppComplexFeatureCfg cfg:complexList){ + * if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new + * String[]{"3",cfg.getCfgType()}); cfgType = cfg.getCfgType();0. + * + * } } } + */ model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/app/appSubFeatureList"; } - - //appfeature配置导出 + + // appfeature配置导出 @RequestMapping(value = "exportFeature") - public void exportFeature(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppFeatureIndex entity,String ids,RedirectAttributes redirectAttributes){ + public void exportFeature(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppFeatureIndex entity, String ids, RedirectAttributes redirectAttributes) { try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=appMultiFeatureCfgService.findAppByFeatureIndexList(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = appMultiFeatureCfgService.findAppByFeatureIndexList(ids); + } else { + Page pageInfo = new Page(request, response, "r"); pageInfo.setPageNo(1); pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); Page page = appMultiFeatureCfgService.findAppFeatureIndexList(pageInfo, entity); - ipLists=page.getList(); + ipLists = page.getList(); } - - for(AppFeatureIndex feature:ipLists){ - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId()); - feature.setAppName(app.getSpecServiceName()); + + for (AppFeatureIndex feature : ipLists) { + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId()); + feature.setAppName(app.getSpecServiceName()); + } + String cfgIndexInfoNoExport = ",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String appComplexNoExport = ",do_log,block_type,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,"; + String ipPortInfoNoExport = ",do_log,block_type,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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class); + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + List ipList = new ArrayList(); + List keywordList = new ArrayList(); + List strList = new ArrayList(); + for (AppFeatureIndex cfg : ipLists) { + Map maps = appMultiFeatureCfgService.exportFeature(cfg); + if (entity.getFunctionId() != 567) { + keywordList.addAll(maps.get("APP_KEYWORDS")); + } else { + strList.addAll(maps.get("APP_DK_GL")); } - String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - String appComplexNoExport=",do_log,block_type,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,"; - String ipPortInfoNoExport=",do_log,block_type,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,"; - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class); - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - List ipList=new ArrayList(); - List keywordList=new ArrayList(); - List strList=new ArrayList(); - for (AppFeatureIndex cfg : ipLists) { - Map maps=appMultiFeatureCfgService.exportFeature(cfg); - if(entity.getFunctionId()!=567){ - keywordList.addAll(maps.get("APP_KEYWORDS")); - }else{ - strList.addAll(maps.get("APP_DK_GL")); - } - ipList.addAll(maps.get("APP_IP_RANGE")); - } - dataMap.put(entity.getMenuNameCode(), ipLists); - if(entity.getFunctionId()!=564 && entity.getFunctionId()!=567 ){ - keywordList=replaceKeyList(keywordList); - titleList.add("APP_IP_RANGE"); - classMap.put("APP_IP_RANGE", IpPortCfg.class); - noExportMap.put("APP_IP_RANGE",ipPortInfoNoExport); - dataMap.put("APP_IP_RANGE", ipList); - } - if(entity.getFunctionId()==563){ - titleList.add("APP_PAYLOAD"); - classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class); - noExportMap.put("APP_PAYLOAD",appComplexNoExport); - dataMap.put("APP_PAYLOAD", keywordList); - }else if(entity.getFunctionId()==565){ - titleList.add("APP_HTTP"); - classMap.put("APP_HTTP", AppComplexFeatureCfg.class); - noExportMap.put("APP_HTTP",appComplexNoExport); - dataMap.put("APP_HTTP", keywordList); - }else if(entity.getFunctionId()==566){ - titleList.add("APP_SSL"); - classMap.put("APP_SSL", AppComplexFeatureCfg.class); - noExportMap.put("APP_SSL",appComplexNoExport); - dataMap.put("APP_SSL", keywordList); - }else if(entity.getFunctionId()==564){ - keywordList=replaceKeyList(keywordList); - titleList.add("APP_DNS"); - classMap.put("APP_DNS", AppComplexFeatureCfg.class); - noExportMap.put("APP_DNS",appComplexNoExport); - dataMap.put("APP_DNS", keywordList); - }else if(entity.getFunctionId()==567){ - strList=replaceFeatureList(strList); - appComplexNoExport=appComplexNoExport+"district,"; - titleList.add("APP_DK"); - classMap.put("APP_DK", AppStringFeatureCfg.class); - noExportMap.put("APP_DK",appComplexNoExport); - dataMap.put("APP_DK", strList); - } - - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + ipList.addAll(maps.get("APP_IP_RANGE")); + } + dataMap.put(entity.getMenuNameCode(), ipLists); + if (entity.getFunctionId() != 564 && entity.getFunctionId() != 567) { + keywordList = replaceKeyList(keywordList); + titleList.add("APP_IP_RANGE"); + classMap.put("APP_IP_RANGE", IpPortCfg.class); + noExportMap.put("APP_IP_RANGE", ipPortInfoNoExport); + dataMap.put("APP_IP_RANGE", ipList); + } + if (entity.getFunctionId() == 563) { + titleList.add("APP_PAYLOAD"); + classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class); + noExportMap.put("APP_PAYLOAD", appComplexNoExport); + dataMap.put("APP_PAYLOAD", keywordList); + } else if (entity.getFunctionId() == 565) { + titleList.add("APP_HTTP"); + classMap.put("APP_HTTP", AppComplexFeatureCfg.class); + noExportMap.put("APP_HTTP", appComplexNoExport); + dataMap.put("APP_HTTP", keywordList); + } else if (entity.getFunctionId() == 566) { + titleList.add("APP_SSL"); + classMap.put("APP_SSL", AppComplexFeatureCfg.class); + noExportMap.put("APP_SSL", appComplexNoExport); + dataMap.put("APP_SSL", keywordList); + } else if (entity.getFunctionId() == 564) { + keywordList = replaceKeyList(keywordList); + titleList.add("APP_DNS"); + classMap.put("APP_DNS", AppComplexFeatureCfg.class); + noExportMap.put("APP_DNS", appComplexNoExport); + dataMap.put("APP_DNS", keywordList); + } else if (entity.getFunctionId() == 567) { + strList = replaceFeatureList(strList); + appComplexNoExport = appComplexNoExport + "district,"; + titleList.add("APP_DK"); + classMap.put("APP_DK", AppStringFeatureCfg.class); + noExportMap.put("APP_DK", appComplexNoExport); + dataMap.put("APP_DK", strList); + } + + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } } catch (Exception e) { - logger.error("Appfeature export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + logger.error("Appfeature export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } - - public static List replaceKeyList(List list){ + + public static List replaceKeyList(List list) { for (int i = 0; i < list.size(); i++) { - AppComplexFeatureCfg base=(AppComplexFeatureCfg)list.get(i); + AppComplexFeatureCfg base = (AppComplexFeatureCfg) list.get(i); base.setIsHex(base.getIsHexbin()); base.setIsCaseInsenstive(base.getIsHexbin()); - base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," ")); - } + base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***", " ")); + } return list; } - - public static List replaceFeatureList(List list){ + + public static List replaceFeatureList(List list) { for (int i = 0; i < list.size(); i++) { - AppStringFeatureCfg base=(AppStringFeatureCfg)list.get(i); + AppStringFeatureCfg base = (AppStringFeatureCfg) list.get(i); base.setIsHex(base.getIsHexbin()); base.setIsCaseInsenstive(base.getIsHexbin()); - base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," ")); - } + base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***", " ")); + } return list; } - - + } diff --git a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java index 03f8275f5..8a4456ec6 100644 --- a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java +++ b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java @@ -35,6 +35,7 @@ import com.nis.web.security.UserUtils; /** * 基础协议控制类 + * * @author wx * */ @@ -43,52 +44,57 @@ import com.nis.web.security.UserUtils; public class BasicProtocolController extends BaseController { /** * app策略列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"list"}) - public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "list" }) + public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppPolicyList(searchPage, cfg); -// for(AppPolicyCfg entity:page.getList()){ -// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); -// if(app!=null) { -// entity.setAppName(app.getSpecServiceName()); -// } -// -// } + // for(AppPolicyCfg entity:page.getList()){ + // SpecificServiceCfg app = + // specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + // if(app!=null) { + // entity.setAppName(app.getSpecServiceName()); + // } + // + // } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/basicprotocol/list"; } + /** * 查询APP策略IP子配置 + * * @param model * @param cfgId * @param index * @return */ - @RequestMapping(value = {"ajaxIpList"}) - public String ajaxSslSubList(Model model,Long cfgId,Integer index,Integer compileId) { - AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId,compileId); + @RequestMapping(value = { "ajaxIpList" }) + public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) { + AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ - if(!ntc.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ntc.getCfgType()}); + for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) { + if (!ntc.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ntc.getCfgType() }); cfgType = ntc.getCfgType(); } } @@ -98,27 +104,31 @@ public class BasicProtocolController extends BaseController { model.addAttribute("tabList", tabList); return "/cfg/basicprotocol/basicProtocolSubList"; } + /** * 策略配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"form"}) - @RequiresPermissions(value={"basicprotocol:config"}) - public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) { - if(StringUtils.isNotBlank(ids)){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + @RequestMapping(value = { "form" }) + @RequiresPermissions(value = { "basicprotocol:config" }) + public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) { + if (StringUtils.isNotBlank(ids)) { + entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/basicprotocol/form"; } + /** * 策略配置新增修改 + * * @param model * @param request * @param response @@ -126,34 +136,37 @@ public class BasicProtocolController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"save"}) - @RequiresPermissions(value={"basicprotocol:config"}) - public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppPolicyCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "save" }) + @RequiresPermissions(value = { "basicprotocol:config" }) + public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppPolicyCfg entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppPolicyCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("基础协议信息保存失败",e); - if(e instanceof MaatConvertException) { -// addMessage(redirectAttributes,e.getMessage()); - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("基础协议信息保存失败", e); + if (e instanceof MaatConvertException) { + // addMessage(redirectAttributes,e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/basicprotocol/list?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + entity.getFunctionId(); } + /** * 策略配置审核 + * * @param isAudit * @param isValid * @param ids @@ -161,21 +174,16 @@ public class BasicProtocolController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"audit"}) - @RequiresPermissions(value={"basicprotocol:confirm"}) - public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + @RequestMapping(value = { "audit" }) + @RequiresPermissions(value = { "basicprotocol:confirm" }) + public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppPolicyCfg entity = new AppPolicyCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -183,138 +191,167 @@ public class BasicProtocolController extends BaseController { entity.setFunctionId(functionId); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL); try { - appCfgService.auditAppPolicyCfg(entity,isAudit); - addMessage(redirectAttributes,"success","audit_success"); + appCfgService.auditAppPolicyCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.info("app策略配置下发失败:"+e.getMessage());; - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.info("app策略配置下发失败:" + e.getMessage()); + ; + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("app策略配置下发失败",e); - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("app策略配置下发失败", e); + addMessage(redirectAttributes, "error", "audit_failed"); } - + } } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return policyCfgList(model, cfg, request, response); } - return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId; + return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + functionId; } + /** * 策略配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateValid"}) - @RequiresPermissions(value={"basicprotocol:config"}) - public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "updateValid" }) + @RequiresPermissions(value = { "basicprotocol:config" }) + public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { try { - appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId); - addMessage(redirectAttributes,"success","delete_success"); + appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); } catch (Exception e) { - logger.error("基础协议信息保存失败",e); - if(e instanceof MaatConvertException) { + logger.error("基础协议信息保存失败", e); + if (e instanceof MaatConvertException) { e.printStackTrace(); - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { e.printStackTrace(); - addMessage(redirectAttributes,"error","delete_failed"); + addMessage(redirectAttributes, "error", "delete_failed"); } } - return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId; + return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + functionId; } - - //ip配置导出 - @RequestMapping(value = "exportIpAddr") - public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppPolicyCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=appCfgService.findAppByPolicyList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppPolicyList(pageInfo, entity); - ipLists=page.getList(); - } - for(AppPolicyCfg policy:ipLists){ - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); - if(app!=null) { - policy.setAppName(app.getSpecServiceName()); - } - - } - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_IP"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class); - classMap.put("NTC_IP", IpPortCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - String cfgIndexInfoNoExport=",encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 subscribeInfoNoExport=",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,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_IP", ipPortInfoNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - for (AppPolicyCfg cfg : ipLists) { - AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg); - ipList.addAll(cfgIndexInfo.getIpPortList()); - subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); - } - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_IP", ipList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("ip addr export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + + // ip配置导出 + @RequestMapping(value = "exportIpAddr") + public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppPolicyCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = appCfgService.findAppByPolicyList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppPolicyList(pageInfo, entity); + ipLists = page.getList(); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + for (AppPolicyCfg policy : ipLists) { + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); + if (app != null) { + policy.setAppName(app.getSpecServiceName()); + } + + } + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_IP"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class); + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + String cfgIndexInfoNoExport = ",encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 subscribeInfoNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + for (AppPolicyCfg cfg : ipLists) { + AppPolicyCfg cfgIndexInfo = appCfgService.exportIpInfo(cfg); + ipList.addAll(cfgIndexInfo.getIpPortList()); + subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); + } + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("ip addr export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + } diff --git a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java index 1144e00b4..27b5b6e4f 100644 --- a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java +++ b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java @@ -37,6 +37,7 @@ import com.nis.web.security.UserUtils; /** * 加密隧道行为控制类 + * * @author wx * */ @@ -45,103 +46,117 @@ import com.nis.web.security.UserUtils; public class EncryptedTunnelBehaviorController extends BaseController { /** * app策略列表 + * * @param model * @param cfg * @param request * @param response * @return */ - @RequestMapping(value = {"list"}) - public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"r"); + @RequestMapping(value = { "list" }) + public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppPolicyList(searchPage, cfg); -// for(AppPolicyCfg entity:page.getList()){ -// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); -// if(app!=null) { -// entity.setAppName(app.getSpecServiceName()); -// } -// } -// //查找社交应用的所有有效二级特定服务 -// SpecificServiceCfg second=new SpecificServiceCfg(); -// for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { -// if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) { -// second.setCfgType(Integer.parseInt(dict.getItemCode())); -// break; -// } -// } -// second.setIsValid(Constants.VALID_YES); -// second.setIsLeaf(1); -// List secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null); -// //遍历,找到匹配项后将行为设置进去 -// for(AppPolicyCfg entity:page.getList()){ -// if(entity.getBehavCode()==null) continue; -// for(SpecificServiceCfg secondCfg:secondList) { -// if(secondCfg.getSpecServiceCode()==null) continue; -// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) { -// entity.setBehavName(secondCfg.getSpecServiceName()); -// break; -// } -// } -// } + // for(AppPolicyCfg entity:page.getList()){ + // SpecificServiceCfg app = + // specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + // if(app!=null) { + // entity.setAppName(app.getSpecServiceName()); + // } + // } + // //查找社交应用的所有有效二级特定服务 + // SpecificServiceCfg second=new SpecificServiceCfg(); + // for(SysDataDictionaryItem + // dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + // if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) + // { + // second.setCfgType(Integer.parseInt(dict.getItemCode())); + // break; + // } + // } + // second.setIsValid(Constants.VALID_YES); + // second.setIsLeaf(1); + // List + // secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, + // null); + // //遍历,找到匹配项后将行为设置进去 + // for(AppPolicyCfg entity:page.getList()){ + // if(entity.getBehavCode()==null) continue; + // for(SpecificServiceCfg secondCfg:secondList) { + // if(secondCfg.getSpecServiceCode()==null) continue; + // if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) + // { + // entity.setBehavName(secondCfg.getSpecServiceName()); + // break; + // } + // } + // } model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/encryptedtunnelbehav/list"; } + /** * 查询APP策略IP子配置 + * * @param model * @param cfgId * @param index * @return */ - @RequestMapping(value = {"ajaxIpList"}) - public String ajaxSslSubList(Model model,Long cfgId,Integer index,Integer compileId) { - AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId,compileId); + @RequestMapping(value = { "ajaxIpList" }) + public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) { + AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ - if(!ntc.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ntc.getCfgType()}); + for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) { + if (!ntc.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ntc.getCfgType() }); cfgType = ntc.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/encryptedtunnelbehav/encrypedTunnelSubList"; } + /** * 策略配置表单 + * * @param model * @param ids * @param entity * @return */ - @RequestMapping(value = {"form"}) - @RequiresPermissions(value={"encryptedtunnelbehav:config"}) - public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) { - if(StringUtils.isNotBlank(ids)){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + @RequestMapping(value = { "form" }) + @RequiresPermissions(value = { "encryptedtunnelbehav:config" }) + public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) { + if (StringUtils.isNotBlank(ids)) { + entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/encryptedtunnelbehav/form"; } + /** * 策略配置新增修改 + * * @param model * @param request * @param response @@ -149,33 +164,36 @@ public class EncryptedTunnelBehaviorController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"save"}) - @RequiresPermissions(value={"encryptedtunnelbehav:config"}) - public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response, - AppPolicyCfg entity,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "save" }) + @RequiresPermissions(value = { "encryptedtunnelbehav:config" }) + public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response, + AppPolicyCfg entity, RedirectAttributes redirectAttributes) { try { - SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(specificService!=null){ + SpecificServiceCfg specificService = specificServiceCfgService + .getBySpecServiceId(entity.getSpecServiceId()); + if (specificService != null) { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppPolicyCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("加密隧道信息保存失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("加密隧道信息保存失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + entity.getFunctionId(); } + /** * 策略配置审核 + * * @param isAudit * @param isValid * @param ids @@ -183,21 +201,16 @@ public class EncryptedTunnelBehaviorController extends BaseController { * @param redirectAttributes * @return */ - @RequestMapping(value = {"audit"}) - @RequiresPermissions(value={"encryptedtunnelbehav:confirm"}) - public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + @RequestMapping(value = { "audit" }) + @RequiresPermissions(value = { "encryptedtunnelbehav:confirm" }) + public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { AppPolicyCfg entity = new AppPolicyCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -205,157 +218,187 @@ public class EncryptedTunnelBehaviorController extends BaseController { entity.setFunctionId(functionId); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR); try { - appCfgService.auditAppPolicyCfg(entity,isAudit); - addMessage(redirectAttributes,"success","audit_success"); + appCfgService.auditAppPolicyCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.info("加密隧道配置下发失败:"+e.getMessage());; - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.info("加密隧道配置下发失败:" + e.getMessage()); + ; + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("加密隧道配置下发失败",e); - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("加密隧道配置下发失败", e); + addMessage(redirectAttributes, "error", "audit_failed"); } } } - - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return policyCfgList(model, cfg, request, response); } - - return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId; + + return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + functionId; } + /** * 策略配置删除 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateValid"}) - @RequiresPermissions(value={"encryptedtunnelbehav:config"}) - public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "updateValid" }) + @RequiresPermissions(value = { "encryptedtunnelbehav:config" }) + public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { try { - appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId); + appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId); } catch (Exception e) { - logger.error("加密隧道协议保存失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","delete_failed"); + logger.error("加密隧道协议保存失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "delete_failed"); } } - return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId; + return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + functionId; } - - //ip配置导出 + + // ip配置导出 @RequestMapping(value = "exportIpAddr") - public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AppPolicyCfg entity,String ids,RedirectAttributes redirectAttributes){ + public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AppPolicyCfg entity, String ids, RedirectAttributes redirectAttributes) { try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=appCfgService.findAppByPolicyList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppPolicyList(pageInfo, entity); - ipLists=page.getList(); + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = appCfgService.findAppByPolicyList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppPolicyList(pageInfo, entity); + ipLists = page.getList(); + } + for (AppPolicyCfg policy : ipLists) { + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); + if (app != null) { + policy.setBehaviorName(app.getSpecServiceName()); } - for(AppPolicyCfg policy:ipLists){ - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); - if(app!=null) { - policy.setBehaviorName(app.getSpecServiceName()); - } + } + // 查找社交应用的所有有效二级特定服务 + SpecificServiceCfg second = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) { + second.setCfgType(Integer.parseInt(dict.getItemCode())); + break; } - //查找社交应用的所有有效二级特定服务 - SpecificServiceCfg second=new SpecificServiceCfg(); - for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { - if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) { - second.setCfgType(Integer.parseInt(dict.getItemCode())); + } + second.setIsValid(Constants.VALID_YES); + second.setIsLeaf(1); + List secondList = specificServiceCfgService.findAllSpecificServiceCfg(second, null); + // 遍历,找到匹配项后将行为设置进去 + for (AppPolicyCfg policy : ipLists) { + if (policy.getBehavCode() == null) + continue; + for (SpecificServiceCfg secondCfg : secondList) { + if (secondCfg.getSpecServiceCode() == null) + continue; + if (secondCfg.getSpecServiceCode().intValue() == policy.getBehavCode().intValue()) { + policy.setBehavName(secondCfg.getSpecServiceName()); break; } } - second.setIsValid(Constants.VALID_YES); - second.setIsLeaf(1); - List secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null); - //遍历,找到匹配项后将行为设置进去 - for(AppPolicyCfg policy:ipLists){ - if(policy.getBehavCode()==null) continue; - for(SpecificServiceCfg secondCfg:secondList) { - if(secondCfg.getSpecServiceCode()==null) continue; - if(secondCfg.getSpecServiceCode().intValue()==policy.getBehavCode().intValue()) { - policy.setBehavName(secondCfg.getSpecServiceName()); - break; - } - } - } - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_IP"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class); - classMap.put("NTC_IP", IpPortCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - String cfgIndexInfoNoExport=",social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 subscribeInfoNoExport=",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,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_IP", ipPortInfoNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - for (AppPolicyCfg cfg : ipLists) { - AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg); - ipList.addAll(cfgIndexInfo.getIpPortList()); - subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); - } - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_IP", ipList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + } + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_IP"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class); + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + String cfgIndexInfoNoExport = ",social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 subscribeInfoNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + for (AppPolicyCfg cfg : ipLists) { + AppPolicyCfg cfgIndexInfo = appCfgService.exportIpInfo(cfg); + ipList.addAll(cfgIndexInfo.getIpPortList()); + subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); + } + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } } catch (Exception e) { - logger.error("TunnelBehavior export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + logger.error("TunnelBehavior export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } - } diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java index 76f7e971e..05da5f890 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java @@ -42,211 +42,231 @@ import com.nis.web.service.configuration.DnsIpCfgService; @Controller @RequestMapping("${adminPath}/cfg/dnsIp") public class DnsIpCfgController extends BaseController { - - @RequestMapping(value = {"/list"}) - public String list(Model model,HttpServletRequest request - ,HttpServletResponse response,@ModelAttribute("cfg")DnsIpCfg entity - ,RedirectAttributes redirectAttributes){ - Page page = dnsIpCfgService.findPage(new Page(request, response,"r"), entity); + + @RequestMapping(value = { "/list" }) + public String list(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DnsIpCfg entity, RedirectAttributes redirectAttributes) { + Page page = dnsIpCfgService.findPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/dnsIpCfgList"; } - @RequestMapping(value = {"/form"}) - @RequiresPermissions(value={"dns:fake:ip:config"}) - public String form(Model model,HttpServletRequest request - ,HttpServletResponse response,String ids,@ModelAttribute("cfg")DnsIpCfg cfg - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "/form" }) + @RequiresPermissions(value = { "dns:fake:ip:config" }) + public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { cfg = dnsIpCfgService.getDnsIpCfg(Long.parseLong(ids)); initUpdateFormCondition(model, cfg); - }else{ - initFormCondition(model,cfg); + } else { + initFormCondition(model, cfg); } - /*//获取所有响应策略信息 - List resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1); - model.addAttribute("dnsResStrategys", resStrategys);*/ - //查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组 - List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1); + /* + * //获取所有响应策略信息 List + * resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1); + * model.addAttribute("dnsResStrategys", resStrategys); + */ + // 查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组 + List policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(1); model.addAttribute("policyGroups", policyGroups); model.addAttribute("_cfg", cfg); return "/cfg/dnsIpCfgForm"; } - + /** * 初始化一条dns fakeip配置 + * * @return */ @ResponseBody - @RequestMapping(value = {"initSpoofingIp"}) - public String initSpoofingIp(){ - Properties msg=getMsgProp(); + @RequestMapping(value = { "initSpoofingIp" }) + public String initSpoofingIp() { + Properties msg = getMsgProp(); try { - DnsIpCfg entity=new DnsIpCfg(); + DnsIpCfg entity = new DnsIpCfg(); entity.setIsAudit(1); entity.setIsValid(1); entity.setDnsStrategyId(0); - List list=dnsIpCfgService.findDnsIpCfg(entity); - if(StringUtil.isEmpty(list)) { + List list = dnsIpCfgService.findDnsIpCfg(entity); + if (StringUtil.isEmpty(list)) { dnsIpCfgService.saveAndAudit(); } } catch (Exception e) { - logger.error("初始化Spoofing ip失败",e); + logger.error("初始化Spoofing ip失败", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { return msg.getProperty("request_service_failed"); - }else { + } else { return msg.getProperty("save_failed"); } } return "success"; } - @RequestMapping(value = {"/saveOrUpdate"}) - @RequiresPermissions(value={"dns:fake:ip:config"}) - public String saveOrUpdate(Model model,HttpServletRequest request - ,HttpServletResponse response, - @ModelAttribute("cfg")DnsIpCfg cfg - ,RedirectAttributes redirectAttributes){ - try{ + + @RequestMapping(value = { "/saveOrUpdate" }) + @RequiresPermissions(value = { "dns:fake:ip:config" }) + public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) { + try { dnsIpCfgService.saveOrUpdate(cfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("信息保存失败", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + cfg.getFunctionId(); } - - @RequestMapping(value = {"/delete"}) - @RequiresPermissions(value={"dns:fake:ip:config"}) - public String delete(Integer isAudit,Integer isValid - ,String ids,Integer functionId - ,RedirectAttributes redirectAttributes){ - dnsIpCfgService.delete(isAudit,isValid,ids,functionId); - return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId; + + @RequestMapping(value = { "/delete" }) + @RequiresPermissions(value = { "dns:fake:ip:config" }) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + dnsIpCfgService.delete(isAudit, isValid, ids, functionId); + return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId; } - @RequestMapping(value = {"/audit"}) - @RequiresPermissions(value={"dns:fake:ip:confirm"}) - public String audit(Model model,@ModelAttribute("cfg")DnsIpCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "/audit" }) + @RequiresPermissions(value = { "dns:fake:ip:confirm" }) + public String audit(Model model, @ModelAttribute("cfg") DnsIpCfg cfg, Integer isValid, Integer isAudit, String ids, + Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - dnsIpCfgService.audit(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + dnsIpCfgService.audit(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); - logger.info("dns fake ip配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error","request_service_failed"); + logger.info("dns fake ip配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { e.printStackTrace(); - logger.info("dns fake ip配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "audit_failed"); + logger.info("dns fake ip配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - - return list(model, request, response,cfg, redirectAttributes); + + return list(model, request, response, cfg, redirectAttributes); } - return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId; + return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId; } - + /** * DNS阻断无策略时检验 + * * @param entity * @param request * @param response * @return */ @ResponseBody - @RequestMapping(value = {"/dnsNoStrategyCheck"}) - public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response){ + @RequestMapping(value = { "/dnsNoStrategyCheck" }) + public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response) { entity.setIsAudit(1); entity.setIsValid(1); List list = dnsIpCfgService.findDnsIpCfg(entity); - if(list.size() > 0){ + if (list.size() > 0) { return true; } return false; } - - //dnsIp配置导出 - @RequestMapping(value = "exportDnsIp") - public void exportDns(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")DnsIpCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=dnsIpCfgService.findByPage(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = dnsIpCfgService.findPage(pageInfo, entity); - ipLists=page.getList(); - } - - for (int i = 0; i < ipLists.size(); i++) { - if(StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())){ - Properties msgProp = getMsgProp(); - ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group")); - } - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), DnsIpCfg.class); - String cfgIndexInfoNoExport=",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("DnsIp export failed",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "export_failed"); + // dnsIp配置导出 + @RequestMapping(value = "exportDnsIp") + public void exportDns(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DnsIpCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = dnsIpCfgService.findByPage(ids); + } else { + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = dnsIpCfgService.findPage(pageInfo, entity); + ipLists = page.getList(); + } + + for (int i = 0; i < ipLists.size(); i++) { + if (StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())) { + Properties msgProp = getMsgProp(); + ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group")); } } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), DnsIpCfg.class); + String cfgIndexInfoNoExport = ",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("DnsIp export failed", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "export_failed"); + } } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java index 7cf5f23a1..c87146bdd 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java @@ -33,189 +33,206 @@ import com.nis.web.controller.BaseController; /** * dns响应策略 + * * @author ddm * */ @Controller @RequestMapping("${adminPath}/maintenance/dnsResStrategy") -public class DnsResStrategyController extends BaseController { - - @RequestMapping(value = {"/form"}) - @RequiresPermissions(value={"dns:res:strategy:config"}) - public String from(Model model, - HttpServletRequest request, - HttpServletResponse response, - String ids, - @ModelAttribute("cfg")DnsResStrategy cfg - ,RedirectAttributes redirectAttributes){ - if(cfg == null){ - cfg=new DnsResStrategy(); +public class DnsResStrategyController extends BaseController { + + @RequestMapping(value = { "/form" }) + @RequiresPermissions(value = { "dns:res:strategy:config" }) + public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) { + if (cfg == null) { + cfg = new DnsResStrategy(); } - if(!StringUtil.isEmpty(ids)){ - cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids),-1); + if (!StringUtil.isEmpty(ids)) { + cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids), -1); initFormCondition(model, cfg); model.addAttribute("isAdd", false); - }else{ - /*//不存在响应策略为0的配置,则新策略时,cfgId默认为0 - DnsResStrategy dns0=dnsResStrategyService.getDnsResStrategy(0l,null); - if(dns0 == null){ - cfg.setCfgId(0l); - cfg.setCfgDesc("无策略"); - }*/ + } else { + /* + * //不存在响应策略为0的配置,则新策略时,cfgId默认为0 DnsResStrategy + * dns0=dnsResStrategyService.getDnsResStrategy(0l,null); if(dns0 == + * null){ cfg.setCfgId(0l); cfg.setCfgDesc("无策略"); } + */ initFormCondition(model, cfg); model.addAttribute("isAdd", true); } - - //查询policyGroup列表,供响应策略选择 -// List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1); - List policyGroups=policyGroupInfoService.findHasIpPolicyGroupInfosByType(1); + + // 查询policyGroup列表,供响应策略选择 + // List + // policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1); + List policyGroups = policyGroupInfoService.findHasIpPolicyGroupInfosByType(1); model.addAttribute("policyGroups", policyGroups); - + model.addAttribute("_cfg", cfg); return "/cfg/maintenance/dnsResStrategy/form"; } - - @RequestMapping(value = {"/saveOrUpdate"}) - @RequiresPermissions(value={"dns:res:strategy:config"}) - public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")DnsResStrategy cfg - ,RedirectAttributes redirectAttributes){ - try{ - + + @RequestMapping(value = { "/saveOrUpdate" }) + @RequiresPermissions(value = { "dns:res:strategy:config" }) + public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) { + try { + dnsResStrategyService.saveOrUpdate(cfg); - - addMessage(redirectAttributes,"success","save_success"); - }catch (MaatConvertException e) { - addMessage(redirectAttributes,"error", "request_service_failed"); + + addMessage(redirectAttributes, "success", "save_success"); + } catch (MaatConvertException e) { + addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { - addMessage(redirectAttributes,"error", "save_failed"); + addMessage(redirectAttributes, "error", "save_failed"); } - - return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + cfg.getFunctionId(); } - - @RequestMapping(value = {"/list"}) - public String list(Model model,HttpServletRequest request,HttpServletResponse response - ,@ModelAttribute("cfg")DnsResStrategy entity - ,RedirectAttributes redirectAttributes){ - //查询时left join policyGroup - Page page = dnsResStrategyService.findPage(new Page(request, response,"r"), entity); + + @RequestMapping(value = { "/list" }) + public String list(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DnsResStrategy entity, RedirectAttributes redirectAttributes) { + // 查询时left join policyGroup + Page page = dnsResStrategyService.findPage(new Page(request, response, "r"), + entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/maintenance/dnsResStrategy/list"; } - - @RequestMapping(value = {"/delete"}) - @RequiresPermissions(value={"dns:res:strategy:config"}) - public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId - ,Model model,HttpServletRequest request - ,HttpServletResponse response - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(ids)){ - dnsResStrategyService.delete(isAudit,isValid,ids,functionId); + + @RequestMapping(value = { "/delete" }) + @RequiresPermissions(value = { "dns:res:strategy:config" }) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { + dnsResStrategyService.delete(isAudit, isValid, ids, functionId); } - - return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+functionId; + + return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId; } - - @RequestMapping(value = {"/audit"}) - @RequiresPermissions(value={"dns:res:strategy:confirm"}) - public String audit(Model model,@ModelAttribute("cfg")DnsResStrategy cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "/audit" }) + @RequiresPermissions(value = { "dns:res:strategy:confirm" }) + public String audit(Model model, @ModelAttribute("cfg") DnsResStrategy cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - dnsResStrategyService.audit(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + dnsResStrategyService.audit(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { - addMessage(redirectAttributes,"error", "request_service_failed"); + addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { - addMessage(redirectAttributes,"error", "audit_failed"); + addMessage(redirectAttributes, "error", "audit_failed"); } } - - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - - return list(model, request, response, cfg,redirectAttributes); + + return list(model, request, response, cfg, redirectAttributes); } - return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+functionId; + return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId; } + @ResponseBody @RequestMapping(value = "/validCfgId") public boolean validCfgId(Long cfgId) { - DnsResStrategy dns=dnsResStrategyService.getDnsResStrategy(cfgId,null); - if(dns == null ){ + DnsResStrategy dns = dnsResStrategyService.getDnsResStrategy(cfgId, null); + if (dns == null) { return false; - }else{ + } else { return true; } } - - //dns配置导出 + + // dns配置导出 @RequestMapping(value = "exportDns") - public void exportDns(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")DnsResStrategy entity,String ids,RedirectAttributes redirectAttributes){ + public void exportDns(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DnsResStrategy entity, String ids, RedirectAttributes redirectAttributes) { try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=dnsResStrategyService.findByPage(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = dnsResStrategyService.findPage(pageInfo, entity); - ipLists=page.getList(); + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = dnsResStrategyService.findByPage(ids); + } else { + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = dnsResStrategyService.findPage(pageInfo, entity); + ipLists = page.getList(); + } + + for (int i = 0; i < ipLists.size(); i++) { + ipLists.get(i).setMiTtlmax( + String.valueOf(ipLists.get(i).getMinTtl()) + "-" + String.valueOf(ipLists.get(i).getMaxTtl())); + ipLists.get(i).setDnsId(String.valueOf(ipLists.get(i).getCfgId())); + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), DnsResStrategy.class); + String cfgIndexInfoNoExport = ",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:policy_name-"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + if (entity.gethColumns().contains("policy_name")) { + cfgIndexInfoNoExport = ",config_describe," + cfgIndexInfoNoExport; } - - for (int i = 0; i < ipLists.size(); i++) { - ipLists.get(i).setMiTtlmax(String.valueOf(ipLists.get(i).getMinTtl())+"-"+String.valueOf(ipLists.get(i).getMaxTtl())); - ipLists.get(i).setDnsId( String.valueOf(ipLists.get(i).getCfgId())); - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), DnsResStrategy.class); - String cfgIndexInfoNoExport=",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(),ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } } catch (Exception e) { - logger.error("Dns export failed",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "export_failed"); + logger.error("Dns export failed", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "export_failed"); } } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } } diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/IpMultiplexPoolCfgController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/IpMultiplexPoolCfgController.java index 58b64100c..b9224b1fe 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/IpMultiplexPoolCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/IpMultiplexPoolCfgController.java @@ -34,213 +34,200 @@ import com.nis.web.service.basics.SysDictInfoService; */ @Controller @RequestMapping("${adminPath}/maintenance/ipMultiplexPoolCfg") -public class IpMultiplexPoolCfgController extends BaseController { - - @RequestMapping(value = {"/form"}) - @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) - public String from(Model model, - HttpServletRequest request, - HttpServletResponse response, - String ids, - @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ - if(cfg == null){ - cfg=new IpMultiplexPoolCfg(); +public class IpMultiplexPoolCfgController extends BaseController { + + @RequestMapping(value = { "/form" }) + @RequiresPermissions(value = { "ip:mulitiplex:pool:config" }) + public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") IpMultiplexPoolCfg cfg) { + if (cfg == null) { + cfg = new IpMultiplexPoolCfg(); } - if(!StringUtil.isEmpty(ids)){ - cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null); + if (!StringUtil.isEmpty(ids)) { + cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids), null); initFormCondition(model, cfg); - }else{ + } else { initFormCondition(model, cfg); } - - //查询ip复用地址池配置的policyGroup列表 - List policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(3); + + // 查询ip复用地址池配置的policyGroup列表 + List policyGroups = policyGroupInfoService.getHasAreaPolicyGroups(3); model.addAttribute("policyGroups", policyGroups); model.addAttribute("_cfg", cfg); return "/cfg/maintenance/ipMultiplexPool/form"; } - - @RequestMapping(value = {"/saveOrUpdate"}) - @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) - public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes, - @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ - try{ + + @RequestMapping(value = { "/saveOrUpdate" }) + @RequiresPermissions(value = { "ip:mulitiplex:pool:config" }) + public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes, @ModelAttribute("cfg") IpMultiplexPoolCfg cfg) { + try { // 设置省份信息 groupAreaService.setAreaCodeByGroupId(cfg); - + ipMultiplexPoolCfgService.saveOrUpdate(cfg); - - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ + + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + cfg.getFunctionId(); } - - @RequestMapping(value = {"/list"}) - public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){ - //查询时left join policyGroup - Page page = ipMultiplexPoolCfgService.findPage(new Page(request, response,"r"), entity); + + @RequestMapping(value = { "/list" }) + public String list(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") IpMultiplexPoolCfg entity) { + // 查询时left join policyGroup + Page page = ipMultiplexPoolCfgService + .findPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/maintenance/ipMultiplexPool/list"; } - - @RequestMapping(value = {"/delete"}) - @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) - public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes - ,HttpServletRequest request,HttpServletResponse response){ - try{ - if(!StringUtil.isEmpty(ids)){ - ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId); + + @RequestMapping(value = { "/delete" }) + @RequiresPermissions(value = { "ip:mulitiplex:pool:config" }) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, + RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response) { + try { + if (!StringUtil.isEmpty(ids)) { + ipMultiplexPoolCfgService.delete(isAudit, isValid, ids, functionId); } - addMessage(redirectAttributes,"success","delete_success"); - }catch(Exception e){ - logger.error(e); - addMessage(redirectAttributes,"error", "delete_failed"); + addMessage(redirectAttributes, "success", "delete_success"); + } catch (Exception e) { + logger.error(e); + addMessage(redirectAttributes, "error", "delete_failed"); } - return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId; + return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId; } - - @RequestMapping(value = {"/audit"}) - @RequiresPermissions(value={"ip:mulitiplex:pool:confirm"}) - public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "/audit" }) + @RequiresPermissions(value = { "ip:mulitiplex:pool:confirm" }) + public String audit(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + ipMultiplexPoolCfgService.audit(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); - logger.info("IP复用地址池配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "request_service_failed"); - }catch (Exception e) { + logger.info("IP复用地址池配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { e.printStackTrace(); - logger.info("IP复用地址池配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "audit_failed"); + logger.info("IP复用地址池配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "audit_failed"); } } - + } - return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId; + return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId; } + @ResponseBody @RequestMapping(value = "/validCfgId") public boolean validCfgId(Long cfgId) { - IpMultiplexPoolCfg dns=ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(cfgId,null); - if(dns == null ){ + IpMultiplexPoolCfg dns = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(cfgId, null); + if (dns == null) { return false; - }else{ + } else { return true; } } - - /*@RequestMapping(value = {"/snatlist"}) - public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){ - //查询时left join policyGroup - Page page = ipMultiplexPoolCfgService.findPage(new Page(request, response,"r"), entity); - model.addAttribute("page", page); - initFormCondition(model,entity); - return "/cfg/maintenance/ipMultiplexPool/snatlist"; - } - - @RequestMapping(value = {"/snatform"}) - @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) - public String snatfrom(Model model, - HttpServletRequest request, - HttpServletResponse response, - String ids, - @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ - if(cfg == null){ - cfg=new IpMultiplexPoolCfg(); - } - if(!StringUtil.isEmpty(ids)){ - cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null); - initUpdateFormCondition(model, cfg); - }else{ - initFormCondition(model, cfg); - } - - //查询ip复用地址池配置的policyGroup列表 - List policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2); - model.addAttribute("policyGroups", policyGroups); - model.addAttribute("_cfg", cfg); - return "/cfg/maintenance/ipMultiplexPool/snatform"; - } - - @RequestMapping(value = {"/snatsaveOrUpdate"}) - @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) - public String snatsaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes, - @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ - try{ - // 设置省份信息 - if(!StringUtil.isEmpty(cfg.getPolicyGroup())){ - groupAreaService.setAreaCodeByGroupId(cfg); - } - ipMultiplexPoolCfgService.saveOrUpdate(cfg); - - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "save_failed"); - } - } - - return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId(); - } - - @RequestMapping(value = {"/snataudit"}) - @RequiresPermissions(value={"ip:mulitiplex:pool:confirm"}) - public String snataudit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(ids)){ - String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ - try { - ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime); - } catch (Exception e) { - e.printStackTrace(); - logger.error("SNAT地址池管理配置下发失败:"+e.getMessage()); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); - } - } - } - - } - return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; - } - @RequestMapping(value = {"/snatdelete"}) - @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) - public String snatdelete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes - ,HttpServletRequest request,HttpServletResponse response){ - try{ - if(!StringUtil.isEmpty(ids)){ - ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId); - } - addMessage(redirectAttributes,"success","delete_success"); - }catch(Exception e){ - logger.error(e); - addMessage(redirectAttributes,"error","delete_failed"); - } - return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; - }*/ - + + /* + * @RequestMapping(value = {"/snatlist"}) public String snatlist(Model + * model,HttpServletRequest request,HttpServletResponse + * response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){ //查询时left join + * policyGroup Page page = + * ipMultiplexPoolCfgService.findPage(new Page(request, + * response,"r"), entity); model.addAttribute("page", page); + * initFormCondition(model,entity); return + * "/cfg/maintenance/ipMultiplexPool/snatlist"; } + * + * @RequestMapping(value = {"/snatform"}) + * + * @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String + * snatfrom(Model model, HttpServletRequest request, HttpServletResponse + * response, String ids, + * + * @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ if(cfg == null){ cfg=new + * IpMultiplexPoolCfg(); } if(!StringUtil.isEmpty(ids)){ cfg = + * ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null); + * initUpdateFormCondition(model, cfg); }else{ initFormCondition(model, + * cfg); } + * + * //查询ip复用地址池配置的policyGroup列表 List + * policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2); + * model.addAttribute("policyGroups", policyGroups); + * model.addAttribute("_cfg", cfg); return + * "/cfg/maintenance/ipMultiplexPool/snatform"; } + * + * @RequestMapping(value = {"/snatsaveOrUpdate"}) + * + * @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String + * snatsaveOrUpdate(Model model,HttpServletRequest + * request,HttpServletResponse response,RedirectAttributes + * redirectAttributes, + * + * @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ try{ // 设置省份信息 + * if(!StringUtil.isEmpty(cfg.getPolicyGroup())){ + * groupAreaService.setAreaCodeByGroupId(cfg); } + * ipMultiplexPoolCfgService.saveOrUpdate(cfg); + * + * addMessage(redirectAttributes,"success","save_success"); }catch(Exception + * e){ e.printStackTrace(); if(e instanceof MaatConvertException) { + * addMessage(redirectAttributes,"error", "request_service_failed"); }else { + * addMessage(redirectAttributes,"error", "save_failed"); } } + * + * return "redirect:" + adminPath + * +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId + * (); } + * + * @RequestMapping(value = {"/snataudit"}) + * + * @RequiresPermissions(value={"ip:mulitiplex:pool:confirm"}) public String + * snataudit(Integer isAudit,Integer isValid,String ids,Integer + * functionId,RedirectAttributes redirectAttributes) { + * if(!StringUtil.isEmpty(ids)){ String[] idArray = ids.split(","); Date + * auditTime=new Date(); for(String id :idArray){ try { + * ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime); + * } catch (Exception e) { e.printStackTrace(); + * logger.error("SNAT地址池管理配置下发失败:"+e.getMessage()); if(e instanceof + * MaatConvertException) { addMessage(redirectAttributes,"error", + * "request_service_failed"); }else { addMessage(redirectAttributes,"error", + * "audit_failed"); } } } + * + * } return "redirect:" + adminPath + * +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; } + * + * @RequestMapping(value = {"/snatdelete"}) + * + * @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String + * snatdelete(Integer isAudit,Integer isValid,String ids,Integer + * functionId,Model model,RedirectAttributes redirectAttributes + * ,HttpServletRequest request,HttpServletResponse response){ try{ + * if(!StringUtil.isEmpty(ids)){ + * ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId); } + * addMessage(redirectAttributes,"success","delete_success"); + * }catch(Exception e){ logger.error(e); + * addMessage(redirectAttributes,"error","delete_failed"); } return + * "redirect:" + adminPath + * +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; } + */ + /** * 校验IP是否已存在 + * * @param cfg * @param redirectAttributes * @param request @@ -248,97 +235,143 @@ public class IpMultiplexPoolCfgController extends BaseController { * @return */ @ResponseBody - @RequestMapping(value = {"/checkIp"}) - public boolean checkIp(IpMultiplexPoolCfg cfg, HttpServletRequest request, HttpServletResponse response){ + @RequestMapping(value = { "/checkIp" }) + public boolean checkIp(IpMultiplexPoolCfg cfg, HttpServletRequest request, HttpServletResponse response) { // 修改 - if(!StringUtil.isEmpty(cfg.getCfgId())){ + if (!StringUtil.isEmpty(cfg.getCfgId())) { IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg); - if(poolCfg != null && poolCfg.getDestIpAddress().equals(cfg.getDestIpAddress())){ + if (poolCfg != null && poolCfg.getDestIpAddress().equals(cfg.getDestIpAddress())) { return true; } } cfg.setCfgId(null); IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg); - if(poolCfg != null){ + if (poolCfg != null) { return false; } return true; } - - //snat配置导出 - @RequestMapping(value = "exportSnat") - public void exportSnat(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")IpMultiplexPoolCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipMultiplexPoolCfgService.findPage(pageInfo, entity); - page.setList(ipMultiplexPoolCfgService.getIsp(page.getList())); - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class); - String snatNoExport=",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,"; - noExportMap.put(entity.getMenuNameCode(),snatNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("snat export failed",e); - addMessage(redirectAttributes,"error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + + // snat配置导出 + @RequestMapping(value = "exportSnat") + public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") IpMultiplexPoolCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + /* + * //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String + * id:ids.split(",")){ Long.parseLong(id); } //List + * list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename() + * , entity.getFunctionId(), ids); }else{ + */ + // 条件导出数据大于最大导出数,只导出最大导出条数 + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipMultiplexPoolCfgService.findPage(pageInfo, entity); + page.setList(ipMultiplexPoolCfgService.getIsp(page.getList())); + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class); + String snatNoExport = ",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + snatNoExport = ",config_time" + snatNoExport; } - - //dnat配置导出 - @RequestMapping(value = "exportDnat") - public void exportDnat(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")IpMultiplexPoolCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipMultiplexPoolCfgService.findPage(pageInfo, entity); - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class); - String snatNoExport=",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,"; - noExportMap.put(entity.getMenuNameCode(),snatNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("dnat export failed",e); - addMessage(redirectAttributes,"error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); - } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + snatNoExport = ",edit_time" + snatNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + snatNoExport = ",audit_time" + snatNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + snatNoExport = "," + entity.gethColumns() + "," + snatNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), snatNoExport); + dataMap.put(entity.getMenuNameCode(), page.getList()); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + + } catch (Exception e) { + logger.error("snat export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // dnat配置导出 + @RequestMapping(value = "exportDnat") + public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") IpMultiplexPoolCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + /* + * //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String + * id:ids.split(",")){ Long.parseLong(id); } //List + * list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename() + * , entity.getFunctionId(), ids); }else{ + */ + // 条件导出数据大于最大导出数,只导出最大导出条数 + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipMultiplexPoolCfgService.findPage(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class); + String snatNoExport = ",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + snatNoExport = ",config_time" + snatNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + snatNoExport = ",edit_time" + snatNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + snatNoExport = ",audit_time" + snatNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + snatNoExport = "," + entity.gethColumns() + "," + snatNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), snatNoExport); + dataMap.put(entity.getMenuNameCode(), page.getList()); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("dnat export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java index 9766cd83e..465a92917 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java @@ -39,165 +39,189 @@ import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/manipulation/ddos") public class DdosCfgController extends BaseController { - - @RequestMapping(value = {"/list"}) - public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DdosIpCfg entity){ - Page page = ddosCfgService.findPage(new Page(request, response,"r"), entity); + + @RequestMapping(value = { "/list" }) + public String list(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DdosIpCfg entity) { + Page page = ddosCfgService.findPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/ddosIpCfgList"; } - @RequestMapping(value = {"/form"}) - @RequiresPermissions(value={"ddos:ip:config"}) - public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")DdosIpCfg cfg){ - if(!StringUtil.isEmpty(ids)){ - cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids),null); + + @RequestMapping(value = { "/form" }) + @RequiresPermissions(value = { "ddos:ip:config" }) + public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") DdosIpCfg cfg) { + if (!StringUtil.isEmpty(ids)) { + cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids), null); initUpdateFormCondition(model, cfg); - }else{ - initFormCondition(model,cfg); + } else { + initFormCondition(model, cfg); } model.addAttribute("_cfg", cfg); return "/cfg/ddosIpCfgForm"; } - - @RequestMapping(value = {"/saveOrUpdate"}) - @RequiresPermissions(value={"ddos:ip:config"}) - public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")DdosIpCfg cfg, RedirectAttributes redirectAttributes){ - try{ + + @RequestMapping(value = { "/saveOrUpdate" }) + @RequiresPermissions(value = { "ddos:ip:config" }) + public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DdosIpCfg cfg, RedirectAttributes redirectAttributes) { + try { ddosCfgService.saveOrUpdate(cfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("信息保存失败", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + cfg.getFunctionId(); } - - @RequestMapping(value = {"/delete"}) - @RequiresPermissions(value={"ddos:ip:config"}) - public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){ - ddosCfgService.delete(isAudit,isValid,ids,functionId); - return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+functionId; + + @RequestMapping(value = { "/delete" }) + @RequiresPermissions(value = { "ddos:ip:config" }) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId) { + ddosCfgService.delete(isAudit, isValid, ids, functionId); + return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + functionId; } - @RequestMapping(value = {"/audit"}) - //@RequiresPermissions(value={"ddos:ip:confirm"}) - public String audit(Model model,@ModelAttribute("cfg")DdosIpCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "/audit" }) + // @RequiresPermissions(value={"ddos:ip:confirm"}) + public String audit(Model model, @ModelAttribute("cfg") DdosIpCfg cfg, Integer isValid, Integer isAudit, String ids, + Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - ddosCfgService.audit(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); - logger.info("dns fake ip配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error","request_service_failed"); + logger.info("dns fake ip配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { e.printStackTrace(); - logger.info("dns fake ip配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error","audit_failed"); + logger.info("dns fake ip配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); - + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); + try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return list(model, request, response, cfg); } - return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+functionId; + return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + functionId; } - - //ddos配置导出 + + // ddos配置导出 @RequestMapping(value = "exportDdos") - public void exportddos(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")DdosIpCfg entity,String ids,RedirectAttributes redirectAttributes){ + public void exportddos(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") DdosIpCfg entity, String ids, RedirectAttributes redirectAttributes) { try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ddosCfgService.findByPage(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ddosCfgService.findPage(pageInfo, entity); - ipLists=page.getList(); - } - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), DdosIpCfg.class); - String cfgIndexInfoNoExport=",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ddosCfgService.findByPage(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ddosCfgService.findPage(pageInfo, entity); + ipLists = page.getList(); + } + /* + * //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String + * id:ids.split(",")){ Long.parseLong(id); } //List + * list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename() + * , entity.getFunctionId(), ids); }else{ + */ + // 条件导出数据大于最大导出数,只导出最大导出条数 + + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), DdosIpCfg.class); + String cfgIndexInfoNoExport = ",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } } catch (Exception e) { - logger.error("ddos export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + logger.error("ddos export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } + /** * 根据索引表信息异步获取子表信息 + * * @return */ - @RequestMapping(value = {"/ajaxDdosInfo"}) - public String getDdosInfo(Model model,Long cfgId,Integer index,Integer compileId) { + @RequestMapping(value = { "/ajaxDdosInfo" }) + public String getDdosInfo(Model model, Long cfgId, Integer index, Integer compileId) { DdosIpCfg cfg = ddosCfgService.getDdosIpCfg(cfgId, compileId); List tabList = new ArrayList(); - //获取DdosIpCfg信息 - String cfgType = null; - if(!cfg.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",cfg.getCfgType()}); - cfgType = cfg.getCfgType(); - } - - model.addAttribute("_cfg", cfg); + // 获取DdosIpCfg信息 + String cfgType = null; + if (!cfg.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", cfg.getCfgType() }); + cfgType = cfg.getCfgType(); + } + + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/ddosSubList"; diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java index 87feb33ca..b5c54efea 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java @@ -46,101 +46,116 @@ import com.nis.web.controller.configuration.CommonController; import com.nis.web.service.configuration.IpMultiplexService; /** - * @ClassName: ControlController.java + * @ClassName: ControlController.java * @Description: TODO * @author (dell) * @date 2018年6月22日 下午4:35:42 * @version V1.0 */ -@Controller +@Controller @RequestMapping("${adminPath}/manipulation/ipmulitiplex") public class IpMultiplexController extends CommonController { - + @Autowired private IpMultiplexService ipMultiplexService; - - @RequestMapping(value = {"/list"}) -// @RequiresPermissions(value={"ip:mulitiplex:config","ip:mulitiplex:confirm"},logical=Logical.OR) - public String ipList(String cfgName,Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) { - this._ipList(cfgName,model, cfg, request, response); - model.addAttribute("urlPrefix","/manipulation/ipmulitiplex"); - model.addAttribute("requiresPermissionPrefix","ip:mulitiplex"); + + @RequestMapping(value = { "/list" }) + // @RequiresPermissions(value={"ip:mulitiplex:config","ip:mulitiplex:confirm"},logical=Logical.OR) + public String ipList(String cfgName, Model model, @ModelAttribute("cfg") IpPortCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + this._ipList(cfgName, model, cfg, request, response); + model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex"); + model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex"); return "/cfg/common/ipList"; } - @RequestMapping(value = {"/form"}) - @RequiresPermissions(value={"ip:mulitiplex:config"}) - public String ipForm(String cfgName,Model model,String ids,Integer functionId,BaseIpCfg entity) { - this._ipForm(cfgName,model, ids, functionId, entity); - SysDataDictionaryItem dict=null; - List dictList= DictUtils.getDictList("GROUP_TYPE"); - for(SysDataDictionaryItem di:dictList){ - if("IP".equals(di.getItemValue())){ - dict=di; + + @RequestMapping(value = { "/form" }) + @RequiresPermissions(value = { "ip:mulitiplex:config" }) + public String ipForm(String cfgName, Model model, String ids, Integer functionId, BaseIpCfg entity) { + this._ipForm(cfgName, model, ids, functionId, entity); + SysDataDictionaryItem dict = null; + List dictList = DictUtils.getDictList("GROUP_TYPE"); + for (SysDataDictionaryItem di : dictList) { + if ("IP".equals(di.getItemValue())) { + dict = di; break; } } - if(dict!=null){ - List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(Integer.parseInt(dict.getItemCode())); + if (dict != null) { + List policyGroups = policyGroupInfoService + .findPolicyGroupInfosByType(Integer.parseInt(dict.getItemCode())); model.addAttribute("policyGroups", policyGroups); } - model.addAttribute("urlPrefix","/manipulation/ipmulitiplex"); - model.addAttribute("requiresPermissionPrefix","ip:mulitiplex"); + model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex"); + model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex"); return "/cfg/manipulation/ipmulitiplex/form"; } - @RequestMapping(value = {"/saveOrUpdate"}) - public String saveOrUpdateIp(String cfgName,RedirectAttributes model, IpPortCfg cfg) { - this._saveOrUpdateIp(cfgName,model, cfg); - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); + + @RequestMapping(value = { "/saveOrUpdate" }) + public String saveOrUpdateIp(String cfgName, RedirectAttributes model, IpPortCfg cfg) { + this._saveOrUpdateIp(cfgName, model, cfg); + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId(); } - @RequestMapping(value = {"/delete"}) + + @RequestMapping(value = { "/delete" }) @RequiresPermissions("ip:mulitiplex:config") - public String deleteIp(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) { - this._deleteIp(cfgName,ids, compileIds, functionId, model); - model.addAttribute("urlPrefix","/proxy/ipmulitiplex"); - model.addAttribute("requiresPermissionPrefix","ip:mulitiplex"); - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+functionId; + public String deleteIp(String cfgName, String ids, String compileIds, Integer functionId, + RedirectAttributes model) { + this._deleteIp(cfgName, ids, compileIds, functionId, model); + model.addAttribute("urlPrefix", "/proxy/ipmulitiplex"); + model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex"); + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + functionId; } - @RequestMapping(value = {"/audit"}) + + @RequestMapping(value = { "/audit" }) @RequiresPermissions("ip:mulitiplex:confirm") - public String auditIp(String cfgName,String ids,IpPortCfg cfg,RedirectAttributes redirectAttributes) { - this._auditIp(cfgName,ids, cfg, redirectAttributes); - redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex"); - redirectAttributes.addAttribute("requiresPermissionPrefix","ip:mulitiplex"); - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); + public String auditIp(String cfgName, String ids, IpPortCfg cfg, RedirectAttributes redirectAttributes) { + this._auditIp(cfgName, ids, cfg, redirectAttributes); + redirectAttributes.addAttribute("urlPrefix", "/manipulation/ipmulitiplex"); + redirectAttributes.addAttribute("requiresPermissionPrefix", "ip:mulitiplex"); + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId(); } - //ip配置导入 - /*@RequestMapping(value = "/import", method=RequestMethod.POST) - public String importIp(String cfgName,RedirectAttributes redirectAttributes, - @RequestParam("file") MultipartFile file,IpPortCfg cfg) { - this._importIp(cfgName,redirectAttributes, file,cfg,IpMultiplexPolicyTemplate.class); - redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex"); - redirectAttributes.addAttribute("requiresPermissionPrefix","ip:mulitiplex"); - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); - }*/ - //ip模板下载 + + // ip配置导入 + /* + * @RequestMapping(value = "/import", method=RequestMethod.POST) public + * String importIp(String cfgName,RedirectAttributes redirectAttributes, + * + * @RequestParam("file") MultipartFile file,IpPortCfg cfg) { + * this._importIp(cfgName,redirectAttributes, + * file,cfg,IpMultiplexPolicyTemplate.class); + * redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex") + * ; redirectAttributes.addAttribute("requiresPermissionPrefix", + * "ip:mulitiplex"); return "redirect:" + adminPath + * +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); } + */ + // ip模板下载 @RequestMapping(value = "import/template") - public void importFileTemplate(HttpServletRequest request,HttpServletResponse response, - RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) { - this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpMultiplexPolicyTemplate.class); + public void importFileTemplate(HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) { + this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode, + IpMultiplexPolicyTemplate.class); } - //ip配置导出 + + // ip配置导出 @RequestMapping(value = "export") - public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){ - this._exportIp(columns,model, request, response, entity, ids, redirectAttributes); + public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") IpPortCfg entity, String ids, RedirectAttributes redirectAttributes) { + this._exportIp(columns, model, request, response, entity, ids, redirectAttributes); } - + /** * IP复用策略拆分为SNAT/DNAT复用策略 */ - @RequestMapping(value = {"/snatPolicyList"}) - public String snatPolicyList(Model model,@ModelAttribute("cfg")IpReusePolicyCfg cfg, - HttpServletRequest request,HttpServletResponse response) { - - Page page = ipMultiplexService.findPage(new Page(request, response,"r"), cfg); + @RequestMapping(value = { "/snatPolicyList" }) + public String snatPolicyList(Model model, @ModelAttribute("cfg") IpReusePolicyCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + + Page page = ipMultiplexService.findPage(new Page(request, response, "r"), + cfg); model.addAttribute("page", page); - initFormCondition(model,cfg); - + initFormCondition(model, cfg); + // 获取地址池、用户信息 List users = userManageService.findUsers(); List addrPools = ipAddrPoolCfgService.getEffectiveAddrPool(); @@ -148,357 +163,401 @@ public class IpMultiplexController extends CommonController { model.addAttribute("addrPools", addrPools); return "/cfg/manipulation/ipmulitiplex/snatPolicyList2"; } - - @RequestMapping(value = {"/snatPolicyForm"}) - @RequiresPermissions(value={"snat_policy:config"}) - public String snatPolicyForm(Model model, String ids, IpReusePolicyCfg cfg, - HttpServletRequest request,HttpServletResponse response) { - if(cfg == null){ - cfg=new IpReusePolicyCfg(); + + @RequestMapping(value = { "/snatPolicyForm" }) + @RequiresPermissions(value = { "snat_policy:config" }) + public String snatPolicyForm(Model model, String ids, IpReusePolicyCfg cfg, HttpServletRequest request, + HttpServletResponse response) { + if (cfg == null) { + cfg = new IpReusePolicyCfg(); } - if(!StringUtil.isEmpty(ids)){ - cfg = ipMultiplexService.getPolicyCfg(Long.valueOf(ids),null); + if (!StringUtil.isEmpty(ids)) { + cfg = ipMultiplexService.getPolicyCfg(Long.valueOf(ids), null); initUpdateFormCondition(model, cfg); - }else{ + } else { initFormCondition(model, cfg); } - + // 获取用户信息 地址池信息 List users = userManageService.findUsers(); - + model.addAttribute("_cfg", cfg); model.addAttribute("users", users); - model.addAttribute("urlPrefix","/manipulation/ipmulitiplex"); + model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex"); return "/cfg/manipulation/ipmulitiplex/snatPolicyForm2"; } - - @RequestMapping(value = {"/saveOrUpdateSnat"}) - public String saveOrUpdateSnat(Model model, HttpServletRequest request,HttpServletResponse response, + + @RequestMapping(value = { "/saveOrUpdateSnat" }) + public String saveOrUpdateSnat(Model model, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes, IpReusePolicyCfg cfg) { - try{ + try { // 添加策略配置信息 ipMultiplexService.saveOrUpdate(cfg, request, response); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e) { + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/snatPolicyList?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + cfg.getFunctionId(); } - - @RequestMapping(value = {"/snatDelete"}) + + @RequestMapping(value = { "/snatDelete" }) @RequiresPermissions("snat_policy:config") - public String snatDelete(String ids, Integer isValid, Integer functionId,RedirectAttributes redirectAttributes, - HttpServletRequest request,HttpServletResponse response) { - - try{ - if(!StringUtil.isEmpty(ids)){ - ipMultiplexService.delete(isValid,ids,functionId); + public String snatDelete(String ids, Integer isValid, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletRequest request, HttpServletResponse response) { + + try { + if (!StringUtil.isEmpty(ids)) { + ipMultiplexService.delete(isValid, ids, functionId); } - addMessage(redirectAttributes,"success","delete_success"); - }catch(Exception e){ + addMessage(redirectAttributes, "success", "delete_success"); + } catch (Exception e) { logger.error(e); - addMessage(redirectAttributes,"error","delete_failed"); + addMessage(redirectAttributes, "error", "delete_failed"); } - - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/snatPolicyList?functionId="+functionId; + + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + functionId; } - - @RequestMapping(value = {"/auditSnat"}) + + @RequestMapping(value = { "/auditSnat" }) @RequiresPermissions("snat_policy:confirm") - public String auditSnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) { - - if(!StringUtil.isEmpty(ids)){ + public String auditSnat(String ids, Integer isAudit, Integer isValid, Integer functionId, + RedirectAttributes redirectAttributes) { + + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - ipMultiplexService.auditSnatPolicy(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + ipMultiplexService.auditSnatPolicy(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("SNAT策略配置下发失败:"+e.getMessage()); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("SNAT策略配置下发失败:" + e.getMessage()); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - + } - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/snatPolicyList?functionId="+functionId; + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + functionId; } - - - @RequestMapping(value = {"/ajaxSnatInfo"}) - public String ajaxSnatInfo(Model model,Long cfgId,Integer index,Integer compileId) { + + @RequestMapping(value = { "/ajaxSnatInfo" }) + public String ajaxSnatInfo(Model model, Long cfgId, Integer index, Integer compileId) { IpReusePolicyCfg cfg = ipMultiplexService.getSnatCfg(cfgId, compileId); List tabList = new ArrayList(); - String cfgType = null; - if(!cfg.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",cfg.getCfgType()}); - cfgType = cfg.getCfgType(); - } - + String cfgType = null; + if (!cfg.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", cfg.getCfgType() }); + cfgType = cfg.getCfgType(); + } + List users = userManageService.findUsers(); List addrPools = ipAddrPoolCfgService.getEffectiveAddrPool(); model.addAttribute("users", users); model.addAttribute("addrPools", addrPools); - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/manipulation/ipmulitiplex/snatSubList"; } - - - - @RequestMapping(value = {"/ajaxDnatInfo"}) - public String ajaxDnatInfo(Model model,Long cfgId,Integer index,Integer compileId) { + + @RequestMapping(value = { "/ajaxDnatInfo" }) + public String ajaxDnatInfo(Model model, Long cfgId, Integer index, Integer compileId) { IpReuseDnatPolicyCfg cfg = ipMultiplexService.getDnatCfg(cfgId, compileId); List tabList = new ArrayList(); - String cfgType = null; - if(!cfg.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",cfg.getCfgType()}); - cfgType = cfg.getCfgType(); - } - model.addAttribute("_cfg", cfg); + String cfgType = null; + if (!cfg.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", cfg.getCfgType() }); + cfgType = cfg.getCfgType(); + } + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/manipulation/ipmulitiplex/dnatSubList"; } - - + /** * 异步获取地址池信息 + * * @param request * @param response * @return */ @ResponseBody - @RequestMapping(value = {"/ajaxGetAddrPools"}) - public List ajaxGetAddrPools(HttpServletRequest request, HttpServletResponse response){ + @RequestMapping(value = { "/ajaxGetAddrPools" }) + public List ajaxGetAddrPools(HttpServletRequest request, HttpServletResponse response) { List addrPools = ipAddrPoolCfgService.getEffectiveAddrPool(); - List addrPoolsNew=new ArrayList<>(); + List addrPoolsNew = new ArrayList<>(); for (IpAddrPoolCfg addrPool : addrPools) { Map params = new HashMap(); params.put("addr_pool_id", addrPool.getCfgId()); - String url =Constants.IP_REUSE_CALL_CGI_URL ; - Map resultMap=ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params); - if(!StringUtil.isEmpty(resultMap) - && !StringUtil.isEmpty(resultMap.get("num")) + String url = Constants.IP_REUSE_CALL_CGI_URL; + Map resultMap = ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params); + if (!StringUtil.isEmpty(resultMap) && !StringUtil.isEmpty(resultMap.get("num")) && Integer.parseInt(resultMap.get("num").toString()) > 0) { addrPoolsNew.add(addrPool); } } return addrPoolsNew; } - + /** * 校验地址池是否被策略引用 + * * @param addrPoolIds * @param request * @param response * @return */ @ResponseBody - @RequestMapping(value = {"/ajaxIsUsed"}) - public boolean ajaxIsUsed(String addrPoolIds, HttpServletRequest request, HttpServletResponse response){ + @RequestMapping(value = { "/ajaxIsUsed" }) + public boolean ajaxIsUsed(String addrPoolIds, HttpServletRequest request, HttpServletResponse response) { for (String addrPoolId : addrPoolIds.split(",")) { List ipList = ipMultiplexService.checkAddrPoolIsUsed(addrPoolId); - if(ipList != null && ipList.size() > 0){ + if (ipList != null && ipList.size() > 0) { return false; } } return true; - + } - - - @RequestMapping(value = {"/dnatPolicyList"}) - public String dnatPolicyList(String cfgName,Model model,@ModelAttribute("cfg")IpReuseDnatPolicyCfg cfg, - HttpServletRequest request,HttpServletResponse response) { - //this._ipList(cfgName,model, cfg, request, response); - - Page page = ipMultiplexService.findPageDnat(new Page(request, response,"r"), cfg); + + @RequestMapping(value = { "/dnatPolicyList" }) + public String dnatPolicyList(String cfgName, Model model, @ModelAttribute("cfg") IpReuseDnatPolicyCfg cfg, + HttpServletRequest request, HttpServletResponse response) { + // this._ipList(cfgName,model, cfg, request, response); + + Page page = ipMultiplexService.findPageDnat(new Page(request, response, "r"), cfg); model.addAttribute("page", page); - initFormCondition(model,cfg); - + initFormCondition(model, cfg); + return "/cfg/manipulation/ipmulitiplex/dnatPolicyList2"; } - - @RequestMapping(value = {"/dnatPolicyForm"}) - @RequiresPermissions(value={"dnat_policy:config"}) - public String dnatPolicyForm(String cfgName,Model model,String ids,Integer functionId,IpReuseDnatPolicyCfg cfg) { - //this._ipForm(cfgName,model, ids, functionId, entity); - - if(cfg == null){ - cfg=new IpReuseDnatPolicyCfg(); + + @RequestMapping(value = { "/dnatPolicyForm" }) + @RequiresPermissions(value = { "dnat_policy:config" }) + public String dnatPolicyForm(String cfgName, Model model, String ids, Integer functionId, + IpReuseDnatPolicyCfg cfg) { + // this._ipForm(cfgName,model, ids, functionId, entity); + + if (cfg == null) { + cfg = new IpReuseDnatPolicyCfg(); } - if(!StringUtil.isEmpty(ids)){ - cfg = ipMultiplexService.getDnatPolicyCfg(Long.valueOf(ids),null); + if (!StringUtil.isEmpty(ids)) { + cfg = ipMultiplexService.getDnatPolicyCfg(Long.valueOf(ids), null); initUpdateFormCondition(model, cfg); - }else{ + } else { initFormCondition(model, cfg); } model.addAttribute("_cfg", cfg); return "/cfg/manipulation/ipmulitiplex/dnatPolicyForm2"; } - - @RequestMapping(value = {"/saveOrUpdateDnat"}) + + @RequestMapping(value = { "/saveOrUpdateDnat" }) public String saveOrUpdateDnat(Model model, RedirectAttributes redirectAttributes, IpReuseDnatPolicyCfg cfg, - HttpServletRequest request,HttpServletResponse response) { - try{ + HttpServletRequest request, HttpServletResponse response) { + try { // 添加策略配置信息 ipMultiplexService.saveOrUpdateDnat(cfg, request, response); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e) { + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+cfg.getFunctionId(); + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/dnatPolicyList?functionId=" + cfg.getFunctionId(); } - - @RequestMapping(value = {"/dnatDelete"}) + + @RequestMapping(value = { "/dnatDelete" }) @RequiresPermissions("dnat_policy:config") - public String dnatDelete(String ids, Integer isValid, Integer functionId,RedirectAttributes redirectAttributes) { - //this._deleteIp(cfgName,ids, compileIds, functionId, model); - - try{ - if(!StringUtil.isEmpty(ids)){ - ipMultiplexService.deleteDnat(isValid,ids,functionId); + public String dnatDelete(String ids, Integer isValid, Integer functionId, RedirectAttributes redirectAttributes) { + // this._deleteIp(cfgName,ids, compileIds, functionId, model); + + try { + if (!StringUtil.isEmpty(ids)) { + ipMultiplexService.deleteDnat(isValid, ids, functionId); } - addMessage(redirectAttributes,"success","delete_success"); - }catch(Exception e){ + addMessage(redirectAttributes, "success", "delete_success"); + } catch (Exception e) { logger.error(e); - addMessage(redirectAttributes,"error","delete_failed"); + addMessage(redirectAttributes, "error", "delete_failed"); } - - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+functionId; + + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/dnatPolicyList?functionId=" + functionId; } - - @RequestMapping(value = {"/auditDnat"}) + + @RequestMapping(value = { "/auditDnat" }) @RequiresPermissions("dnat_policy:confirm") - public String auditDnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) { - //this._auditIp(cfgName,ids, cfg, redirectAttributes); - - if(!StringUtil.isEmpty(ids)){ + public String auditDnat(String ids, Integer isAudit, Integer isValid, Integer functionId, + RedirectAttributes redirectAttributes) { + // this._auditIp(cfgName,ids, cfg, redirectAttributes); + + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - ipMultiplexService.auditDnatPolicy(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + ipMultiplexService.auditDnatPolicy(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); - logger.error("DNAT策略配置下发失败:"+e.getMessage()); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("DNAT策略配置下发失败:" + e.getMessage()); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - + } - return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+functionId; + return "redirect:" + adminPath + "/manipulation/ipmulitiplex/dnatPolicyList?functionId=" + functionId; } - - //snat配置导出 - @RequestMapping(value = "exportSnat") - public void exportSnat(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")BaseIpCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - Properties msgProp = getMsgProp(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipCfgService.findPage(pageInfo, entity);// - for (BaseIpCfg baseIp : page.getList()) { - if(StringUtil.isEmpty(baseIp.getGroupName())){ - baseIp.setGroupName(msgProp.getProperty("default_group")); - } - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), BaseIpCfg.class); - String snatNoExport=",client_ip,group_name,server_ip,ip_type,ip_pattern,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),snatNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("snat export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + + // snat配置导出 + @RequestMapping(value = "exportSnat") + public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") BaseIpCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + Properties msgProp = getMsgProp(); + + /* + * //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String + * id:ids.split(",")){ Long.parseLong(id); } //List + * list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename() + * , entity.getFunctionId(), ids); }else{ + */ + // 条件导出数据大于最大导出数,只导出最大导出条数 + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipCfgService.findPage(pageInfo, entity);// + for (BaseIpCfg baseIp : page.getList()) { + if (StringUtil.isEmpty(baseIp.getGroupName())) { + baseIp.setGroupName(msgProp.getProperty("default_group")); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } - - - //dnat配置导出 - @RequestMapping(value = "exportDnat") - public void exportDnat(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")BaseIpCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - Properties msgProp = getMsgProp(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipCfgService.findPage(pageInfo, entity);// - for (BaseIpCfg baseIp : page.getList()) { - if(StringUtil.isEmpty(baseIp.getGroupName())){ - baseIp.setGroupName(msgProp.getProperty("default_group")); - } - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), BaseIpCfg.class); - String snatNoExport=",direction,client_ip,ip_type,ip_pattern,port_pattern,client_port,ir_type,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),snatNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("dnat export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), BaseIpCfg.class); + String snatNoExport = ",client_ip,group_name,server_ip,ip_type,ip_pattern,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + snatNoExport = ",config_time" + snatNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + snatNoExport = ",edit_time" + snatNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + snatNoExport = ",audit_time" + snatNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + snatNoExport = "," + entity.gethColumns() + "," + snatNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), snatNoExport); + dataMap.put(entity.getMenuNameCode(), page.getList()); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("snat export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // dnat配置导出 + @RequestMapping(value = "exportDnat") + public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") BaseIpCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + Properties msgProp = getMsgProp(); + + /* + * //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String + * id:ids.split(",")){ Long.parseLong(id); } //List + * list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename() + * , entity.getFunctionId(), ids); }else{ + */ + // 条件导出数据大于最大导出数,只导出最大导出条数 + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipCfgService.findPage(pageInfo, entity);// + for (BaseIpCfg baseIp : page.getList()) { + if (StringUtil.isEmpty(baseIp.getGroupName())) { + baseIp.setGroupName(msgProp.getProperty("default_group")); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), BaseIpCfg.class); + String snatNoExport = ",direction,client_ip,ip_type,ip_pattern,port_pattern,client_port,ir_type,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + snatNoExport = ",config_time" + snatNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + snatNoExport = ",edit_time" + snatNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + snatNoExport = ",audit_time" + snatNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + snatNoExport = "," + entity.gethColumns() + "," + snatNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), snatNoExport); + dataMap.put(entity.getMenuNameCode(), page.getList()); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("dnat export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AsnPolicyCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AsnPolicyCfgController.java index b35f187f0..b29dc337d 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AsnPolicyCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AsnPolicyCfgController.java @@ -19,87 +19,87 @@ import com.nis.domain.specific.ConfigGroupInfo; import com.nis.exceptions.MaatConvertException; import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; + @Controller @RequestMapping("${adminPath}/cfg/asnPolicy") @Deprecated public class AsnPolicyCfgController extends BaseController { - @RequestMapping(value = {"/list"}) - public String list(Model model,HttpServletRequest request - ,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo entity - ,RedirectAttributes redirectAttributes){ - Page page = asnPolicyCfgService.findPage(new Page(request, response,"r"), entity); + @RequestMapping(value = { "/list" }) + public String list(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) { + Page page = asnPolicyCfgService.findPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/asnPolicyCfgList"; } - @RequestMapping(value = {"/form"}) - @RequiresPermissions(value={"asn:policy:config"}) - public String form(Model model,HttpServletRequest request - ,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "/form" }) + @RequiresPermissions(value = { "asn:policy:config" }) + public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { entity = asnPolicyCfgService.get(Long.parseLong(ids)); initUpdateFormCondition(model, entity); - }else{ - initFormCondition(model,entity); + } else { + initFormCondition(model, entity); } - List policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4); + List policyGroups = asnPolicyCfgService.getConfigGroupInfoList(4); model.addAttribute("policyGroups", policyGroups); model.addAttribute("_cfg", entity); return "/cfg/asnPolicyCfgForm"; } - @RequestMapping(value = {"/saveOrUpdate"}) - @RequiresPermissions(value={"asn:policy:config"}) - public String saveOrUpdate(Model model,HttpServletRequest request - ,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo cfg - ,RedirectAttributes redirectAttributes){ - try{ + + @RequestMapping(value = { "/saveOrUpdate" }) + @RequiresPermissions(value = { "asn:policy:config" }) + public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) { + try { asnPolicyCfgService.saveOrUpdate(cfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("信息保存失败", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + cfg.getFunctionId(); } - @RequestMapping(value = {"/delete"}) - @RequiresPermissions(value={"asn:policy:config"}) - public String delete(Integer isAudit,Integer isValid - ,String ids,Integer functionId - ,RedirectAttributes redirectAttributes){ + + @RequestMapping(value = { "/delete" }) + @RequiresPermissions(value = { "asn:policy:config" }) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { asnPolicyCfgService.delete(functionId, isValid, ids); - return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId; + return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + functionId; } -// @RequestMapping(value = {"/audit"}) -// @RequiresPermissions(value={"asn:policy:confirm"}) -// public String audit(Integer isAudit,Integer isValid,String ids -// ,Integer functionId, RedirectAttributes redirectAttributes) { -// if(!StringUtil.isEmpty(ids)){ -// String[] idArray = ids.split(","); -// Date auditTime=new Date(); -// for(String id :idArray){ -// try { -// asnPolicyCfgService.audit(isAudit,isValid,functionId,id,auditTime); -// } catch (MaatConvertException e) { -// e.printStackTrace(); -// logger.error("dns fake ip配置下发失败:"+e.getMessage()); -// addMessage(redirectAttributes,"error","request_service_failed"); -// } catch (Exception e) { -// e.printStackTrace(); -// logger.error("dns fake ip配置下发失败:"+e.getMessage()); -// addMessage(redirectAttributes,"error","audit_failed"); -// } -// -// } -// -// } -// return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId; -// } + // @RequestMapping(value = {"/audit"}) + // @RequiresPermissions(value={"asn:policy:confirm"}) + // public String audit(Integer isAudit,Integer isValid,String ids + // ,Integer functionId, RedirectAttributes redirectAttributes) { + // if(!StringUtil.isEmpty(ids)){ + // String[] idArray = ids.split(","); + // Date auditTime=new Date(); + // for(String id :idArray){ + // try { + // asnPolicyCfgService.audit(isAudit,isValid,functionId,id,auditTime); + // } catch (MaatConvertException e) { + // e.printStackTrace(); + // logger.error("dns fake ip配置下发失败:"+e.getMessage()); + // addMessage(redirectAttributes,"error","request_service_failed"); + // } catch (Exception e) { + // e.printStackTrace(); + // logger.error("dns fake ip配置下发失败:"+e.getMessage()); + // addMessage(redirectAttributes,"error","audit_failed"); + // } + // + // } + // + // } + // return "redirect:" + adminPath + // +"/cfg/asnPolicy/list?functionId="+functionId; + // } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java index a2be7c3e0..baf8f5bf4 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java @@ -42,1086 +42,1068 @@ import com.nis.web.controller.BaseController; /** * 处理音视频文本业务 + * * @author ddm * */ @Controller @RequestMapping("${adminPath}/ntc/av") -public class AvContentController extends BaseController { - /*****************************voip业务***************/ - //音视频VOIP IP配置新增界面 - @RequestMapping(value = {"/voipForm"}) - @RequiresPermissions(value={"avVoip:config"}) - public String voipFrom(Model model,HttpServletRequest request ,HttpServletResponse response - ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(ids)){ - cfg.setCfgId(Long.parseLong(ids)); - cfg = avContentCfgService.getCfgIndexInfo(cfg); - initUpdateFormCondition(model, cfg); - }else{ - initFormCondition(model,cfg); - } - - model.addAttribute("_cfg", cfg); - return "/cfg/av/voip/voipForm"; +public class AvContentController extends BaseController { + /***************************** voip业务 ***************/ + // 音视频VOIP IP配置新增界面 + @RequestMapping(value = { "/voipForm" }) + @RequiresPermissions(value = { "avVoip:config" }) + public String voipFrom(Model model, HttpServletRequest request, HttpServletResponse response, String compileIds, + String ids, CfgIndexInfo cfg, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { + cfg.setCfgId(Long.parseLong(ids)); + cfg = avContentCfgService.getCfgIndexInfo(cfg); + initUpdateFormCondition(model, cfg); + } else { + initFormCondition(model, cfg); } - //音视频VOIP Account配置新增界面 -/* @RequestMapping(value = {"/voipAccountForm"}) - @RequiresPermissions(value={"avVoipAccount:config"}) - public String voipAccountForm(Model model,HttpServletRequest request ,HttpServletResponse response - ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ - //修改 - if(!StringUtil.isEmpty(compileIds)){ - cfg.setCompileId(Integer.parseInt(compileIds)); - cfg = avContentCfgService.getCfgIndexInfo2(cfg); - initUpdateFormCondition(model, cfg); - }else{ - initFormCondition(model,cfg);//新增 - } - - model.addAttribute("_cfg", cfg); - return "/cfg/av/voip/voipAccountForm"; - }*/ - - //保存voip ip信息 - @RequestMapping(value = {"/saveVoip"}) - public String saveVoip(Model model,HttpServletRequest request,HttpServletResponse response,String ids, - CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ - try{ - avContentCfgService.saveOrUpdateAvVoip(cfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - if(e instanceof MaatConvertException) { - e.printStackTrace(); - logger.error("voip 信息保存失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - e.printStackTrace(); - logger.error("voip 信息保存失败",e); - addMessage(redirectAttributes,"error","save_failed"); - } - } - return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+cfg.getFunctionId(); + + model.addAttribute("_cfg", cfg); + return "/cfg/av/voip/voipForm"; } - //保存voip Account信息 -/* @RequestMapping(value = {"/saveAccountVoip"}) - public String saveAccountVoip(Model model,HttpServletRequest request,HttpServletResponse response,String ids, - CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ - try{ - avContentCfgService.saveOrUpdateAvVoipAccount(cfg); - addMessage(redirectAttributes,"save_success"); - }catch(Exception e){ - if(e instanceof MaatConvertException) { + // 音视频VOIP Account配置新增界面 + /* + * @RequestMapping(value = {"/voipAccountForm"}) + * + * @RequiresPermissions(value={"avVoipAccount:config"}) public String + * voipAccountForm(Model model,HttpServletRequest request + * ,HttpServletResponse response ,String compileIds,String ids, CfgIndexInfo + * cfg ,RedirectAttributes redirectAttributes){ //修改 + * if(!StringUtil.isEmpty(compileIds)){ + * cfg.setCompileId(Integer.parseInt(compileIds)); cfg = + * avContentCfgService.getCfgIndexInfo2(cfg); initUpdateFormCondition(model, + * cfg); }else{ initFormCondition(model,cfg);//新增 } + * + * model.addAttribute("_cfg", cfg); return "/cfg/av/voip/voipAccountForm"; } + */ + + // 保存voip ip信息 + @RequestMapping(value = { "/saveVoip" }) + public String saveVoip(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + CfgIndexInfo cfg, RedirectAttributes redirectAttributes) { + try { + avContentCfgService.saveOrUpdateAvVoip(cfg); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("voip Account信息保存失败",e); - addMessage(redirectAttributes,"request_service_failed"); - }else { + logger.error("voip 信息保存失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("voip Account信息保存失败",e); - addMessage(redirectAttributes,"save_failed"); + logger.error("voip 信息保存失败", e); + addMessage(redirectAttributes, "error", "save_failed"); } } - return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId(); - }*/ - //视频文本VOIP 配置列表 - @RequestMapping(value = {"/voipList"}) - public String voipCfgList(Model model,HttpServletRequest request ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity - ,RedirectAttributes redirectAttributes){ - /*if(entity.getIpPort()== null){ - entity.setIpPort(new IpPortCfg()); - } - if(entity.getVoipAccount()== null){ - entity.setVoipAccount(new AvVoipAccountCfg()); - } - if(entity.getNtcSubscribeIdCfg()==null){ - entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); - }*/ - Page page = avContentCfgService.findPage(new Page(request, response,"r"), entity); + return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + cfg.getFunctionId(); + } + + // 保存voip Account信息 + /* + * @RequestMapping(value = {"/saveAccountVoip"}) public String + * saveAccountVoip(Model model,HttpServletRequest + * request,HttpServletResponse response,String ids, CfgIndexInfo cfg + * ,RedirectAttributes redirectAttributes){ try{ + * avContentCfgService.saveOrUpdateAvVoipAccount(cfg); + * addMessage(redirectAttributes,"save_success"); }catch(Exception e){ if(e + * instanceof MaatConvertException) { e.printStackTrace(); + * logger.error("voip Account信息保存失败",e); + * addMessage(redirectAttributes,"request_service_failed"); }else { + * e.printStackTrace(); logger.error("voip Account信息保存失败",e); + * addMessage(redirectAttributes,"save_failed"); } } return "redirect:" + + * adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId(); } + */ + // 视频文本VOIP 配置列表 + @RequestMapping(value = { "/voipList" }) + public String voipCfgList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) { + /* + * if(entity.getIpPort()== null){ entity.setIpPort(new IpPortCfg()); } + * if(entity.getVoipAccount()== null){ entity.setVoipAccount(new + * AvVoipAccountCfg()); } if(entity.getNtcSubscribeIdCfg()==null){ + * entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); } + */ + Page page = avContentCfgService.findPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/av/voip/voipList"; } - //视频文本VOIP Account配置列表 -/* @RequestMapping(value = {"/voipAccountList"}) - public String voipCfgAccountList(Model model,HttpServletRequest request ,HttpServletResponse response - ,@ModelAttribute("cfg")CfgIndexInfo entity ,RedirectAttributes redirectAttributes){ - if(entity.getVoipAccount()== null){ - entity.setVoipAccount(new AvVoipAccountCfg()); - } - if(entity.getNtcSubscribeIdCfg()==null){ - entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); - } - Page page = avContentCfgService.findAccountPage(new Page(request, response,"r"), entity); - model.addAttribute("page", page); - initPageCondition(model,entity); - return "/cfg/av/voip/voipAccountList"; - }*/ - - - //修改VOIP IP配置状态 - @RequestMapping(value = {"/updateAvVoipValid"}) - @RequiresPermissions(value={"avVoip:config"}) - public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId - ,RedirectAttributes redirectAttributes - ) { + // 视频文本VOIP Account配置列表 + /* + * @RequestMapping(value = {"/voipAccountList"}) public String + * voipCfgAccountList(Model model,HttpServletRequest request + * ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity + * ,RedirectAttributes redirectAttributes){ if(entity.getVoipAccount()== + * null){ entity.setVoipAccount(new AvVoipAccountCfg()); } + * if(entity.getNtcSubscribeIdCfg()==null){ entity.setNtcSubscribeIdCfg(new + * NtcSubscribeIdCfg()); } Page page = + * avContentCfgService.findAccountPage(new Page(request, + * response,"r"), entity); model.addAttribute("page", page); + * initPageCondition(model,entity); return "/cfg/av/voip/voipAccountList"; } + */ + + // 修改VOIP IP配置状态 + @RequestMapping(value = { "/updateAvVoipValid" }) + @RequiresPermissions(value = { "avVoip:config" }) + public String updateVoipValid(Integer isAudit, String compileIds, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { try { - avContentCfgService.updateAvVoipValid(isAudit,isValid,compileIds,functionId); - addMessage(redirectAttributes,"success", "delete_success"); + avContentCfgService.updateAvVoipValid(isAudit, isValid, compileIds, functionId); + addMessage(redirectAttributes, "success", "delete_success"); } catch (Exception e) { - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("voip 信息审核失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.error("voip 信息审核失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("voip 信息审核失败",e); - addMessage(redirectAttributes,"error","delete_failed"); + logger.error("voip 信息审核失败", e); + addMessage(redirectAttributes, "error", "delete_failed"); } } - return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + functionId; } - //修改VOIP account配置状态 -/* @RequestMapping(value = {"/updateAvVoipAccountValid"}) - @RequiresPermissions(value={"avVoipAccount:config"}) - public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId - ,RedirectAttributes redirectAttributes - ) { - try { - avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds,functionId); - } catch (Exception e) { - if(e instanceof MaatConvertException) { - e.printStackTrace(); - logger.error("voip Account信息审核失败",e); - addMessage(redirectAttributes,"request_service_failed"); - }else { - e.printStackTrace(); - logger.error("voip Account信息审核失败",e); - addMessage(redirectAttributes,"audit_failed"); - } - } - return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; - }*/ - //修改VOIP IP配置审核状态 - @RequestMapping(value = {"/auditAvVoip"}) - @RequiresPermissions(value={"avVoip:confirm"}) - public String auditVoip(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + + // 修改VOIP account配置状态 + /* + * @RequestMapping(value = {"/updateAvVoipAccountValid"}) + * + * @RequiresPermissions(value={"avVoipAccount:config"}) public String + * updateVoipAccountValid(Integer isAudit,String compileIds,Integer + * isValid,String ids,Integer functionId ,RedirectAttributes + * redirectAttributes ) { try { + * avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds, + * functionId); } catch (Exception e) { if(e instanceof + * MaatConvertException) { e.printStackTrace(); + * logger.error("voip Account信息审核失败",e); + * addMessage(redirectAttributes,"request_service_failed"); }else { + * e.printStackTrace(); logger.error("voip Account信息审核失败",e); + * addMessage(redirectAttributes,"audit_failed"); } } return "redirect:" + + * adminPath +"/ntc/av/voipAccountList?functionId="+functionId; } + */ + // 修改VOIP IP配置审核状态 + @RequestMapping(value = { "/auditAvVoip" }) + @RequiresPermissions(value = { "avVoip:confirm" }) + public String auditVoip(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - avContentCfgService.auditAvVoip(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); - } catch ( Exception e) { - if(e instanceof MaatConvertException) { + avContentCfgService.auditAvVoip(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("VOIP配置下发失败:"+e.getMessage());; - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.error("VOIP配置下发失败:" + e.getMessage()); + ; + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("VOIP配置下发失败",e); - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("VOIP配置下发失败", e); + addMessage(redirectAttributes, "error", "audit_failed"); } - + } } - - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } return voipCfgList(model, request, response, cfg, redirectAttributes); } - return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + functionId; } - //修改VOIP IP配置审核状态 -/* @RequestMapping(value = {"/auditAvVoipAccount"}) - @RequiresPermissions(value={"avVoipAccount:confirm"}) - public String auditVoipAccount(Integer isAudit,Integer isValid,String ids - ,String compileIds,Integer functionId - ,RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(compileIds)){ - String[] idArray = compileIds.split(","); - Date auditTime=new Date(); - for(String id :idArray){ - try { - avContentCfgService.auditAvVoipAccount(isAudit,isValid,functionId,id,auditTime); - } catch (MaatConvertException e) { - if(e instanceof MaatConvertException) { - e.printStackTrace(); - logger.info("VOIPAccount配置下发失败:"+e.getMessage());; - addMessage(redirectAttributes,"request_service_failed"); - }else { - e.printStackTrace(); - logger.error("VOIPAccount配置下发失败",e); - addMessage(redirectAttributes,"audit_failed"); - } - } - } - - } - return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; - }*/ - + // 修改VOIP IP配置审核状态 + /* + * @RequestMapping(value = {"/auditAvVoipAccount"}) + * + * @RequiresPermissions(value={"avVoipAccount:confirm"}) public String + * auditVoipAccount(Integer isAudit,Integer isValid,String ids ,String + * compileIds,Integer functionId ,RedirectAttributes redirectAttributes) { + * if(!StringUtil.isEmpty(compileIds)){ String[] idArray = + * compileIds.split(","); Date auditTime=new Date(); for(String id + * :idArray){ try { + * avContentCfgService.auditAvVoipAccount(isAudit,isValid,functionId,id, + * auditTime); } catch (MaatConvertException e) { if(e instanceof + * MaatConvertException) { e.printStackTrace(); + * logger.info("VOIPAccount配置下发失败:"+e.getMessage());; + * addMessage(redirectAttributes,"request_service_failed"); }else { + * e.printStackTrace(); logger.error("VOIPAccount配置下发失败",e); + * addMessage(redirectAttributes,"audit_failed"); } } } + * + * } return "redirect:" + adminPath + * +"/ntc/av/voipAccountList?functionId="+functionId; } + */ + /** - * 账号account - * 根据索引表信息异步获取子表信息 + * 账号account 根据索引表信息异步获取子表信息 + * * @return */ - /*@ResponseBody - @RequestMapping(value = "ajaxVoipAccountInfo") - public Map getVoipAccountInfo(CfgIndexInfo cfgIndexInfo) { - Map voipAndAccountInfoMap=new HashMap(); - List voipAccountCfgList=new ArrayList(); - List ntcSubscribeIdCfgList=new ArrayList(); - - voipAccountCfgList = avContentCfgService.getVoipAccountCfgList(cfgIndexInfo); - ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList(cfgIndexInfo); - - voipAndAccountInfoMap.put("account", voipAccountCfgList); - voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); - return voipAndAccountInfoMap; - }*/ + /* + * @ResponseBody + * + * @RequestMapping(value = "ajaxVoipAccountInfo") public Map + * getVoipAccountInfo(CfgIndexInfo cfgIndexInfo) { Map + * voipAndAccountInfoMap=new HashMap(); + * List voipAccountCfgList=new + * ArrayList(); List + * ntcSubscribeIdCfgList=new ArrayList(); + * + * voipAccountCfgList = + * avContentCfgService.getVoipAccountCfgList(cfgIndexInfo); + * ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList( + * cfgIndexInfo); + * + * voipAndAccountInfoMap.put("account", voipAccountCfgList); + * voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); return + * voipAndAccountInfoMap; } + */ /** * 根据索引表信息异步获取子表信息 + * * @return */ - @RequestMapping(value = {"/ajaxVoipIpInfo"}) - public String getVoipIpInfo(Model model,Long cfgId,Integer index,Integer compileId) { + @RequestMapping(value = { "/ajaxVoipIpInfo" }) + public String getVoipIpInfo(Model model, Long cfgId, Integer index, Integer compileId) { CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); cfgIndexInfo.setCfgId(cfgId); cfgIndexInfo.setCompileId(compileId); CfgIndexInfo cfg = avContentCfgService.getCfgIndexInfo(cfgIndexInfo); List tabList = new ArrayList(); - //获取voipIpCfg信息 -/* if(cfg.getVoipIps()!=null){ + // 获取voipIpCfg信息 + /* + * if(cfg.getVoipIps()!=null){ String cfgType = null; for(AvVoipIpCfg + * ip:cfg.getVoipIps()){ if(!ip.getCfgType().equals(cfgType)){ + * tabList.add(new String[]{"1",ip.getCfgType()}); cfgType = + * ip.getCfgType(); } } } + */ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(AvVoipIpCfg ip:cfg.getVoipIps()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); - cfgType = ip.getCfgType(); - } - } - }*/ - if(cfg.getIpPortList()!=null){ - String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - - if(cfg.getVoipAccounts()!=null){ + + if (cfg.getVoipAccounts() != null) { String cfgType = null; - for(AvVoipAccountCfg account:cfg.getVoipAccounts()){ - if(account!=null&&!account.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",account.getCfgType()}); + for (AvVoipAccountCfg account : cfg.getVoipAccounts()) { + if (account != null && !account.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", account.getCfgType() }); cfgType = account.getCfgType(); } } } - //查询关键字 - if(cfg.getNtcSubscribeIdCfgList()!=null){ + // 查询关键字 + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ - if(!ntc.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ntc.getCfgType()}); + for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) { + if (!ntc.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ntc.getCfgType() }); cfgType = ntc.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/av/voip/voipSubList"; } - /*****************************voip业务***************/ - - /*****************************contIp业务***************/ - //视频文本内容配置列表 - @RequestMapping(value = {"/contIpList"}) - public String contIpList(Model model,HttpServletRequest request - ,HttpServletResponse response - ,@ModelAttribute("cfg")BaseIpCfg entity - ,RedirectAttributes redirectAttributes){ - Page page = avContentCfgService.findContIpPage(new Page(request, response,"r"), entity); + + /***************************** voip业务 ***************/ + + /***************************** contIp业务 ***************/ + // 视频文本内容配置列表 + @RequestMapping(value = { "/contIpList" }) + public String contIpList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") BaseIpCfg entity, RedirectAttributes redirectAttributes) { + Page page = avContentCfgService.findContIpPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/av/contIp/contIpList"; } - //音视频CONTIP新增界面 - @RequestMapping(value = {"/contIpForm"}) - @RequiresPermissions(value={"avContIp:config"}) - public String contIpForm(Model model,HttpServletRequest request,HttpServletResponse response - ,String ids,String compileIds - ,BaseIpCfg cfg - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(compileIds)){ + + // 音视频CONTIP新增界面 + @RequestMapping(value = { "/contIpForm" }) + @RequiresPermissions(value = { "avContIp:config" }) + public String contIpForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + String compileIds, BaseIpCfg cfg, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(compileIds)) { cfg.setCompileId(Integer.parseInt(compileIds)); cfg = avContentCfgService.getContIpCfgById(cfg); initUpdateFormCondition(model, cfg); - }else{ - initFormCondition(model,cfg); + } else { + initFormCondition(model, cfg); } model.addAttribute("_cfg", cfg); return "/cfg/av/contIp/contIpForm"; } - - //保存CONTIP信息 - @RequestMapping(value = {"/saveContIp"}) - public String saveContIp(Model model,HttpServletRequest request - ,HttpServletResponse response, - @ModelAttribute("cfg")BaseIpCfg cfg, - @ModelAttribute("areaCfgIds")String areaCfgIds - ,RedirectAttributes redirectAttributes){ - try{ - avContentCfgService.saveOrUpdateContIp(cfg,areaCfgIds); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); + + // 保存CONTIP信息 + @RequestMapping(value = { "/saveContIp" }) + public String saveContIp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") BaseIpCfg cfg, @ModelAttribute("areaCfgIds") String areaCfgIds, + RedirectAttributes redirectAttributes) { + try { + avContentCfgService.saveOrUpdateContIp(cfg, areaCfgIds); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("信息保存失败", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/ntc/av/contIpList?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/ntc/av/contIpList?functionId=" + cfg.getFunctionId(); } - - //修改CONTIP例配置状态 - @RequestMapping(value = {"/updateAvContIpValid"}) - @RequiresPermissions(value={"avContIp:config"}) - public String updateAvContIpValid(Integer isAudit,Integer isValid - ,String ids,Integer functionId - ,RedirectAttributes redirectAttributes){ - avContentCfgService.updateContIpValid(isAudit,isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/av/contIpList?functionId="+functionId; + + // 修改CONTIP例配置状态 + @RequestMapping(value = { "/updateAvContIpValid" }) + @RequiresPermissions(value = { "avContIp:config" }) + public String updateAvContIpValid(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + avContentCfgService.updateContIpValid(isAudit, isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/av/contIpList?functionId=" + functionId; } - //修改CONTIP配置审核 - @RequestMapping(value = {"/auditAvContIp"}) - @RequiresPermissions(value={"avContIp:confirm"}) - public String auditContIp(Integer isAudit,Integer isValid - ,String ids,String compileIds,Integer functionId - , RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(compileIds)){ + + // 修改CONTIP配置审核 + @RequestMapping(value = { "/auditAvContIp" }) + @RequiresPermissions(value = { "avContIp:confirm" }) + public String auditContIp(Integer isAudit, Integer isValid, String ids, String compileIds, Integer functionId, + RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(compileIds)) { String[] idArray = compileIds.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - avContentCfgService.auditContIp(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + avContentCfgService.auditContIp(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { - logger.error("Cont Ip配置下发失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); - }catch (Exception e) { - logger.error("Cont Ip配置下发失败",e); - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("Cont Ip配置下发失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("Cont Ip配置下发失败", e); + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + } - return "redirect:" + adminPath +"/ntc/av/contIpList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/contIpList?functionId=" + functionId; } + // 获取域配置信息 - @RequestMapping(value = {"ajaxAvContIpList"}) - public String ajaxAvContIpList(Model model,Long cfgId,Integer index) { + @RequestMapping(value = { "ajaxAvContIpList" }) + public String ajaxAvContIpList(Model model, Long cfgId, Integer index) { BaseIpCfg baseIpCfg = new BaseIpCfg(); baseIpCfg.setCfgId(cfgId); BaseIpCfg cfg = avContentCfgService.getContIpCfgById(baseIpCfg); List tabList = new ArrayList(); - - tabList.add(new String[]{"1",cfg.getCfgType()}); - if(cfg.getNtcSubscribeIdCfgList()!=null){ + + tabList.add(new String[] { "1", cfg.getCfgType() }); + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(BaseStringCfg subscribeId:cfg.getNtcSubscribeIdCfgList()){ - if(!subscribeId.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",subscribeId.getCfgType()}); + for (BaseStringCfg subscribeId : cfg.getNtcSubscribeIdCfgList()) { + if (!subscribeId.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", subscribeId.getCfgType() }); cfgType = subscribeId.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/av/subList"; } - /*****************************contIp业务***************/ - - /*****************************picIp业务***************/ - //视频文本内容配置列表 - @RequestMapping(value = {"/picIpList"}) - public String picIpList(Model model,HttpServletRequest request - ,HttpServletResponse response - ,@ModelAttribute("cfg")BaseIpCfg entity - ,RedirectAttributes redirectAttributes){ - Page page = avContentCfgService.findPicIpPage(new Page(request, response,"r"), entity); + + /***************************** contIp业务 ***************/ + + /***************************** picIp业务 ***************/ + // 视频文本内容配置列表 + @RequestMapping(value = { "/picIpList" }) + public String picIpList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") BaseIpCfg entity, RedirectAttributes redirectAttributes) { + Page page = avContentCfgService.findPicIpPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/av/picIp/picIpList"; } - //音视频CONTIP新增界面 - @RequestMapping(value = {"/picIpForm"}) - @RequiresPermissions(value={"avPicIp:config"}) - public String picIpForm(Model model,HttpServletRequest request - ,HttpServletResponse response,String ids - ,String compileIds,BaseIpCfg cfg - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(compileIds)){ + + // 音视频CONTIP新增界面 + @RequestMapping(value = { "/picIpForm" }) + @RequiresPermissions(value = { "avPicIp:config" }) + public String picIpForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + String compileIds, BaseIpCfg cfg, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(compileIds)) { cfg.setCompileId(Integer.parseInt(compileIds)); cfg = avContentCfgService.getPicIpCfgById(cfg); initUpdateFormCondition(model, cfg); - }else{ - initFormCondition(model,cfg); + } else { + initFormCondition(model, cfg); } model.addAttribute("_cfg", cfg); return "/cfg/av/picIp/picIpForm"; } - - //保存CONTIP信息 - @RequestMapping(value = {"/savePicIp"}) - public String savePicIp(Model model,HttpServletRequest request - ,HttpServletResponse response, - @ModelAttribute("cfg")BaseIpCfg cfg, - @ModelAttribute("areaCfgIds")String areaCfgIds - ,RedirectAttributes redirectAttributes){ - try{ - avContentCfgService.saveOrUpdatePicIp(cfg,areaCfgIds); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); + + // 保存CONTIP信息 + @RequestMapping(value = { "/savePicIp" }) + public String savePicIp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") BaseIpCfg cfg, @ModelAttribute("areaCfgIds") String areaCfgIds, + RedirectAttributes redirectAttributes) { + try { + avContentCfgService.saveOrUpdatePicIp(cfg, areaCfgIds); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("信息保存失败", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/ntc/av/picIpList?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/ntc/av/picIpList?functionId=" + cfg.getFunctionId(); } - - //修改CONTIP例配置状态 - @RequestMapping(value = {"/updatePicIpValid"}) - @RequiresPermissions(value={"avPicIp:config"}) - public String updateAvPicIpValid(Integer isAudit,Integer isValid - ,String ids,Integer functionId - ,RedirectAttributes redirectAttributes){ - avContentCfgService.updatePicIpValid(isAudit,isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/av/picIpList?functionId="+functionId; + + // 修改CONTIP例配置状态 + @RequestMapping(value = { "/updatePicIpValid" }) + @RequiresPermissions(value = { "avPicIp:config" }) + public String updateAvPicIpValid(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + avContentCfgService.updatePicIpValid(isAudit, isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/av/picIpList?functionId=" + functionId; } - //修改CONTIP配置审核 - @RequestMapping(value = {"/auditPicIp"}) - @RequiresPermissions(value={"avPicIp:confirm"}) - public String auditPicIp(Integer isAudit,Integer isValid,String ids - ,String compileIds,Integer functionId - , RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(compileIds)){ + + // 修改CONTIP配置审核 + @RequestMapping(value = { "/auditPicIp" }) + @RequiresPermissions(value = { "avPicIp:confirm" }) + public String auditPicIp(Integer isAudit, Integer isValid, String ids, String compileIds, Integer functionId, + RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(compileIds)) { String[] idArray = compileIds.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - avContentCfgService.auditPicIp(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + avContentCfgService.auditPicIp(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); - logger.error("Pic Ip配置下发失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); + logger.error("Pic Ip配置下发失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { e.printStackTrace(); - logger.error("Pic Ip配置下发失败",e); - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("Pic Ip配置下发失败", e); + addMessage(redirectAttributes, "error", "audit_failed"); } } - + } - return "redirect:" + adminPath +"/ntc/av/picIpList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/picIpList?functionId=" + functionId; } + // 获取域配置信息 - @RequestMapping(value = {"ajaxAvPicIpList"}) - public String ajaxAvPicIpList(Model model,Long cfgId,Integer index) { + @RequestMapping(value = { "ajaxAvPicIpList" }) + public String ajaxAvPicIpList(Model model, Long cfgId, Integer index) { BaseIpCfg baseIpCfg = new BaseIpCfg(); baseIpCfg.setCfgId(cfgId); BaseIpCfg cfg = avContentCfgService.getPicIpCfgById(baseIpCfg); List tabList = new ArrayList(); - - tabList.add(new String[]{"1",cfg.getCfgType()}); - if(cfg.getNtcSubscribeIdCfgList()!=null){ + + tabList.add(new String[] { "1", cfg.getCfgType() }); + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(BaseStringCfg subscribeId:cfg.getNtcSubscribeIdCfgList()){ - if(!subscribeId.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",subscribeId.getCfgType()}); + for (BaseStringCfg subscribeId : cfg.getNtcSubscribeIdCfgList()) { + if (!subscribeId.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", subscribeId.getCfgType() }); cfgType = subscribeId.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/av/subList"; - } - /*****************************picIp业务***************/ - - - /*****************************contUrl业务***************/ - //视频文本内容配置列表 - @RequestMapping(value = {"/contUrlList"}) - public String contUrlList(Model model,HttpServletRequest request - ,HttpServletResponse response - ,@ModelAttribute("cfg")CfgIndexInfo entity - ,RedirectAttributes redirectAttributes){ - /*if(entity.getIpPort()== null){ - entity.setIpPort(new IpPortCfg()); - } - if(entity.getAvContUrlCfgList()== null){ - entity.setAvContUrlCfg(new AvContUrlCfg());; - } - if(entity.getNtcSubscribeIdCfg()==null){ - entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); - }*/ - Page page = avContentCfgService.findPage(new Page(request, response,"r"), entity); + } + + /***************************** picIp业务 ***************/ + + /***************************** contUrl业务 ***************/ + // 视频文本内容配置列表 + @RequestMapping(value = { "/contUrlList" }) + public String contUrlList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) { + /* + * if(entity.getIpPort()== null){ entity.setIpPort(new IpPortCfg()); } + * if(entity.getAvContUrlCfgList()== null){ entity.setAvContUrlCfg(new + * AvContUrlCfg());; } if(entity.getNtcSubscribeIdCfg()==null){ + * entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); } + */ + Page page = avContentCfgService.findPage(new Page(request, response, "r"), entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/av/contUrl/contUrlList"; } - //音视频CONTUrl新增界面 - @RequestMapping(value = {"/contUrlForm"}) - @RequiresPermissions(value={"avContUrl:config"}) - public String contUrlForm(Model model,HttpServletRequest request ,HttpServletResponse response - ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(ids)){ + + // 音视频CONTUrl新增界面 + @RequestMapping(value = { "/contUrlForm" }) + @RequiresPermissions(value = { "avContUrl:config" }) + public String contUrlForm(Model model, HttpServletRequest request, HttpServletResponse response, String compileIds, + String ids, CfgIndexInfo cfg, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { cfg.setCfgId(Long.parseLong(ids)); cfg = avContentCfgService.getUrlCfgIndexInfo(cfg); AvContUrlCfg urlCfg = new AvContUrlCfg(); urlCfg.setCfgType("NTC_STREAMING_MEDIA_URL"); cfg.setAvContUrlCfg(urlCfg); - if(cfg.getAvContUrlCfgList().size()==0){ + if (cfg.getAvContUrlCfgList().size() == 0) { cfg.getAvContUrlCfgList().add(urlCfg); } initUpdateFormCondition(model, cfg); - }else{ + } else { AvContUrlCfg urlCfg = new AvContUrlCfg(); urlCfg.setCfgType("NTC_STREAMING_MEDIA_URL"); cfg.setAvContUrlCfg(urlCfg); - List urlList=new ArrayList(); + List urlList = new ArrayList(); urlList.add(urlCfg); cfg.setAvContUrlCfgList(urlList); - initFormCondition(model,cfg); + initFormCondition(model, cfg); } model.addAttribute("_cfg", cfg); return "/cfg/av/contUrl/contUrlForm"; } - - //保存CONTUrl信息 - @RequestMapping(value = {"/saveContUrl"}) - public String saveContUrl(Model model,HttpServletRequest request,HttpServletResponse response,String ids, - CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ - try{ + + // 保存CONTUrl信息 + @RequestMapping(value = { "/saveContUrl" }) + public String saveContUrl(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + CfgIndexInfo cfg, RedirectAttributes redirectAttributes) { + try { avContentCfgService.saveOrUpdateContUrl(cfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - if(e instanceof MaatConvertException) { + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("Stream Media 信息保存失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.error("Stream Media 信息保存失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("Stream Media 信息保存失败",e); - addMessage(redirectAttributes,"error","save_failed"); + logger.error("Stream Media 信息保存失败", e); + addMessage(redirectAttributes, "error", "save_failed"); } } - return "redirect:" + adminPath +"/ntc/av/contUrlList?functionId="+cfg.getFunctionId(); + return "redirect:" + adminPath + "/ntc/av/contUrlList?functionId=" + cfg.getFunctionId(); } - - //修改CONTUrl例配置状态 - @RequestMapping(value = {"/updateAvContUrlValid"}) - @RequiresPermissions(value={"avContUrl:config"}) - public String updateAvContUrlValid(Integer isAudit,Integer isValid - ,String ids,Integer functionId - ,RedirectAttributes redirectAttributes){ - avContentCfgService.updateContUrlValid(isAudit,isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/av/contUrlList?functionId="+functionId; + + // 修改CONTUrl例配置状态 + @RequestMapping(value = { "/updateAvContUrlValid" }) + @RequiresPermissions(value = { "avContUrl:config" }) + public String updateAvContUrlValid(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + avContentCfgService.updateContUrlValid(isAudit, isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/av/contUrlList?functionId=" + functionId; } - //修改CONTUrl配置审核 - @RequestMapping(value = {"/auditAvContUrl"}) - @RequiresPermissions(value={"avContUrl:confirm"}) - public String auditContUrl(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + + // 修改CONTUrl配置审核 + @RequestMapping(value = { "/auditAvContUrl" }) + @RequiresPermissions(value = { "avContUrl:confirm" }) + public String auditContUrl(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - avContentCfgService.auditContUrl(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); - } catch ( Exception e) { + avContentCfgService.auditContUrl(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { e.printStackTrace(); - logger.info("Cont Url配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.info("Cont Url配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } return contUrlList(model, request, response, cfg, redirectAttributes); } - return "redirect:" + adminPath +"/ntc/av/contUrlList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/contUrlList?functionId=" + functionId; } + // 获取域配置信息 - @RequestMapping(value = {"ajaxAvContUrlList"}) - public String ajaxAvContUrlList(Model model,Long cfgId,Integer index,Integer compileId) { + @RequestMapping(value = { "ajaxAvContUrlList" }) + public String ajaxAvContUrlList(Model model, Long cfgId, Integer index, Integer compileId) { CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); cfgIndexInfo.setCfgId(cfgId); cfgIndexInfo.setCompileId(compileId); CfgIndexInfo cfg = avContentCfgService.getUrlCfgIndexInfo(cfgIndexInfo); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getAvContUrlCfgList()!=null){ + if (cfg.getAvContUrlCfgList() != null) { String cfgType = null; - for(AvContUrlCfg avContUrlCfg:cfg.getAvContUrlCfgList()){ - if(!avContUrlCfg.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",avContUrlCfg.getCfgType()}); + for (AvContUrlCfg avContUrlCfg : cfg.getAvContUrlCfgList()) { + if (!avContUrlCfg.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", avContUrlCfg.getCfgType() }); cfgType = avContUrlCfg.getCfgType(); } } } - - - //查询关键字 - if(cfg.getNtcSubscribeIdCfgList()!=null){ + + // 查询关键字 + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ - if(!ntc.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ntc.getCfgType()}); + for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) { + if (!ntc.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ntc.getCfgType() }); cfgType = ntc.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/av/contUrl/contSubList"; } - /*****************************contUrl业务***************/ - - - /*****************************picUrl业务***************/ - //视频文本内容配置列表 - @RequestMapping(value = {"/picUrlList"}) - public String picUrlList(Model model,HttpServletRequest request - ,HttpServletResponse response - ,@ModelAttribute("cfg")BaseStringCfg entity - ,RedirectAttributes redirectAttributes){ - Page page = avContentCfgService.findPicUrlPage(new Page(request, response,"r"), entity); + + /***************************** contUrl业务 ***************/ + + /***************************** picUrl业务 ***************/ + // 视频文本内容配置列表 + @RequestMapping(value = { "/picUrlList" }) + public String picUrlList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") BaseStringCfg entity, RedirectAttributes redirectAttributes) { + Page page = avContentCfgService.findPicUrlPage(new Page(request, response, "r"), + entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/av/picUrl/picUrlList"; } - //音视频CONTUrl新增界面 - @RequestMapping(value = {"/picUrlForm"}) - @RequiresPermissions(value={"avPicUrl:config"}) - public String picUrlForm(Model model,HttpServletRequest request - ,HttpServletResponse response,String ids - ,String compileIds,@ModelAttribute("cfg")BaseStringCfg cfg - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(compileIds)){ + + // 音视频CONTUrl新增界面 + @RequestMapping(value = { "/picUrlForm" }) + @RequiresPermissions(value = { "avPicUrl:config" }) + public String picUrlForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + String compileIds, @ModelAttribute("cfg") BaseStringCfg cfg, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(compileIds)) { cfg.setCompileId(Integer.parseInt(compileIds)); cfg = avContentCfgService.getPicUrlCfgById(cfg); initUpdateFormCondition(model, cfg); - }else{ - initFormCondition(model,cfg); + } else { + initFormCondition(model, cfg); } model.addAttribute("_cfg", cfg); return "/cfg/av/picUrl/picUrlForm"; } - - //保存CONTUrl信息 - @RequestMapping(value = {"/savePicUrl"}) - public String savePicUrl(Model model,HttpServletRequest request - ,HttpServletResponse response, - @ModelAttribute("cfg")BaseStringCfg cfg, - @ModelAttribute("areaCfgIds")String areaCfgIds - ,RedirectAttributes redirectAttributes){ - try{ - avContentCfgService.saveOrUpdatePicUrl(cfg,areaCfgIds); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + + // 保存CONTUrl信息 + @RequestMapping(value = { "/savePicUrl" }) + public String savePicUrl(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") BaseStringCfg cfg, @ModelAttribute("areaCfgIds") String areaCfgIds, + RedirectAttributes redirectAttributes) { + try { + avContentCfgService.saveOrUpdatePicUrl(cfg, areaCfgIds); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("信息保存失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/ntc/av/picUrlList?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/ntc/av/picUrlList?functionId=" + cfg.getFunctionId(); } - - //修改CONTUrl例配置状态 - @RequestMapping(value = {"/updateAvPicUrlValid"}) - @RequiresPermissions(value={"avPicUrl:config"}) - public String updateAvPicUrlValid(Integer isAudit,Integer isValid - ,String ids,Integer functionId - ,RedirectAttributes redirectAttributes){ - avContentCfgService.updatePicUrlValid(isAudit,isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/av/picUrlList?functionId="+functionId; + + // 修改CONTUrl例配置状态 + @RequestMapping(value = { "/updateAvPicUrlValid" }) + @RequiresPermissions(value = { "avPicUrl:config" }) + public String updateAvPicUrlValid(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + avContentCfgService.updatePicUrlValid(isAudit, isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/av/picUrlList?functionId=" + functionId; } - //修改CONTUrl配置审核 - @RequestMapping(value = {"/auditAvPicUrl"}) - @RequiresPermissions(value={"avPicUrl:confirm"}) - public String auditPicUrl(Integer isAudit,Integer isValid - ,String ids,String compileIds,Integer functionId - , RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(compileIds)){ + + // 修改CONTUrl配置审核 + @RequestMapping(value = { "/auditAvPicUrl" }) + @RequiresPermissions(value = { "avPicUrl:confirm" }) + public String auditPicUrl(Integer isAudit, Integer isValid, String ids, String compileIds, Integer functionId, + RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(compileIds)) { String[] idArray = compileIds.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - avContentCfgService.auditPicUrl(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); - } catch ( Exception e) { + avContentCfgService.auditPicUrl(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { e.printStackTrace(); - logger.info("Pic Url配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.info("Pic Url配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - + } - return "redirect:" + adminPath +"/ntc/av/picUrlList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/picUrlList?functionId=" + functionId; } + // 获取域配置信息 - @RequestMapping(value = {"ajaxAvPicUrlList"}) - public String ajaxAvPicUrlList(Model model,Long cfgId,Integer index) { + @RequestMapping(value = { "ajaxAvPicUrlList" }) + public String ajaxAvPicUrlList(Model model, Long cfgId, Integer index) { BaseStringCfg baseStrCfg = new BaseStringCfg(); baseStrCfg.setCfgId(cfgId); BaseStringCfg cfg = avContentCfgService.getPicUrlCfgById(baseStrCfg); List tabList = new ArrayList(); - - tabList.add(new String[]{"2",cfg.getCfgType()}); - if(cfg.getNtcSubscribeIdCfgList()!=null){ + + tabList.add(new String[] { "2", cfg.getCfgType() }); + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg subscribeId:cfg.getNtcSubscribeIdCfgList()){ - if(!subscribeId.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",subscribeId.getCfgType()}); + for (NtcSubscribeIdCfg subscribeId : cfg.getNtcSubscribeIdCfgList()) { + if (!subscribeId.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", subscribeId.getCfgType() }); cfgType = subscribeId.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/av/subList"; } - /*****************************picUrl业务***************/ + + /***************************** picUrl业务 ***************/ /** - * 1、effectiveIds分组展示 - * 2、无effectiveIds查询area_ip,根据compileId查询展示 + * 1、effectiveIds分组展示 2、无effectiveIds查询area_ip,根据compileId查询展示 */ @ResponseBody @RequestMapping(value = "/area/ajaxAreaEffictiveInfo") - public Map ajaxAreaEffictiveInfo(String areaEffectiveIds,Integer compileId) { - Map data=new HashMap(); - - List areaIsps=new ArrayList(); - List areaIps=new ArrayList(); - if(StringUtils.isEmpty(areaEffectiveIds)){ - areaIps=ipCfgService.getAreaCfgByCompileId(compileId); - }else{ - List itTypeList=new ArrayList(); + public Map ajaxAreaEffictiveInfo(String areaEffectiveIds, Integer compileId) { + Map data = new HashMap(); + + List areaIsps = new ArrayList(); + List areaIps = new ArrayList(); + if (StringUtils.isEmpty(areaEffectiveIds)) { + areaIps = ipCfgService.getAreaCfgByCompileId(compileId); + } else { + List itTypeList = new ArrayList(); itTypeList.add(Constants.ITEM_TYPE_AREA); - List areas = sysDictInfoService.findAllSysDictInfo(new SysDictInfo(),itTypeList,null); + List areas = sysDictInfoService.findAllSysDictInfo(new SysDictInfo(), itTypeList, null); itTypeList.clear(); itTypeList.add(Constants.ITEM_TYPE_ISP); - List isps = sysDictInfoService.findAllSysDictInfo(new SysDictInfo(),itTypeList,null); + List isps = sysDictInfoService.findAllSysDictInfo(new SysDictInfo(), itTypeList, null); getAreaIsps(areaEffectiveIds, areaIsps, isps, areas); - + } data.put("areaIsps", areaIsps); data.put("areaIps", areaIps); return data; } - //视频文本VOIP配置列表导出 - @RequestMapping(value = {"/voipExport"}) - public String voipExport(Model model, - HttpServletRequest request, - HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity, - String ids, - RedirectAttributes redirectAttributes){ + + // 视频文本VOIP配置列表导出 + @RequestMapping(value = { "/voipExport" }) + public String voipExport(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { try { - //获取国际化配置 + // 获取国际化配置 Properties msgProp = getMsgProp(); - //获取分类、性质、标签 - List fls=serviceDictInfoService.findAllFlDict(); - List xzs=serviceDictInfoService.findAllXzDict(); - List labels=serviceDictInfoService.findAllLableDict(); - Map map=new HashMap(); + // 获取分类、性质、标签 + List fls = serviceDictInfoService.findAllFlDict(); + List xzs = serviceDictInfoService.findAllXzDict(); + List labels = serviceDictInfoService.findAllLableDict(); + Map map = new HashMap(); map.put("fls", fls); map.put("xzs", xzs); map.put("labels", labels); - - String fileName = "数据-"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx"; - - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - - }else{ - //导出查询条件下的所有记录 - - if(entity.getVoipIp()== null){ - entity.setVoipIp(new AvVoipIpCfg()); - } - if(entity.getVoipAccount()== null){ - entity.setVoipAccount(new AvVoipAccountCfg()); - } - //条件导出数据大于最大导出数,只导出最大导出条数 - Page pageInfo=new Page(request, response,"r"); - if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){ - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - }else{ - pageInfo.setPageNo(1); - pageInfo.setPageSize(-1); - } - Page page = avContentCfgService.findPage(pageInfo, entity); - new ExportExcel(msgProp,null, CfgIndexInfo.class,1).setDataList(msgProp,page.getList(),map).write(response, fileName).dispose(); - } - - return null; - } catch (Exception e) { - e.printStackTrace(); - addMessage(redirectAttributes,"error", "export_failed"); - } - - return "redirect:" + adminPath +"/ntc/av/picUrlList?functionId="+entity.getFunctionId(); - } - - //stream配置导出 - @RequestMapping(value = "exportStream") - public void exportStream(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); + + String fileName = "数据-" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + + } else { + // 导出查询条件下的所有记录 + + if (entity.getVoipIp() == null) { + entity.setVoipIp(new AvVoipIpCfg()); + } + if (entity.getVoipAccount() == null) { + entity.setVoipAccount(new AvVoipAccountCfg()); + } + // 条件导出数据大于最大导出数,只导出最大导出条数 + Page pageInfo = new Page(request, response, "r"); + if (pageInfo.getCount() > Constants.MAX_EXPORT_SIZE) { pageInfo.setPageNo(1); pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - if(entity.getIpPort()== null){ - entity.setIpPort(new IpPortCfg()); - } - if(entity.getAvContUrlCfgList()== null){ - entity.setAvContUrlCfg(new AvContUrlCfg());; - } - if(entity.getNtcSubscribeIdCfg()==null){ - entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); - } - Page page = avContentCfgService.findPage(pageInfo, entity); - ipLists=page.getList(); + } else { + pageInfo.setPageNo(1); + pageInfo.setPageSize(-1); } - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_UNIVERSAL_IP"); - titleList.add("NTC_STREAMING_MEDIA_URL"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); - classMap.put("NTC_STREAMING_MEDIA_URL", BaseStringCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 ntcSubscribeIdCfgNoExport=",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,"; - String regionCfgNoExport=",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,"; - - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport); - noExportMap.put("NTC_STREAMING_MEDIA_URL", regionCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - List streamurlList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=avContentCfgService.exportstream(cfg); - ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); - streamurlList.addAll(maps.get("NTC_STREAMING_MEDIA_URL")); - subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - streamurlList=BaseStringCfg.replaceBaseKeyList(streamurlList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_UNIVERSAL_IP", ipList); - dataMap.put("NTC_STREAMING_MEDIA_URL", streamurlList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("stream export failed",e); - addMessage(redirectAttributes,"error", "export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); - } - - //voip配置导出 - @RequestMapping(value = "exportVoip") - public void exportVoip(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - if(entity.getIpPort()== null){ - entity.setIpPort(new IpPortCfg()); - } - if(entity.getVoipAccount()== null){ - entity.setVoipAccount(new AvVoipAccountCfg()); - } - if(entity.getNtcSubscribeIdCfg()==null){ - entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); - } - Page page = avContentCfgService.findPage(new Page(request, response,"r"), entity); - ipLists=page.getList(); - } - - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_UNIVERSAL_IP"); - titleList.add("NTC_VOIP_ACCOUNT"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); - classMap.put("NTC_VOIP_ACCOUNT", BaseStringCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 ntcSubscribeIdCfgNoExport=",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,"; - String regionCfgNoExport=",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,"; - - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport); - noExportMap.put("NTC_VOIP_ACCOUNT", regionCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - List countlList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=avContentCfgService.exportvoip(cfg); - ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); - countlList.addAll(maps.get("NTC_VOIP_ACCOUNT")); - subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - countlList=BaseStringCfg.replaceBaseKeyList(countlList); - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(),ipLists); - dataMap.put("NTC_UNIVERSAL_IP", ipList); - dataMap.put("NTC_VOIP_ACCOUNT", countlList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("voip export failed",e); - addMessage(redirectAttributes,"error", "export_failed"); + Page page = avContentCfgService.findPage(pageInfo, entity); + new ExportExcel(msgProp, null, CfgIndexInfo.class, 1).setDataList(msgProp, page.getList(), map) + .write(response, fileName).dispose(); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + + return null; + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, "error", "export_failed"); } + + return "redirect:" + adminPath + "/ntc/av/picUrlList?functionId=" + entity.getFunctionId(); + } + + // stream配置导出 + @RequestMapping(value = "exportStream") + public void exportStream(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = avContentCfgService.findPage(pageInfo, entity); + ipLists = page.getList(); + } + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_UNIVERSAL_IP"); + titleList.add("NTC_STREAMING_MEDIA_URL"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); + classMap.put("NTC_STREAMING_MEDIA_URL", BaseStringCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 ntcSubscribeIdCfgNoExport = ",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,"; + String regionCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport); + noExportMap.put("NTC_STREAMING_MEDIA_URL", regionCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + List streamurlList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = avContentCfgService.exportstream(cfg); + ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); + streamurlList.addAll(maps.get("NTC_STREAMING_MEDIA_URL")); + subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + streamurlList = BaseStringCfg.replaceBaseKeyList(streamurlList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_UNIVERSAL_IP", ipList); + dataMap.put("NTC_STREAMING_MEDIA_URL", streamurlList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("stream export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // voip配置导出 + @RequestMapping(value = "exportVoip") + public void exportVoip(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = avContentCfgService.findPage(new Page(request, response, "r"), + entity); + ipLists = page.getList(); + } + + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_UNIVERSAL_IP"); + titleList.add("NTC_VOIP_ACCOUNT"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); + classMap.put("NTC_VOIP_ACCOUNT", BaseStringCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 ntcSubscribeIdCfgNoExport = ",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,"; + String regionCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport); + noExportMap.put("NTC_VOIP_ACCOUNT", regionCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + List countlList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = avContentCfgService.exportvoip(cfg); + ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); + countlList.addAll(maps.get("NTC_VOIP_ACCOUNT")); + subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + countlList = BaseStringCfg.replaceBaseKeyList(countlList); + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_UNIVERSAL_IP", ipList); + dataMap.put("NTC_VOIP_ACCOUNT", countlList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("voip export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java index f72403808..126b59d4e 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java @@ -71,613 +71,671 @@ import it.sauronsoftware.jave.VideoInfo; /** * 处理音视频业务 + * * @author zhangwei * */ @Controller @RequestMapping("${adminPath}/ntc/av") -public class AvController extends BaseController { +public class AvController extends BaseController { - //音视频文件样例配置列表 - @RequestMapping(value = {"/sample/fileSampleList","/sample/fileSampleSpeakerList","/sample/fileSampleLogoList","/sample/fileSampleFaceList"}) - public String fileSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvFileSampleCfg entity){ - Page page = avCfgService.getAvFileSampleList(new Page(request, response,"a"), entity); + // 音视频文件样例配置列表 + @RequestMapping(value = { "/sample/fileSampleList", "/sample/fileSampleSpeakerList", "/sample/fileSampleLogoList", + "/sample/fileSampleFaceList" }) + public String fileSampleList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AvFileSampleCfg entity) { + Page page = avCfgService.getAvFileSampleList(new Page(request, response, "a"), + entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - for(FunctionRegionDict region:regionList){ - model.addAttribute("regionValue",region.getConfigRegionValue()); + for (FunctionRegionDict region : regionList) { + model.addAttribute("regionValue", region.getConfigRegionValue()); break; } return "/cfg/av/fileSampleList"; } - //音视频标志样例配置列表 - @RequestMapping(value = {"/sample/audioSignSampleList"}) - public String audioSignSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvSignSampleCfg entity){ - Page page = avCfgService.getAvSignSampleList(new Page(request, response,"a"), entity); + + // 音视频标志样例配置列表 + @RequestMapping(value = { "/sample/audioSignSampleList" }) + public String audioSignSampleList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AvSignSampleCfg entity) { + Page page = avCfgService.getAvSignSampleList(new Page(request, response, "a"), + entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - for(FunctionRegionDict region:regionList){ - model.addAttribute("regionValue",region.getConfigRegionValue()); + for (FunctionRegionDict region : regionList) { + model.addAttribute("regionValue", region.getConfigRegionValue()); break; } return "/cfg/av/signSampleList"; } - //视频标志样例配置列表 - @RequestMapping(value = {"/sample/signSampleList"}) - public String signSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvSignSampleCfg entity){ + + // 视频标志样例配置列表 + @RequestMapping(value = { "/sample/signSampleList" }) + public String signSampleList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AvSignSampleCfg entity) { List list = avCfgService.getSignSampleList(entity); model.addAttribute("cfgs", list); model.addAttribute("functionId", entity.getFunctionId()); - initPageCondition(model,entity); - /*List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - for(FunctionRegionDict region:regionList){ - model.addAttribute("regionValue",region.getConfigRegionValue()); - break; - }*/ + initPageCondition(model, entity); + /* + * List regionList = + * DictUtils.getFunctionRegionDictList(entity.getFunctionId()); + * for(FunctionRegionDict region:regionList){ + * model.addAttribute("regionValue",region.getConfigRegionValue()); + * break; } + */ List serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId()); model.addAttribute("serviceList", serviceList); - //return "/cfg/av/signSampleList"; + // return "/cfg/av/signSampleList"; return "/cfg/av/switchSignSample"; } + // 日志获取样例获取域配置信息 - @RequestMapping(value = {"ajaxSignSampleList"}) - public String ajaxSignSampleList(Model model,Long cfgId,Integer index,Integer compileId) { + @RequestMapping(value = { "ajaxSignSampleList" }) + public String ajaxSignSampleList(Model model, Long cfgId, Integer index, Integer compileId) { List tabList = new ArrayList(); AvSignSampleCfg cfg = new AvSignSampleCfg(); cfg.setCfgId(cfgId); cfg.setCompileId(compileId); List list = avCfgService.getSignSampleList(cfg); - if(list!=null){ - cfg=list.get(0); + if (list != null) { + cfg = list.get(0); } cfg.setCfgType("5"); - String cfgType = null; - if(cfg.getCfgType()!=null){ - tabList.add(new String[]{"5",cfg.getCfgType()}); - cfgType = cfg.getCfgType(); - } - model.addAttribute("_cfg", cfg); + String cfgType = null; + if (cfg.getCfgType() != null) { + tabList.add(new String[] { "5", cfg.getCfgType() }); + cfgType = cfg.getCfgType(); + } + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/av/switchSignSampleSubList"; } - //文件样例配置界面 - @RequestMapping(value = {"/sample/fileSampleForm"}) - public String fileSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvFileSampleCfg entity){ - if(!StringUtil.isEmpty(ids)){ - entity = avCfgService.getAvFileSampleById(Long.parseLong(ids),null); + // 文件样例配置界面 + @RequestMapping(value = { "/sample/fileSampleForm" }) + public String fileSampleForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + AvFileSampleCfg entity) { + if (!StringUtil.isEmpty(ids)) { + entity = avCfgService.getAvFileSampleById(Long.parseLong(ids), null); } - - initFormCondition(model,entity); + + initFormCondition(model, entity); model.addAttribute("_cfg", entity); return "/cfg/av/fileSampleForm"; } + // 日志获取样例获取域配置信息 - @RequestMapping(value = {"ajaxfileSampleList"}) - public String ajaxAvContIpList(Model model,Long cfgId,Integer index,Integer compileId) { - AvFileSampleCfg cfg = avCfgService.getAvFileSampleById(cfgId,compileId); + @RequestMapping(value = { "ajaxfileSampleList" }) + public String ajaxAvContIpList(Model model, Long cfgId, Integer index, Integer compileId) { + AvFileSampleCfg cfg = avCfgService.getAvFileSampleById(cfgId, compileId); List tabList = new ArrayList(); - if(cfg!=null){ + if (cfg != null) { String cfgType = null; - if(!cfg.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"5",cfg.getCfgType()}); + if (!cfg.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "5", cfg.getCfgType() }); cfgType = cfg.getCfgType(); } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/av/fileSampleSubList"; } - //标志样例配置界面 - @RequestMapping(value = {"/sample/audioSignSampleForm"}) - public String audioSignSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvSignSampleCfg entity){ - if(!StringUtil.isEmpty(ids)){ + + // 标志样例配置界面 + @RequestMapping(value = { "/sample/audioSignSampleForm" }) + public String audioSignSampleForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + AvSignSampleCfg entity) { + if (!StringUtil.isEmpty(ids)) { entity = avCfgService.getAvSignSampleById(Long.parseLong(ids)); } - initFormCondition(model,entity); + initFormCondition(model, entity); model.addAttribute("_cfg", entity); return "/cfg/av/signSampleForm"; } - //保存文件样例配置 - @RequestMapping(value = {"/sample/saveFileSample"}) - public String saveFileSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes, - String ids,AvFileSampleCfg entity,MultipartFile srcFile,MultipartFile sampleFile,String picPath,String videoToPicture){ - try{ -// if(srcFile!=null && sampleFile!=null && -// srcFile.getSize()>0 && sampleFile.getSize()>0){ + + // 保存文件样例配置 + @RequestMapping(value = { "/sample/saveFileSample" }) + public String saveFileSample(Model model, HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes, String ids, AvFileSampleCfg entity, MultipartFile srcFile, + MultipartFile sampleFile, String picPath, String videoToPicture) { + try { + // if(srcFile!=null && sampleFile!=null && + // srcFile.getSize()>0 && sampleFile.getSize()>0){ String sep = System.getProperty("file.separator"); - String srcFilePath = Constants.AV_FILE_PATH+entity.getCfgType()+sep+"srcFile";//源文件保存路径 - String sampleFilePath = Constants.AV_FILE_PATH+entity.getCfgType()+sep+"sampleFile";//样例文件保存路径 - String resultFilePath = Constants.AV_FILE_PATH+entity.getCfgType()+sep+"resultFile";//结果文件保存路径 + String srcFilePath = Constants.AV_FILE_PATH + entity.getCfgType() + sep + "srcFile";// 源文件保存路径 + String sampleFilePath = Constants.AV_FILE_PATH + entity.getCfgType() + sep + "sampleFile";// 样例文件保存路径 + String resultFilePath = Constants.AV_FILE_PATH + entity.getCfgType() + sep + "resultFile";// 结果文件保存路径 FileUtils.createDirectory(srcFilePath); - FileUtils.createDirectory(sampleFilePath); - String fileName = UUID.randomUUID()+""; - - //视频样例生成并选中的图片压缩为zip文件 - if("true".equals(videoToPicture)){ - if(!StringUtils.isBlank(entity.getSrcPath())){ - String[] srcArray = entity.getSrcPath().split("\\|");//所选图片数组 - String srcFileAllPath = srcFilePath+sep+fileName+".zip"; + FileUtils.createDirectory(sampleFilePath); + String fileName = UUID.randomUUID() + ""; + + // 视频样例生成并选中的图片压缩为zip文件 + if ("true".equals(videoToPicture)) { + if (!StringUtils.isBlank(entity.getSrcPath())) { + String[] srcArray = entity.getSrcPath().split("\\|");// 所选图片数组 + String srcFileAllPath = srcFilePath + sep + fileName + ".zip"; File zipFile = new File(srcFileAllPath); ZipOutputStream zouts = new ZipOutputStream(new FileOutputStream(zipFile)); - for(String s:srcArray){ - if(!"".equals(s)){ - String filePath = picPath+sep+s; + for (String s : srcArray) { + if (!"".equals(s)) { + String filePath = picPath + sep + s; File file = new File(filePath); - //将文件添加至压缩文件 + // 将文件添加至压缩文件 FileUtils.zipFilesToZipFile(file.getParent(), file, zouts); file.delete(); } } FileUtils.deleteDirectory(picPath); - if(zouts!=null){ + if (zouts != null) { zouts.close(); } FileInputStream input = new FileInputStream(srcFileAllPath); - srcFile = new MockMultipartFile(zipFile.getName(), input); - if(input!=null){ - input.close(); - } + srcFile = new MockMultipartFile(zipFile.getName(), input); + if (input != null) { + input.close(); + } } } - - if(srcFile!=null && srcFile.getSize()>0 && entity!=null){ + + if (srcFile != null && srcFile.getSize() > 0 && entity != null) { String srcFileAllPath = ""; - if(StringUtil.isBlank(srcFile.getOriginalFilename())){ - srcFileAllPath = srcFilePath+sep+fileName+FileUtils.getSuffix(srcFile.getName(), true); - }else{ - srcFileAllPath = srcFilePath+sep+fileName+FileUtils.getSuffix(srcFile.getOriginalFilename(), true); + if (StringUtil.isBlank(srcFile.getOriginalFilename())) { + srcFileAllPath = srcFilePath + sep + fileName + FileUtils.getSuffix(srcFile.getName(), true); + } else { + srcFileAllPath = srcFilePath + sep + fileName + + FileUtils.getSuffix(srcFile.getOriginalFilename(), true); } - - String sampleFileAllPath = sampleFilePath+sep+fileName+".sample"; - String resultFileAllPath = resultFilePath+sep+fileName+".result"; + + String sampleFileAllPath = sampleFilePath + sep + fileName + ".sample"; + String resultFileAllPath = resultFilePath + sep + fileName + ".result"; entity.setSrcPath(srcFileAllPath); entity.setSamplePath(sampleFileAllPath); entity.setResultPath(resultFileAllPath); - + File uploadSrcFile = new File(srcFileAllPath); - if(!uploadSrcFile.exists()){ - FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);//保存源文件 + if (!uploadSrcFile.exists()) { + FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);// 保存源文件 } entity.setSrcUrl(""); entity.setSampleUrl(""); - /*String host = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); - String srcUrl = host+srcFilePath.substring(srcFilePath.indexOf(Constants.AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+sep+uploadSrcFile.getName(); - String sampleUrl = host+sampleFilePath.substring(sampleFilePath.indexOf(Constants.AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+sep+uploadSampleFile.getName(); - srcUrl = srcUrl.replace("\\", "/"); - sampleUrl = sampleUrl.replace("\\", "/"); - logger.info("srcUrl:"+srcUrl); - logger.info("sampleUrl:"+sampleUrl); - entity.setSrcUrl(srcUrl); - entity.setSampleUrl(sampleUrl);*/ - -// File uploadSrcFile = new File(srcFilePath); -// FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile); -// String srcMd5 = FileUtils.getFileMD5(uploadSrcFile); -// File uploadSampleFile = new File(sampleFilePath); -// String sampleMd5 = FileUtils.getFileMD5(uploadSampleFile); - -// entity.setSrcMd5(srcMd5); -// entity.setSampleMd5(sampleMd5); - - //音频、视频、VoIP、说话人(音频)、人脸识别(视频)样例需要验证时长 - if(Constants.AUDIO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false)) - ||Constants.VIDEO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false)) - ||Constants.VOIP_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false)) - ||Constants.SPEAKER_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false)) - ){ - if(!validateAvDuration(uploadSrcFile)){ - addMessage(redirectAttributes,"error","exceeds_duration_limit"); - logger.error("The duration of uploaded files exceeds the limit("+Constants.AV_DURATION_LIMIT+"s)."); + /* + * String host = + * request.getScheme()+"://"+request.getServerName()+":"+request + * .getServerPort()+request.getContextPath(); String srcUrl = + * host+srcFilePath.substring(srcFilePath.indexOf(Constants. + * AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+sep+ + * uploadSrcFile.getName(); String sampleUrl = + * host+sampleFilePath.substring(sampleFilePath.indexOf( + * Constants.AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+ + * sep+uploadSampleFile.getName(); srcUrl = + * srcUrl.replace("\\", "/"); sampleUrl = + * sampleUrl.replace("\\", "/"); logger.info("srcUrl:"+srcUrl); + * logger.info("sampleUrl:"+sampleUrl); + * entity.setSrcUrl(srcUrl); entity.setSampleUrl(sampleUrl); + */ + + // File uploadSrcFile = new File(srcFilePath); + // FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile); + // String srcMd5 = FileUtils.getFileMD5(uploadSrcFile); + // File uploadSampleFile = new File(sampleFilePath); + // String sampleMd5 = FileUtils.getFileMD5(uploadSampleFile); + + // entity.setSrcMd5(srcMd5); + // entity.setSampleMd5(sampleMd5); + + // 音频、视频、VoIP、说话人(音频)、人脸识别(视频)样例需要验证时长 + if (Constants.AUDIO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false)) + || Constants.VIDEO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false)) + || Constants.VOIP_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false)) + || Constants.SPEAKER_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false))) { + if (!validateAvDuration(uploadSrcFile)) { + addMessage(redirectAttributes, "error", "exceeds_duration_limit"); + logger.error("The duration of uploaded files exceeds the limit(" + Constants.AV_DURATION_LIMIT + + "s)."); throw new MultiPartNewException(this.getMsgProp().getProperty("exceeds_duration_limit")); } } - + } - - + avCfgService.saveOrUpdateAvFileSample(entity, srcFile); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("文件上传失败",e); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("文件上传失败", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else if(e instanceof MultiPartNewException) { - addMessage(redirectAttributes,"error",e.getMessage()); - }else{ - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else if (e instanceof MultiPartNewException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + entity.getFunctionId(); } - //保存标志样例配置 - @RequestMapping(value = {"/sample/saveAudioSignSample"}) - public String saveAudioSignSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes,String ids,AvSignSampleCfg entity){ - try{ + + // 保存标志样例配置 + @RequestMapping(value = { "/sample/saveAudioSignSample" }) + public String saveAudioSignSample(Model model, HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes, String ids, AvSignSampleCfg entity) { + try { avCfgService.saveOrUpdateAvSignSample(entity); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("saveAudioSignSample failed",e); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("saveAudioSignSample failed", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - return "redirect:" + adminPath +"/ntc/av/sample/audioSignSampleList?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/av/sample/audioSignSampleList?functionId=" + entity.getFunctionId(); } - //修改文件样例配置状态 - @RequestMapping(value = {"/sample/updateAvFileSampleValid"}) - public String updateAvFileSampleValid(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes){ - avCfgService.updateAvFileSampleValid(isAudit,isValid,ids); - addMessage(redirectAttributes,"success","delete_success"); - return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+functionId; + + // 修改文件样例配置状态 + @RequestMapping(value = { "/sample/updateAvFileSampleValid" }) + public String updateAvFileSampleValid(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + avCfgService.updateAvFileSampleValid(isAudit, isValid, ids); + addMessage(redirectAttributes, "success", "delete_success"); + return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + functionId; } - //修改文件样例配置审核状态 + + // 修改文件样例配置审核状态 /** * 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次 + * * @param isAudit * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"/sample/auditAvFileSample"}) - public String auditAvFileSample(Model model,@ModelAttribute("cfg")AvFileSampleCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request){ - if(!StringUtil.isEmpty(ids)){ - //avCfgService.auditAvFileSample(isAudit,isValid,ids); + @RequestMapping(value = { "/sample/auditAvFileSample" }) + public String auditAvFileSample(Model model, @ModelAttribute("cfg") AvFileSampleCfg cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { + // avCfgService.auditAvFileSample(isAudit,isValid,ids); AvFileSampleCfg entity = new AvFileSampleCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = avCfgService.getAvFileSampleById(Long.parseLong(id),null); + for (String id : idArray) { + entity = avCfgService.getAvFileSampleById(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); -// String oldSrcUrl = entity.getSrcPath(); -// String oldSampleUrl = entity.getSamplePath(); + // String oldSrcUrl = entity.getSrcPath(); + // String oldSampleUrl = entity.getSamplePath(); try { - /*if(isAudit==1){ - Date creatTime = entity.getCreateTime(); - //音视频文件上传接口调用 - File srcFile = new File(oldSrcUrl); - Map srcMap = new HashMap(); - srcMap.put("filetype", FileUtils.getSuffix(srcFile.getName(), false)); - srcMap.put("datatype", "dbSystem");//源文件存入数据中心 - - srcMap.put("createTime",creatTime); - srcMap.put("key",FileUtils.getPrefix(srcFile.getName(), false)); - srcMap.put("fileName", srcFile.getName()); - srcMap.put("checksum", entity.getSrcMd5()); - ToMaatResult result1 = ConfigServiceUtil.postFileCfg(null, srcFile, JsonMapper.toJsonString(srcMap)); - logger.info("音视频源文件上传响应信息:"+result1); - //获取文件上传响应信息(新的文件访问路径) - String srcAccessUrl = null; - if(!StringUtil.isEmpty(result1)){ - ResponseData data = result1.getData(); - srcAccessUrl=data.getAccessUrl(); - entity.setSrcUrl(srcAccessUrl); -// entity.setSrcPath(""); - } - File sampleFile = new File(oldSampleUrl); - Map sampleMap = new HashMap(); - sampleMap.put("filetype", FileUtils.getSuffix(sampleFile.getName(), false)); - sampleMap.put("datatype", "fileSystem");//样例文件存入fastdfs - sampleMap.put("createTime", creatTime); - sampleMap.put("key",FileUtils.getPrefix(sampleFile.getName(), false)); - sampleMap.put("fileName", sampleFile.getName()); - sampleMap.put("checksum", entity.getSampleMd5()); - ToMaatResult result2 = ConfigServiceUtil.postFileCfg(null, sampleFile, JsonMapper.toJsonString(sampleMap)); - logger.info("音视频样例文件上传响应信息:"+result2); - - //获取文件上传响应信息(新的文件访问路径) - String sampleAccessUrl = null; - if(!StringUtil.isEmpty(result2)){ - ResponseData data = result2.getData(); - sampleAccessUrl = data.getAccessUrl(); - entity.setSampleUrl(sampleAccessUrl); -// entity.setSamplePath(""); - - } - }*/ - avCfgService.auditAvFileSample(entity,isAudit); - //删除本地源文件和样例文件 - /*if(!oldSrcUrl.equals(entity.getSrcUrl())){ - FileUtils.deleteFile(oldSrcUrl); - } - if(!oldSampleUrl.equals(entity.getSampleUrl())){ - FileUtils.deleteFile(oldSampleUrl); - }*/ - addMessage(redirectAttributes,"success", "audit_success"); - }catch(Exception e){ + /* + * if(isAudit==1){ Date creatTime = entity.getCreateTime(); + * //音视频文件上传接口调用 File srcFile = new File(oldSrcUrl); + * Map srcMap = new HashMap(); + * srcMap.put("filetype", + * FileUtils.getSuffix(srcFile.getName(), false)); + * srcMap.put("datatype", "dbSystem");//源文件存入数据中心 + * + * srcMap.put("createTime",creatTime); + * srcMap.put("key",FileUtils.getPrefix(srcFile.getName(), + * false)); srcMap.put("fileName", srcFile.getName()); + * srcMap.put("checksum", entity.getSrcMd5()); ToMaatResult + * result1 = ConfigServiceUtil.postFileCfg(null, srcFile, + * JsonMapper.toJsonString(srcMap)); + * logger.info("音视频源文件上传响应信息:"+result1); + * //获取文件上传响应信息(新的文件访问路径) String srcAccessUrl = null; + * if(!StringUtil.isEmpty(result1)){ ResponseData data = + * result1.getData(); srcAccessUrl=data.getAccessUrl(); + * entity.setSrcUrl(srcAccessUrl); // entity.setSrcPath(""); + * } File sampleFile = new File(oldSampleUrl); + * Map sampleMap = new HashMap(); + * sampleMap.put("filetype", + * FileUtils.getSuffix(sampleFile.getName(), false)); + * sampleMap.put("datatype", "fileSystem");//样例文件存入fastdfs + * sampleMap.put("createTime", creatTime); + * sampleMap.put("key",FileUtils.getPrefix(sampleFile. + * getName(), false)); sampleMap.put("fileName", + * sampleFile.getName()); sampleMap.put("checksum", + * entity.getSampleMd5()); ToMaatResult result2 = + * ConfigServiceUtil.postFileCfg(null, sampleFile, + * JsonMapper.toJsonString(sampleMap)); + * logger.info("音视频样例文件上传响应信息:"+result2); + * + * //获取文件上传响应信息(新的文件访问路径) String sampleAccessUrl = null; + * if(!StringUtil.isEmpty(result2)){ ResponseData data = + * result2.getData(); sampleAccessUrl = data.getAccessUrl(); + * entity.setSampleUrl(sampleAccessUrl); // + * entity.setSamplePath(""); + * + * } } + */ + avCfgService.auditAvFileSample(entity, isAudit); + // 删除本地源文件和样例文件 + /* + * if(!oldSrcUrl.equals(entity.getSrcUrl())){ + * FileUtils.deleteFile(oldSrcUrl); } + * if(!oldSampleUrl.equals(entity.getSampleUrl())){ + * FileUtils.deleteFile(oldSampleUrl); } + */ + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { e.printStackTrace(); - if(e instanceof MaatConvertException) { - logger.info("音视频文件样例配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - logger.error("auditAvFileSample failed",e); - addMessage(redirectAttributes,"error","audit_failed"); + if (e instanceof MaatConvertException) { + logger.info("音视频文件样例配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + logger.error("auditAvFileSample failed", e); + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return fileSampleList(model, request, response, cfg); } - return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + functionId; } - //修改标志样例配置状态 - @RequestMapping(value = {"/sample/updateAvSignSampleValid"}) - public String updateAvSignSampleValid(Integer isAudit,Integer isValid,String ids,Integer functionId){ - avCfgService.updateAvSignSampleValid(isAudit,isValid,ids); - return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+functionId; + + // 修改标志样例配置状态 + @RequestMapping(value = { "/sample/updateAvSignSampleValid" }) + public String updateAvSignSampleValid(Integer isAudit, Integer isValid, String ids, Integer functionId) { + avCfgService.updateAvSignSampleValid(isAudit, isValid, ids); + return "redirect:" + adminPath + "/ntc/av/sample/signSampleList?functionId=" + functionId; } - - //修改标志样例配置审核状态 + + // 修改标志样例配置审核状态 /** * 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次 + * * @param isAudit * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"/sample/auditAvAudioSignSample"}) - public String auditAvAudioSignSample(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes){ -// avCfgService.auditAvSignSample(isAudit,isValid,ids); + @RequestMapping(value = { "/sample/auditAvAudioSignSample" }) + public String auditAvAudioSignSample(Integer isAudit, Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + // avCfgService.auditAvSignSample(isAudit,isValid,ids); AvSignSampleCfg entity = new AvSignSampleCfg(); String[] idArray = ids.split(","); - for(String id :idArray){ + for (String id : idArray) { entity = avCfgService.getAvSignSampleById(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); try { - avCfgService.audioAuditAvSignSample(entity,isAudit,false); - addMessage(redirectAttributes,"success", "audit_success"); - }catch(Exception e){ + avCfgService.audioAuditAvSignSample(entity, isAudit, false); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { e.printStackTrace(); - if(e instanceof MaatConvertException) { - logger.error("音视频标识样例配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - logger.error("auditAvAudioSignSample failed",e); - addMessage(redirectAttributes,"error","audit_failed"); + if (e instanceof MaatConvertException) { + logger.error("音视频标识样例配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + logger.error("auditAvAudioSignSample failed", e); + addMessage(redirectAttributes, "error", "audit_failed"); } } } - return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/sample/signSampleList?functionId=" + functionId; } - //修改标志样例配置审核状态 + + // 修改标志样例配置审核状态 /** * 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次 + * * @param isAudit * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"/sample/auditAvSignSample"}) - public String auditAvSignSample(Integer preset,AvSignSampleCfgModel cfg,Integer functionId,RedirectAttributes redirectAttributes){ - //预置配置 + @RequestMapping(value = { "/sample/auditAvSignSample" }) + public String auditAvSignSample(Integer preset, AvSignSampleCfgModel cfg, Integer functionId, + RedirectAttributes redirectAttributes) { + // 预置配置 try { - if(preset!=null&&1==preset){//预置信息需要在数据库中插入一条记录 + if (preset != null && 1 == preset) {// 预置信息需要在数据库中插入一条记录 for (AvSignSampleCfg avSignSampleCfg : cfg.getCfgs()) { avCfgService.saveOrUpdateAvSignSample(avSignSampleCfg); } - addMessage(redirectAttributes,"success","save_success"); - return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+functionId; + addMessage(redirectAttributes, "success", "save_success"); + return "redirect:" + adminPath + "/ntc/av/sample/signSampleList?functionId=" + functionId; } } catch (Exception e1) { - if(e1 instanceof MaatConvertException) { - logger.error("预置失败",e1); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - logger.error("auditAvSignSample failed",e1); - addMessage(redirectAttributes,"error","save_failed"); + if (e1 instanceof MaatConvertException) { + logger.error("预置失败", e1); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + logger.error("auditAvSignSample failed", e1); + addMessage(redirectAttributes, "error", "save_failed"); } } - //修改下发配置 - if(cfg != null && cfg.getCfgs() != null ){ + // 修改下发配置 + if (cfg != null && cfg.getCfgs() != null) { for (AvSignSampleCfg avSignSampleCfg : cfg.getCfgs()) { - /*if(StringUtil.isEmpty(avSignSampleCfg.getIsValid())){ - avSignSampleCfg.setIsValid(0); - }*/ - if(cfg.getAction()!=null){ + /* + * if(StringUtil.isEmpty(avSignSampleCfg.getIsValid())){ + * avSignSampleCfg.setIsValid(0); } + */ + if (cfg.getAction() != null) { avSignSampleCfg.setAction(cfg.getAction()); } - //isValid值变更才下发 -// if(!avSignSampleCfg.getAction().equals(avSignSampleCfg.getActionOld())||!avSignSampleCfg.getIsValid().equals(avSignSampleCfg.getIsValidOld())){ - try { - avCfgService.auditAvSignSample(avSignSampleCfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - e.printStackTrace(); - if(e instanceof MaatConvertException) { - logger.error("下发失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - logger.error("auditAvSignSample failed",e); - addMessage(redirectAttributes,"error","save_failed"); - } + // isValid值变更才下发 + // if(!avSignSampleCfg.getAction().equals(avSignSampleCfg.getActionOld())||!avSignSampleCfg.getIsValid().equals(avSignSampleCfg.getIsValidOld())){ + try { + avCfgService.auditAvSignSample(avSignSampleCfg); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + e.printStackTrace(); + if (e instanceof MaatConvertException) { + logger.error("下发失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + logger.error("auditAvSignSample failed", e); + addMessage(redirectAttributes, "error", "save_failed"); } } - -// } + } + + // } } - return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/av/sample/signSampleList?functionId=" + functionId; } - - //ysp配置导出 + + // ysp配置导出 @RequestMapping(value = "exportYsp") - public void exportYsp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")AvFileSampleCfg entity,String ids,RedirectAttributes redirectAttributes){ + public void exportYsp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") AvFileSampleCfg entity, String ids, RedirectAttributes redirectAttributes) { try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = avCfgService.getAvFileSampleList(pageInfo, entity); - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), AvFileSampleCfg.class); - String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + /* + * //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String + * id:ids.split(",")){ Long.parseLong(id); } //List + * list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename() + * , entity.getFunctionId(), ids); }else{ + */ + // 条件导出数据大于最大导出数,只导出最大导出条数 + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = avCfgService.getAvFileSampleList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), AvFileSampleCfg.class); + String cfgIndexInfoNoExport = ",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), page.getList()); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } } catch (Exception e) { - logger.error("ysp export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + logger.error("ysp export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } - + /** * 验证音视频时长 - * @throws EncoderException - * @throws InputFormatException + * + * @throws EncoderException + * @throws InputFormatException */ - public boolean validateAvDuration(File file) throws InputFormatException, EncoderException{ - //验证音视频文件时长 + public boolean validateAvDuration(File file) throws InputFormatException, EncoderException { + // 验证音视频文件时长 Encoder encoder = new Encoder(); String length = ""; MultimediaInfo m = encoder.getInfo(file); - long ls = m.getDuration()/1000; - int hour = (int) (ls/3600); - int minute = (int) (ls%3600)/60; - int second = (int) (ls-hour*3600-minute*60); - length = hour+"'"+minute+"''"+second+"'''"; - logger.info(file.getName()+"时长:"+length); - if(ls>0 && ls>Constants.AV_DURATION_LIMIT){ + long ls = m.getDuration() / 1000; + int hour = (int) (ls / 3600); + int minute = (int) (ls % 3600) / 60; + int second = (int) (ls - hour * 3600 - minute * 60); + length = hour + "'" + minute + "''" + second + "'''"; + logger.info(file.getName() + "时长:" + length); + if (ls > 0 && ls > Constants.AV_DURATION_LIMIT) { return false; - }else{ + } else { return true; } } + /** * 上传视频文件,调用脚本生成关键帧图片,返回图片保存路径 + * * @param cfg * @param functionId * @param redirectAttributes * @return */ @ResponseBody - @RequestMapping(value = {"/sample/videoToPicture"}) - public Map videoToPicture(Model model,@RequestParam("srcFile") CommonsMultipartFile srcFile){ - + @RequestMapping(value = { "/sample/videoToPicture" }) + public Map videoToPicture(Model model, @RequestParam("srcFile") CommonsMultipartFile srcFile) { + String sep = System.getProperty("file.separator"); - String random = UUID.randomUUID()+""; - String srcFilePath = Constants.AV_FILE_PATH+"video"+sep+"srcFile";//视频源文件保存路径 - String picFilePath = StringUtils.getUserfilesBaseDir()+"video"+sep+"picFile"+sep+random+sep;//视频生成的关键帧图片文件保存路径 - + String random = UUID.randomUUID() + ""; + String srcFilePath = Constants.AV_FILE_PATH + "video" + sep + "srcFile";// 视频源文件保存路径 + String picFilePath = StringUtils.getUserfilesBaseDir() + "video" + sep + "picFile" + sep + random + sep;// 视频生成的关键帧图片文件保存路径 + FileUtils.createDirectory(srcFilePath); FileUtils.createDirectory(picFilePath); - String srcFileAllPath = srcFilePath+sep+random+FileUtils.getSuffix(srcFile.getOriginalFilename(), true);//新的文件名 + String srcFileAllPath = srcFilePath + sep + random + FileUtils.getSuffix(srcFile.getOriginalFilename(), true);// 新的文件名 File uploadSrcFile = new File(srcFileAllPath); Map map = new HashMap(); map.put("picFilePath", picFilePath); try { Properties msgProp = getMsgProp(); - FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);//保存源文件 - if(validateAvDuration(uploadSrcFile)){ + FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);// 保存源文件 + if (validateAvDuration(uploadSrcFile)) { String shellName = Constants.VEDIO_TO_PICTURE_PROC; -// String params = srcFileAllPath+" "+picFilePath+" 0.95 90.0 0.5"; - String[] params = new String[]{srcFileAllPath,picFilePath}; - logger.info("调用视频转关键帧图片程序:"+shellName+" " +StringUtils.join(params," ")); + // String params = srcFileAllPath+" "+picFilePath+" 0.95 90.0 + // 0.5"; + String[] params = new String[] { srcFileAllPath, picFilePath }; + logger.info("调用视频转关键帧图片程序:" + shellName + " " + StringUtils.join(params, " ")); Map resultMap = avCfgService.execShell(shellName, params); - if(resultMap.get("exitStatus").equals(0)){//调用外部程序成功 - String out = resultMap.get("out").toString();//输出参数 - logger.info("调用视频转关键帧图片程序输出参数:"+out); - JSONArray resArray =JSONArray.fromObject(out); + if (resultMap.get("exitStatus").equals(0)) {// 调用外部程序成功 + String out = resultMap.get("out").toString();// 输出参数 + logger.info("调用视频转关键帧图片程序输出参数:" + out); + JSONArray resArray = JSONArray.fromObject(out); JSONObject resObject = resArray.getJSONObject(0); int state = resObject.getInt("state"); - if(state==1){ - //关键帧图片生成成功,删除原视频文件 + if (state == 1) { + // 关键帧图片生成成功,删除原视频文件 FileUtils.deleteFile(srcFileAllPath); - //获取图片列表 + // 获取图片列表 Collection files = FileUtils.listFiles(new File(picFilePath), null, true); String srcPath = null; - for(File f:files){ - if(srcPath==null){ + for (File f : files) { + if (srcPath == null) { srcPath = f.getName(); - }else{ - srcPath += "|"+f.getName(); + } else { + srcPath += "|" + f.getName(); } } - //将图片文件列表赋值给生成样例的源文件路径参数 + // 将图片文件列表赋值给生成样例的源文件路径参数 map.put("srcPath", srcPath); map.put("status", 1); map.put("msg", "success"); - }else{ - if(StringUtil.isEmpty(resObject.getString("message"))){ + } else { + if (StringUtil.isEmpty(resObject.getString("message"))) { map.put("status", 0); - map.put("msg", msgProp.getProperty("call_external_procedures_failed", "Call external procedures failed")); - }else{ + map.put("msg", msgProp.getProperty("call_external_procedures_failed", + "Call external procedures failed")); + } else { map.put("status", 0); map.put("msg", resObject.getString("message")); } } - - }else{ + + } else { map.put("status", 0); - map.put("msg", msgProp.getProperty("call_external_procedures_failed", "Call external procedures failed")); + map.put("msg", + msgProp.getProperty("call_external_procedures_failed", "Call external procedures failed")); } - }else{ + } else { map.put("status", 0); map.put("msg", msgProp.get("exceeds_duration_limit")); } - + } catch (IOException e) { e.printStackTrace(); map.put("status", 0); @@ -693,31 +751,35 @@ public class AvController extends BaseController { } return map; } + /** * 上传图片文件,调用脚本压缩图片,返回图片保存路径 + * * @param cfg * @param functionId * @param redirectAttributes * @return */ @ResponseBody - @RequestMapping(value = {"/sample/faceToPicture"}) - public Map faceToPicture(Model model,@RequestParam("srcFile") CommonsMultipartFile[] srcFile,@RequestParam("faceFilePath")String faceFilePath){ + @RequestMapping(value = { "/sample/faceToPicture" }) + public Map faceToPicture(Model model, @RequestParam("srcFile") CommonsMultipartFile[] srcFile, + @RequestParam("faceFilePath") String faceFilePath) { String sep = System.getProperty("file.separator"); - String random = UUID.randomUUID()+""; -// String srcFilePath = Constants.AV_FILE_PATH+"face"+random+sep+"srcFile";//视频源文件保存路径 - String srcFilePath=""; - if(StringUtil.isBlank(faceFilePath)){ - srcFilePath = StringUtils.getUserfilesBaseDir()+"face"+sep+"picFile"+sep+random+sep;//视频生成的关键帧图片文件保存路径 - faceFilePath=srcFilePath; + String random = UUID.randomUUID() + ""; + // String srcFilePath = + // Constants.AV_FILE_PATH+"face"+random+sep+"srcFile";//视频源文件保存路径 + String srcFilePath = ""; + if (StringUtil.isBlank(faceFilePath)) { + srcFilePath = StringUtils.getUserfilesBaseDir() + "face" + sep + "picFile" + sep + random + sep;// 视频生成的关键帧图片文件保存路径 + faceFilePath = srcFilePath; FileUtils.createDirectory(srcFilePath); - }else{ - srcFilePath=faceFilePath; + } else { + srcFilePath = faceFilePath; } - //保存源文件 + // 保存源文件 for (CommonsMultipartFile sinFile : srcFile) { - String r = UUID.randomUUID()+""; - String srcFileAllPath = srcFilePath+sep+r+FileUtils.getSuffix(sinFile.getOriginalFilename(), true);//新的文件名 + String r = UUID.randomUUID() + ""; + String srcFileAllPath = srcFilePath + sep + r + FileUtils.getSuffix(sinFile.getOriginalFilename(), true);// 新的文件名 File uploadSrcFile = new File(srcFileAllPath); try { FileCopyUtils.copy(sinFile.getBytes(), uploadSrcFile); @@ -726,60 +788,61 @@ public class AvController extends BaseController { e.printStackTrace(); } } - - + Map map = new HashMap(); map.put("picFilePath", srcFilePath); map.put("faceFilePath", faceFilePath); - - //获取图片列表 + + // 获取图片列表 Collection files = FileUtils.listFiles(new File(srcFilePath), null, true); - String srcPath = null; - for(File f:files){ - if(srcPath==null){ - srcPath = f.getName(); - }else{ - srcPath += "|"+f.getName(); - } - } - //将图片文件列表赋值给生成样例的源文件路径参数 - map.put("srcPath", srcPath); - map.put("status", 1); - map.put("msg", "success"); - + String srcPath = null; + for (File f : files) { + if (srcPath == null) { + srcPath = f.getName(); + } else { + srcPath += "|" + f.getName(); + } + } + // 将图片文件列表赋值给生成样例的源文件路径参数 + map.put("srcPath", srcPath); + map.put("status", 1); + map.put("msg", "success"); + return map; } - @RequestMapping(value = {"/sample/selectVedioPicture"}) - public String selectVedioPicture(Model model,HttpServletRequest request,String picFilePath,String srcPath){ + + @RequestMapping(value = { "/sample/selectVedioPicture" }) + public String selectVedioPicture(Model model, HttpServletRequest request, String picFilePath, String srcPath) { Collection files = FileUtils.listFiles(new File(picFilePath), null, true); - List> fileList = new ArrayList(); - String picUrl = picFilePath.substring(picFilePath.indexOf(Configurations.getStringProperty("userfiles.basedir", "upload"))); + List> fileList = new ArrayList(); + String picUrl = picFilePath + .substring(picFilePath.indexOf(Configurations.getStringProperty("userfiles.basedir", "upload"))); String sep = System.getProperty("file.separator"); String[] checkedPic = null; - if(srcPath!=null){ + if (srcPath != null) { checkedPic = srcPath.split("\\|"); } - for(File f:files){ + for (File f : files) { Map map = new HashMap(); - map.put("picUrl", StringUtils.replace(picUrl+"/"+f.getName(), "\\", "/")); + map.put("picUrl", StringUtils.replace(picUrl + "/" + f.getName(), "\\", "/")); map.put("picName", f.getName()); boolean checked = false; - if(checkedPic!=null){ - for(String pic:checkedPic){ - if(f.getName().equals(pic)){ + if (checkedPic != null) { + for (String pic : checkedPic) { + if (f.getName().equals(pic)) { checked = true; } } - }else{ - checked = true;//默认全选 + } else { + checked = true;// 默认全选 } - + map.put("checked", checked); fileList.add(map); } model.addAttribute("fileList", fileList); - model.addAttribute("picFilePath",picFilePath); + model.addAttribute("picFilePath", picFilePath); return "/cfg/av/videoPictureList"; } - + } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java index 5d2bf2264..e7326b2f7 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java @@ -1,6 +1,5 @@ package com.nis.web.controller.configuration.ntc; - import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -34,227 +33,245 @@ import com.nis.web.security.UserUtils; /** * BGP配置 + * * @author dell * */ @Controller @RequestMapping("${adminPath}/ntc/other/") -public class BgpCfgController extends BaseController{ - - @RequestMapping(value = {"bgpList"}) -// @RequiresPermissions(value={"other:bgp:config"}) - public String bgpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg - ,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); +public class BgpCfgController extends BaseController { + + @RequestMapping(value = { "bgpList" }) + // @RequiresPermissions(value={"other:bgp:config"}) + public String bgpList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = bgpCfgService.getBgpList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/other/bgpList"; } - - @RequestMapping(value = {"bgpForm"}) - @RequiresPermissions(value={"other:bgp:config"}) - public String bgpForm(Model model,String ids,CfgIndexInfo entity,RedirectAttributes redirectAttributes) { - if(StringUtils.isNotBlank(ids)){ - entity = bgpCfgService.getBgpCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + + @RequestMapping(value = { "bgpForm" }) + @RequiresPermissions(value = { "other:bgp:config" }) + public String bgpForm(Model model, String ids, CfgIndexInfo entity, RedirectAttributes redirectAttributes) { + if (StringUtils.isNotBlank(ids)) { + entity = bgpCfgService.getBgpCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/other/bgpForm"; } - - @RequestMapping(value = {"saveBgpCfg"}) - @RequiresPermissions(value={"other:bgp:config"}) - public String saveBgpCfg(Model model,HttpServletRequest request,HttpServletResponse response - ,String ids,CfgIndexInfo entity - ,RedirectAttributes redirectAttributes) { + + @RequestMapping(value = { "saveBgpCfg" }) + @RequiresPermissions(value = { "other:bgp:config" }) + public String saveBgpCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + CfgIndexInfo entity, RedirectAttributes redirectAttributes) { bgpCfgService.saveBgpCfg(entity); - return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + entity.getFunctionId(); } - - @RequestMapping(value = {"ajaxBgpSubList"}) - public String ajaxBgpSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = bgpCfgService.getBgpCfg(cfgId,compileId); + + @RequestMapping(value = { "ajaxBgpSubList" }) + public String ajaxBgpSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = bgpCfgService.getBgpCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getNtcBgpAsCfgList()!=null){ + if (cfg.getNtcBgpAsCfgList() != null) { String cfgType = null; - for(NtcBgpAsCfg ip:cfg.getNtcBgpAsCfgList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ip.getCfgType()}); + for (NtcBgpAsCfg ip : cfg.getNtcBgpAsCfgList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg ip:cfg.getNtcSubscribeIdCfgList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ip.getCfgType()}); + for (NtcSubscribeIdCfg ip : cfg.getNtcSubscribeIdCfgList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - /*TODO - * if(cfg.getDomainList()!=null){ - String cfgType = null; - for(ComplexkeywordCfg keyword:cfg.getDomainList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"3",keyword.getCfgType()}); - cfgType = keyword.getCfgType(); - } - } - }*/ - model.addAttribute("_cfg", cfg); + /* + * TODO if(cfg.getDomainList()!=null){ String cfgType = null; + * for(ComplexkeywordCfg keyword:cfg.getDomainList()){ + * if(!keyword.getCfgType().equals(cfgType)){ tabList.add(new + * String[]{"3",keyword.getCfgType()}); cfgType = keyword.getCfgType(); + * } } } + */ + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/other/bgpSubList"; } - - @RequestMapping(value = {"updateBgpCfgValid"}) - @RequiresPermissions(value={"other:bgp:config"}) - public String updateBgpCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { - bgpCfgService.updateBgpCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId; + + @RequestMapping(value = { "updateBgpCfgValid" }) + @RequiresPermissions(value = { "other:bgp:config" }) + public String updateBgpCfgValid(Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + bgpCfgService.updateBgpCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + functionId; } - - @RequestMapping(value = {"auditBgpCfg"}) - @RequiresPermissions(value={"other:bgp:confirm"}) - public String auditBgpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)) { + + @RequestMapping(value = { "auditBgpCfg" }) + @RequiresPermissions(value = { "other:bgp:confirm" }) + public String auditBgpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = bgpCfgService.getBgpCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = bgpCfgService.getBgpCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - bgpCfgService.auditBgpCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + bgpCfgService.auditBgpCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); - logger.error("bgp配置下发失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); - }catch (Exception e) { + logger.error("bgp配置下发失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { e.printStackTrace(); - logger.error("bgp配置下发失败",e); - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("bgp配置下发失败", e); + addMessage(redirectAttributes, "error", "audit_failed"); } } - }else { - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } return bgpList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + functionId; } - - //bgp配置导出 - @RequestMapping(value = "exportbgp") - public void exportbgp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = bgpCfgService.getBgpList(pageInfo, entity); - ipLists=page.getList(); - } - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_IP"); - titleList.add("NTC_BGP_AS"); -// titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_IP", IpPortCfg.class); - classMap.put("NTC_BGP_AS", BaseStringCfg.class); -// classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 ntcSubscribeIdCfgNoExport=",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,"; - String regionCfgNoExport=",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,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_IP", ipPortInfoNoExport); - noExportMap.put("NTC_BGP_AS", regionCfgNoExport); -// noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - List ipList=new ArrayList(); -// List subscribeInfoList=new ArrayList(); - List asInfoList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - CfgIndexInfo cfgIndexInfo=bgpCfgService.exportbgp(cfg); - ipList.addAll(cfgIndexInfo.getIpPortList()); -// subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); - asInfoList.addAll(cfgIndexInfo.getNtcBgpAsCfgList()); - } - asInfoList=BaseStringCfg.replaceBaseKeyList(asInfoList); -// subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_IP", ipList); - dataMap.put("NTC_BGP_AS", asInfoList); -// dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("bgp export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + + // bgp配置导出 + @RequestMapping(value = "exportbgp") + public void exportbgp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = bgpCfgService.getBgpList(pageInfo, entity); + ipLists = page.getList(); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_IP"); + titleList.add("NTC_BGP_AS"); + // titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_BGP_AS", BaseStringCfg.class); + // classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 ntcSubscribeIdCfgNoExport = ",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,"; + String regionCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_BGP_AS", regionCfgNoExport); + // noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList = new ArrayList(); + // List subscribeInfoList=new + // ArrayList(); + List asInfoList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + CfgIndexInfo cfgIndexInfo = bgpCfgService.exportbgp(cfg); + ipList.addAll(cfgIndexInfo.getIpPortList()); + // subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); + asInfoList.addAll(cfgIndexInfo.getNtcBgpAsCfgList()); + } + asInfoList = BaseStringCfg.replaceBaseKeyList(asInfoList); + // subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_BGP_AS", asInfoList); + // dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("bgp export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java index 6a9b631d1..ff536414c 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java @@ -48,368 +48,365 @@ import com.nis.web.security.UserUtils; /** * 文件传输相关配置控制类 + * * @author dell * */ @Controller @RequestMapping("${adminPath}/ntc/fileTransfer/") -public class FileTransferCfgController extends BaseController{ - @RequestMapping(value = {"ftpList"}) -// @RequiresPermissions(value={"fileTransfer:ftp:config"}) - public String ftpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); +public class FileTransferCfgController extends BaseController { + @RequestMapping(value = { "ftpList" }) + // @RequiresPermissions(value={"fileTransfer:ftp:config"}) + public String ftpList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = fileTransferCfgService.getFtpList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/fileTransfer/ftpList"; } - @RequestMapping(value = {"ftpForm"}) - @RequiresPermissions(value={"fileTransfer:ftp:config"}) - public String ftpForm(Model model,String compileIds,String ids,CfgIndexInfo entity) { - if(StringUtils.isNotBlank(ids)){ - entity = fileTransferCfgService.getFtpCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + + @RequestMapping(value = { "ftpForm" }) + @RequiresPermissions(value = { "fileTransfer:ftp:config" }) + public String ftpForm(Model model, String compileIds, String ids, CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + entity = fileTransferCfgService.getFtpCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/fileTransfer/ftpForm"; } - @RequestMapping(value = {"saveFtpCfg"}) - @RequiresPermissions(value={"fileTransfer:ftp:config"}) - public String saveFtpCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids, - CfgIndexInfo entity,RedirectAttributes redirectAttributes) { + + @RequestMapping(value = { "saveFtpCfg" }) + @RequiresPermissions(value = { "fileTransfer:ftp:config" }) + public String saveFtpCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + CfgIndexInfo entity, RedirectAttributes redirectAttributes) { try { fileTransferCfgService.saveFtpCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("ftp信息保存失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.error("ftp信息保存失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("ftp信息保存失败",e); - addMessage(redirectAttributes,"error","save_failed"); + logger.error("ftp信息保存失败", e); + addMessage(redirectAttributes, "error", "save_failed"); } } - return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/fileTransfer/ftpList?functionId=" + entity.getFunctionId(); } - @RequestMapping(value = {"ajaxFtpSubList"}) - public String ajaxFtpSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = fileTransferCfgService.getFtpCfg(cfgId,compileId); + + @RequestMapping(value = { "ajaxFtpSubList" }) + public String ajaxFtpSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = fileTransferCfgService.getFtpCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getStringList()!=null){ + if (cfg.getStringList() != null) { String cfgType = null; - for(BaseStringCfg keyword:cfg.getStringList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (BaseStringCfg keyword : cfg.getStringList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - //查询关键字 - if(cfg.getNtcSubscribeIdCfgList()!=null){ + // 查询关键字 + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ - if(!ntc.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ntc.getCfgType()}); + for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) { + if (!ntc.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ntc.getCfgType() }); cfgType = ntc.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/fileTransfer/ftpSubList"; } - - + /** * 做删除操作 + * * @param isValid * @param ids * @param functionId * @return */ - @RequestMapping(value = {"updateFtpCfgValid"}) - @RequiresPermissions(value={"fileTransfer:ftp:config"}) - public String updateFtpCfgValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + @RequestMapping(value = { "updateFtpCfgValid" }) + @RequiresPermissions(value = { "fileTransfer:ftp:config" }) + public String updateFtpCfgValid(Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { try { - fileTransferCfgService.updateFtpCfgValid(isValid,ids,functionId); - addMessage(redirectAttributes,"success","delete_success"); + fileTransferCfgService.updateFtpCfgValid(isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); } catch (Exception e) { - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.info("ftp配置删除失败:"+e.getMessage());; - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.info("ftp配置删除失败:" + e.getMessage()); + ; + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("ftp配置删除失败",e); - addMessage(redirectAttributes,"error","delete_failed"); + logger.error("ftp配置删除失败", e); + addMessage(redirectAttributes, "error", "delete_failed"); } } - return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/fileTransfer/ftpList?functionId=" + functionId; } - @RequestMapping(value = {"auditFtpCfg"}) - @RequiresPermissions(value={"fileTransfer:ftp:confirm"}) - public String auditFtpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "auditFtpCfg" }) + @RequiresPermissions(value = { "fileTransfer:ftp:confirm" }) + public String auditFtpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = fileTransferCfgService.getFtpCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = fileTransferCfgService.getFtpCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - fileTransferCfgService.auditFtpCfg(entity,isAudit); - addMessage(redirectAttributes,"success","audit_success"); - } catch ( Exception e) { - if(e instanceof MaatConvertException) { + fileTransferCfgService.auditFtpCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("ftp配置下发失败:"+e.getMessage());; - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.error("ftp配置下发失败:" + e.getMessage()); + ; + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("ftp配置下发失败",e); - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("ftp配置下发失败", e); + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } return ftpList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/fileTransfer/ftpList?functionId=" + functionId; } - - @RequestMapping(value = {"fileDigestList"}) -// @RequiresPermissions(value={"fileTransfer:fileDigest:config"}) - public String fileDigestList(Model model,@ModelAttribute("cfg")FileDigestCfg cfg - ,HttpServletRequest request,HttpServletResponse response - ,RedirectAttributes redirectAttributes) { - Page searchPage=new Page(request,response,"a"); + + @RequestMapping(value = { "fileDigestList" }) + // @RequiresPermissions(value={"fileTransfer:fileDigest:config"}) + public String fileDigestList(Model model, @ModelAttribute("cfg") FileDigestCfg cfg, HttpServletRequest request, + HttpServletResponse response, RedirectAttributes redirectAttributes) { + Page searchPage = new Page(request, response, "a"); Page page = fileTransferCfgService.getFileDigestList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/fileTransfer/fileDigestList"; } - - @RequestMapping(value = {"fileDigestForm"}) - @RequiresPermissions(value={"fileTransfer:fileDigest:config"}) - public String fileDigestForm(Model model,String ids,FileDigestCfg entity,RedirectAttributes redirectAttributes) { - if(StringUtils.isNotBlank(ids)){ - entity = fileTransferCfgService.getFileDigestCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + + @RequestMapping(value = { "fileDigestForm" }) + @RequiresPermissions(value = { "fileTransfer:fileDigest:config" }) + public String fileDigestForm(Model model, String ids, FileDigestCfg entity, RedirectAttributes redirectAttributes) { + if (StringUtils.isNotBlank(ids)) { + entity = fileTransferCfgService.getFileDigestCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/fileTransfer/fileDigestForm"; } - @RequestMapping(value = {"saveFileDigestCfg"}) - @RequiresPermissions(value={"fileTransfer:fileDigest:config"}) - public String saveFileDigestCfg(Model model,HttpServletRequest request - ,HttpServletResponse response,String ids, - FileDigestCfg entity,MultipartFile file - ,@ModelAttribute("areaCfgIds")String areaCfgIds - ,RedirectAttributes redirectAttributes) { - try { - Date fileTime=null; - Date date=new Date(); - if(!StringUtil.isEmpty(entity.getCfgId())){ + + @RequestMapping(value = { "saveFileDigestCfg" }) + @RequiresPermissions(value = { "fileTransfer:fileDigest:config" }) + public String saveFileDigestCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + FileDigestCfg entity, MultipartFile file, @ModelAttribute("areaCfgIds") String areaCfgIds, + RedirectAttributes redirectAttributes) { + try { + Date fileTime = null; + Date date = new Date(); + if (!StringUtil.isEmpty(entity.getCfgId())) { entity.setEditTime(date); - fileTime=entity.getEditTime(); - }else{ + fileTime = entity.getEditTime(); + } else { entity.setCreateTime(date); - fileTime=entity.getCreateTime(); + fileTime = entity.getCreateTime(); } ToMaatResult result = new ToMaatResult(); - if(file!=null && file.getSize()>0 && entity!=null){ + if (file != null && file.getSize() > 0 && entity != null) { String sep = System.getProperty("file.separator"); - String digestFilePath = request.getRealPath("/")+"digestFile"; + String digestFilePath = request.getRealPath("/") + "digestFile"; FileUtils.createDirectory(digestFilePath); - String fileName = UUID.randomUUID()+FileUtils.getSuffix(file.getOriginalFilename(), true); - File uploadFile = new File(digestFilePath+sep+fileName); + String fileName = UUID.randomUUID() + FileUtils.getSuffix(file.getOriginalFilename(), true); + File uploadFile = new File(digestFilePath + sep + fileName); FileCopyUtils.copy(file.getBytes(), uploadFile); Date creatTime = entity.getCreateTime(); - //获取文件摘要接口调用 - Map fileMap = new HashMap(); + // 获取文件摘要接口调用 + Map fileMap = new HashMap(); fileMap.put("filetype", FileUtils.getSuffix(file.getOriginalFilename(), false)); - fileMap.put("datatype", "dbSystem");//源文件存入数据中心 - - fileMap.put("createTime",fileTime); - fileMap.put("key",FileUtils.getPrefix(file.getOriginalFilename(), false)); + fileMap.put("datatype", "dbSystem");// 源文件存入数据中心 + + fileMap.put("createTime", fileTime); + fileMap.put("key", FileUtils.getPrefix(file.getOriginalFilename(), false)); fileMap.put("fileName", file.getOriginalFilename()); String md5 = DigestUtils.md5Hex(file.getBytes()); fileMap.put("checksum", md5); result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap)); - if((result.getData().getRawLen() == null) || (result.getData().getDigest() == null)) { + if ((result.getData().getRawLen() == null) || (result.getData().getDigest() == null)) { logger.error("文件摘要信息获取有误!"); throw new MaatConvertException(""); } - logger.info("获取文件摘要响应信息:"+result); - } - fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds); - addMessage(redirectAttributes,"success","save_success"); - } catch ( Exception e) { - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.info("获取文件摘要响应信息:" + result); + } + fileTransferCfgService.saveOrUpdateFileDigestCfg(entity, result, areaCfgIds); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + entity.getFunctionId(); } - @RequestMapping(value = {"updateFileDigestValid"}) - @RequiresPermissions(value={"fileTransfer:fileDigest:config"}) - public String updateFileDigestValid(Integer isValid,String ids,Integer functionId - ,RedirectAttributes redirectAttributes) { - fileTransferCfgService.updateFileDigestCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+functionId; + + @RequestMapping(value = { "updateFileDigestValid" }) + @RequiresPermissions(value = { "fileTransfer:fileDigest:config" }) + public String updateFileDigestValid(Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { + fileTransferCfgService.updateFileDigestCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + functionId; } - - @RequestMapping(value = {"auditFileDigestCfg"}) - @RequiresPermissions(value={"fileTransfer:fileDigest:confirm"}) - public String auditFileDigestCfg(Model model,@ModelAttribute("cfg")FileDigestCfg cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "auditFileDigestCfg" }) + @RequiresPermissions(value = { "fileTransfer:fileDigest:confirm" }) + public String auditFileDigestCfg(Model model, @ModelAttribute("cfg") FileDigestCfg cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - fileTransferCfgService.auditFileDigestCfg(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); - } catch ( Exception e) { - logger.error("File Digest配置下发失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + fileTransferCfgService.auditFileDigestCfg(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("File Digest配置下发失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } } - - }else { - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } return fileDigestList(model, cfg, request, response, redirectAttributes); } - return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + functionId; } - @RequestMapping(value = {"ajaxFileDigestSubIdList"}) - public String ajaxFileDigestSubIdList(Model model,Long cfgId,Integer index,Integer compileId) { - FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId,compileId); + + @RequestMapping(value = { "ajaxFileDigestSubIdList" }) + public String ajaxFileDigestSubIdList(Model model, Long cfgId, Integer index, Integer compileId) { + FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId, compileId); List tabList = new ArrayList(); - //查询SubscribeId域配置 - if(cfg.getNtcSubscribeIdCfgList()!=null){ + // 查询SubscribeId域配置 + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ - if(!ntc.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",ntc.getCfgType()}); + for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) { + if (!ntc.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", ntc.getCfgType() }); cfgType = ntc.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/fileTransfer/fileDigestSubList"; } - - @RequestMapping(value = {"ajaxFileDigestLogSubIdList"}) - public String ajaxFileDigestLogSubIdList(Model model,Long cfgId,Integer index,Integer compileId) { - FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId,compileId); + + @RequestMapping(value = { "ajaxFileDigestLogSubIdList" }) + public String ajaxFileDigestLogSubIdList(Model model, Long cfgId, Integer index, Integer compileId) { + FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId, compileId); List tabList = new ArrayList(); String cfgType = null; - if(!cfg.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",cfg.getCfgType()}); - cfgType = cfg.getCfgType(); - } - model.addAttribute("_cfg", cfg); + if (!cfg.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", cfg.getCfgType() }); + cfgType = cfg.getCfgType(); + } + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/fileTransfer/fileDigestLogSubList"; } - - - - - @RequestMapping(value = {"p2pList"}) - public String p2pList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); + + @RequestMapping(value = { "p2pList" }) + public String p2pList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = fileTransferCfgService.getP2pList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/fileTransfer/p2pList"; } - - @RequestMapping(value = {"p2pForm"}) - @RequiresPermissions(value={"fileTransfer:p2p:config"}) - public String p2pForm(Model model,String ids,CfgIndexInfo entity) { - // 跳转操作页面(根据ids判断是新增 or 修改) - if(StringUtils.isNotBlank(ids)){ - entity = fileTransferCfgService.getP2pCfg(Long.parseLong(ids),null); - + + @RequestMapping(value = { "p2pForm" }) + @RequiresPermissions(value = { "fileTransfer:p2p:config" }) + public String p2pForm(Model model, String ids, CfgIndexInfo entity) { + // 跳转操作页面(根据ids判断是新增 or 修改) + if (StringUtils.isNotBlank(ids)) { + entity = fileTransferCfgService.getP2pCfg(Long.parseLong(ids), null); + // 添加配置域Key,用于修改页面区分各域配置 P2pHashCfg hashCfg = new P2pHashCfg(); hashCfg.setCfgType(Constants.P2P_HASH_BIN_REGION); @@ -420,19 +417,19 @@ public class FileTransferCfgController extends BaseController{ NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg(); subscribeIdCfg.setCfgType(Constants.NTC_SUBSCRIBE_ID_REGION); entity.setNtcSubscribeIdCfg(subscribeIdCfg); - - if(entity.getP2pHashList().size() == 0) { + + if (entity.getP2pHashList().size() == 0) { entity.getP2pHashList().add(hashCfg); } - if(entity.getP2pKeywordList().size() == 0) { + if (entity.getP2pKeywordList().size() == 0) { entity.getP2pKeywordList().add(keywordCfg); } - if(entity.getNtcSubscribeIdCfgList().size() == 0) { + if (entity.getNtcSubscribeIdCfgList().size() == 0) { entity.getNtcSubscribeIdCfgList().add(subscribeIdCfg); } - - initUpdateFormCondition(model,entity); - }else{ + + initUpdateFormCondition(model, entity); + } else { // 添加配置域Key,用于新增页面区分各域配置 P2pHashCfg hashCfg = new P2pHashCfg(); hashCfg.setCfgType(Constants.P2P_HASH_BIN_REGION); @@ -443,7 +440,7 @@ public class FileTransferCfgController extends BaseController{ NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg(); subscribeIdCfg.setCfgType(Constants.NTC_SUBSCRIBE_ID_REGION); entity.setNtcSubscribeIdCfg(subscribeIdCfg); - + List hashList = new ArrayList(); hashList.add(hashCfg); entity.setP2pHashList(hashList); @@ -453,366 +450,431 @@ public class FileTransferCfgController extends BaseController{ ArrayList subscribeIdList = new ArrayList(); subscribeIdList.add(subscribeIdCfg); entity.setNtcSubscribeIdCfgList(subscribeIdList); - - initFormCondition(model,entity); + + initFormCondition(model, entity); } - + model.addAttribute("_cfg", entity); return "/cfg/fileTransfer/p2pForm"; } - - @RequestMapping(value = {"saveP2pCfg"}) - @RequiresPermissions(value={"fileTransfer:p2p:config"}) - public String saveP2pCfg(Model model,HttpServletRequest request,HttpServletResponse response, - String ids,CfgIndexInfo entity,RedirectAttributes redirectAttributes) { + + @RequestMapping(value = { "saveP2pCfg" }) + @RequiresPermissions(value = { "fileTransfer:p2p:config" }) + public String saveP2pCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + CfgIndexInfo entity, RedirectAttributes redirectAttributes) { try { fileTransferCfgService.saveP2pCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("P2P信息保存失败",e); - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.error("P2P信息保存失败", e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("P2P信息保存失败",e); - addMessage(redirectAttributes,"error","save_failed"); + logger.error("P2P信息保存失败", e); + addMessage(redirectAttributes, "error", "save_failed"); } } - return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/fileTransfer/p2pList?functionId=" + entity.getFunctionId(); } - - @RequestMapping(value = {"updateP2pCfgValid"}) - @RequiresPermissions(value={"fileTransfer:p2p:config"}) - public String updateP2pCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { + + @RequestMapping(value = { "updateP2pCfgValid" }) + @RequiresPermissions(value = { "fileTransfer:p2p:config" }) + public String updateP2pCfgValid(Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { try { - fileTransferCfgService.updateP2pCfgValid(isValid,ids,functionId); - addMessage(redirectAttributes,"success","delete_success"); + fileTransferCfgService.updateP2pCfgValid(isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); } catch (Exception e) { - if(e instanceof MaatConvertException) { + if (e instanceof MaatConvertException) { e.printStackTrace(); - logger.info("P2P配置删除失败:"+e.getMessage());; - addMessage(redirectAttributes,"error","request_service_failed"); - }else { + logger.info("P2P配置删除失败:" + e.getMessage()); + ; + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { e.printStackTrace(); - logger.error("P2P配置删除失败",e); - addMessage(redirectAttributes,"error","delete_failed"); + logger.error("P2P配置删除失败", e); + addMessage(redirectAttributes, "error", "delete_failed"); } } - return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/fileTransfer/p2pList?functionId=" + functionId; } - - @RequestMapping(value = {"ajaxP2pSubList"}) - public String ajaxP2pSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = fileTransferCfgService.getP2pCfg(cfgId,compileId); + + @RequestMapping(value = { "ajaxP2pSubList" }) + public String ajaxP2pSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = fileTransferCfgService.getP2pCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getP2pHashList()!=null){ + if (cfg.getP2pHashList() != null) { String cfgType = null; - for(BaseStringCfg hash:cfg.getP2pHashList()){ - if(!hash.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",hash.getCfgType()}); + for (BaseStringCfg hash : cfg.getP2pHashList()) { + if (!hash.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", hash.getCfgType() }); cfgType = hash.getCfgType(); } } } - if(cfg.getP2pKeywordList()!=null){ + if (cfg.getP2pKeywordList() != null) { String cfgType = null; - for(BaseStringCfg keyword:cfg.getP2pKeywordList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (BaseStringCfg keyword : cfg.getP2pKeywordList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(BaseStringCfg subscribeId:cfg.getNtcSubscribeIdCfgList()){ - if(!subscribeId.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",subscribeId.getCfgType()}); + for (BaseStringCfg subscribeId : cfg.getNtcSubscribeIdCfgList()) { + if (!subscribeId.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", subscribeId.getCfgType() }); cfgType = subscribeId.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/fileTransfer/p2pSubList"; } - - @RequestMapping(value = {"auditP2pCfg"}) - @RequiresPermissions(value={"fileTransfer:p2p:confirm"}) - public String auditP2pCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)) { + + @RequestMapping(value = { "auditP2pCfg" }) + @RequiresPermissions(value = { "fileTransfer:p2p:confirm" }) + public String auditP2pCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = fileTransferCfgService.getP2pCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = fileTransferCfgService.getP2pCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - fileTransferCfgService.auditP2pCfg(entity,isAudit); - addMessage(redirectAttributes,"success","audit_success"); - } catch ( Exception e) { + fileTransferCfgService.auditP2pCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { e.printStackTrace(); - logger.info("p2p配置下发失败:"+e.getMessage()); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); + logger.info("p2p配置下发失败:" + e.getMessage()); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else { - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } return p2pList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/fileTransfer/p2pList?functionId=" + functionId; } - - //ftp配置导出 - @RequestMapping(value = "exportftp") - public void exportftp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = fileTransferCfgService.getFtpList(pageInfo, entity); - ipLists=page.getList(); - } - - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_UNIVERSAL_IP"); - titleList.add("NTC_FTP_URL"); - titleList.add("NTC_FTP_CONTENT"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); - classMap.put("NTC_FTP_URL", BaseStringCfg.class); - classMap.put("NTC_FTP_CONTENT", BaseStringCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 ntcSubscribeIdCfgNoExport=",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,"; - String regionCfgNoExport=",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,"; - - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport); - noExportMap.put("NTC_FTP_URL", regionCfgNoExport); - noExportMap.put("NTC_FTP_CONTENT", regionCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - List ftpkeyList=new ArrayList(); - List ftpurlList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=fileTransferCfgService.exportftp(cfg); - ftpkeyList.addAll(maps.get("NTC_FTP_CONTENT")); - ftpurlList.addAll(maps.get("NTC_FTP_URL")); - ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); - subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - ftpkeyList=BaseStringCfg.replaceBaseKeyList(ftpkeyList); - ftpurlList=BaseStringCfg.replaceBaseKeyList(ftpurlList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_UNIVERSAL_IP", ipList); - dataMap.put("NTC_FTP_URL", ftpurlList); - dataMap.put("NTC_FTP_CONTENT", ftpkeyList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("ftp export failed",e); - addMessage(redirectAttributes,"error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + + // ftp配置导出 + @RequestMapping(value = "exportftp") + public void exportftp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = fileTransferCfgService.getFtpList(pageInfo, entity); + ipLists = page.getList(); } - - //p2p配置导出 - @RequestMapping(value = "exportP2p") - public void exportP2p(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = fileTransferCfgService.getP2pList(pageInfo, entity); - ipLists=page.getList(); - } - - - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_UNIVERSAL_IP"); - titleList.add("NTC_P2P_KEYWORDS"); - titleList.add("NTC_P2P_HASH_BIN"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); - classMap.put("NTC_P2P_KEYWORDS", BaseStringCfg.class); - classMap.put("NTC_P2P_HASH_BIN", BaseStringCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,ir_type,creator,creator" - + ",config_time,editor,edit_time,auditor,audit_time" - +",letter,whether_area_block,classification,attribute,label" - +",userregion2,userregion3,userregion4,userregion5,group_name,&userregion1:p2p_ip_config_type-"; - String ntcSubscribeIdCfgNoExport=",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,"; - String hashCfgNoExport=",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" - +",userregion2,userregion3,userregion4,userregion5,&userregion1:p2p_hash_type-"; - String keyCfgNoExport=",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,"; - - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport); - noExportMap.put("NTC_P2P_KEYWORDS", keyCfgNoExport); - noExportMap.put("NTC_P2P_HASH_BIN", hashCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - List hashList=new ArrayList(); - List keywordList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=fileTransferCfgService.exportp2p(cfg); - keywordList.addAll(maps.get("NTC_P2P_KEYWORDS")); - hashList.addAll(maps.get("NTC_P2P_HASH_BIN")); - ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); - subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - keywordList=BaseStringCfg.replaceBaseKeyList(keywordList); - hashList=BaseStringCfg.replaceBaseKeyList(hashList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_UNIVERSAL_IP", ipList); - dataMap.put("NTC_P2P_KEYWORDS", keywordList); - dataMap.put("NTC_P2P_HASH_BIN", hashList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("p2p export failed",e); - addMessage(redirectAttributes,"error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_UNIVERSAL_IP"); + titleList.add("NTC_FTP_URL"); + titleList.add("NTC_FTP_CONTENT"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); + classMap.put("NTC_FTP_URL", BaseStringCfg.class); + classMap.put("NTC_FTP_CONTENT", BaseStringCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 ntcSubscribeIdCfgNoExport = ",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,"; + String regionCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; } - - - //file配置导出 - @RequestMapping(value = "exportFile") - public void exportFile(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")FileDigestCfg entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = fileTransferCfgService.getFileDigestList(pageInfo, entity); - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), FileDigestCfg.class); - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("file export failed",e); - addMessage(redirectAttributes,"error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport); + noExportMap.put("NTC_FTP_URL", regionCfgNoExport); + noExportMap.put("NTC_FTP_CONTENT", regionCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + List ftpkeyList = new ArrayList(); + List ftpurlList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = fileTransferCfgService.exportftp(cfg); + ftpkeyList.addAll(maps.get("NTC_FTP_CONTENT")); + ftpurlList.addAll(maps.get("NTC_FTP_URL")); + ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); + subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + ftpkeyList = BaseStringCfg.replaceBaseKeyList(ftpkeyList); + ftpurlList = BaseStringCfg.replaceBaseKeyList(ftpurlList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_UNIVERSAL_IP", ipList); + dataMap.put("NTC_FTP_URL", ftpurlList); + dataMap.put("NTC_FTP_CONTENT", ftpkeyList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("ftp export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // p2p配置导出 + @RequestMapping(value = "exportP2p") + public void exportP2p(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = fileTransferCfgService.getP2pList(pageInfo, entity); + ipLists = page.getList(); + } + + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_UNIVERSAL_IP"); + titleList.add("NTC_P2P_KEYWORDS"); + titleList.add("NTC_P2P_HASH_BIN"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); + classMap.put("NTC_P2P_KEYWORDS", BaseStringCfg.class); + classMap.put("NTC_P2P_HASH_BIN", BaseStringCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,ir_type,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + + ",letter,whether_area_block,classification,attribute,label" + + ",userregion2,userregion3,userregion4,userregion5,group_name,&userregion1:p2p_ip_config_type-"; + String ntcSubscribeIdCfgNoExport = ",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,"; + String hashCfgNoExport = ",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" + + ",userregion2,userregion3,userregion4,userregion5,&userregion1:p2p_hash_type-"; + String keyCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport); + noExportMap.put("NTC_P2P_KEYWORDS", keyCfgNoExport); + noExportMap.put("NTC_P2P_HASH_BIN", hashCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + List hashList = new ArrayList(); + List keywordList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = fileTransferCfgService.exportp2p(cfg); + keywordList.addAll(maps.get("NTC_P2P_KEYWORDS")); + hashList.addAll(maps.get("NTC_P2P_HASH_BIN")); + ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); + subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + keywordList = BaseStringCfg.replaceBaseKeyList(keywordList); + hashList = BaseStringCfg.replaceBaseKeyList(hashList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_UNIVERSAL_IP", ipList); + dataMap.put("NTC_P2P_KEYWORDS", keywordList); + dataMap.put("NTC_P2P_HASH_BIN", hashList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("p2p export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // file配置导出 + @RequestMapping(value = "exportFile") + public void exportFile(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") FileDigestCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + /* + * //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String + * id:ids.split(",")){ Long.parseLong(id); } //List + * list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename() + * , entity.getFunctionId(), ids); }else{ + */ + // 条件导出数据大于最大导出数,只导出最大导出条数 + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = fileTransferCfgService.getFileDigestList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), FileDigestCfg.class); + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), page.getList()); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("file export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } } 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 70413da54..97ac790a2 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 @@ -467,6 +467,19 @@ public class IpController extends BaseController{ +",letter,whether_area_block,classification,attribute,label" +",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,"; String asnGroupInfoNoExport=""; + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); noExportMap.put("NTC_IP", ipPortInfoNoExport); noExportMap.put("asn_policy", asnGroupInfoNoExport); @@ -485,9 +498,16 @@ public class IpController extends BaseController{ dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_IP", ipList); dataMap.put("asn_policy", groupInfoList); - + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { logger.error("ip addr export failed",e); addMessage(redirectAttributes,"error", "export_failed"); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java index 0600369d3..2b4d20635 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java @@ -44,275 +44,303 @@ import com.nis.web.security.UserUtils; /** * 邮件相关配置控制类 + * * @author dell * */ @Controller @RequestMapping("${adminPath}/ntc/mail/") -public class MailCfgController extends BaseController{ - @RequestMapping(value = {"mailList"}) -// @RequiresPermissions(value={"mail:config"}) - public String mailList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); +public class MailCfgController extends BaseController { + @RequestMapping(value = { "mailList" }) + // @RequiresPermissions(value={"mail:config"}) + public String mailList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = mailCfgService.getMailList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/mail/mailList"; } - @RequestMapping(value = {"mailForm"}) - @RequiresPermissions(value={"mail:config"}) - public String mailForm(Model model,String ids,CfgIndexInfo entity) { - if(StringUtils.isNotBlank(ids)){ - entity = mailCfgService.getMailCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + + @RequestMapping(value = { "mailForm" }) + @RequiresPermissions(value = { "mail:config" }) + public String mailForm(Model model, String ids, CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + entity = mailCfgService.getMailCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/mail/mailForm"; } - @RequestMapping(value = {"saveMailCfg"}) - @RequiresPermissions(value={"mail:config"}) - public String saveMailCfg( RedirectAttributes redirectAttributes, Model model,HttpServletRequest request,HttpServletResponse response,String ids, - CfgIndexInfo entity,MultipartFile file) { - + + @RequestMapping(value = { "saveMailCfg" }) + @RequiresPermissions(value = { "mail:config" }) + public String saveMailCfg(RedirectAttributes redirectAttributes, Model model, HttpServletRequest request, + HttpServletResponse response, String ids, CfgIndexInfo entity, MultipartFile file) { + try { ToMaatResult result = null; - if(file!=null && file.getSize()>0 && entity.getDigestList()!=null && entity.getDigestList().size()>0){ + if (file != null && file.getSize() > 0 && entity.getDigestList() != null + && entity.getDigestList().size() > 0) { String sep = System.getProperty("file.separator"); - String digestFilePath = request.getRealPath("/")+"digestFile"; + String digestFilePath = request.getRealPath("/") + "digestFile"; FileUtils.createDirectory(digestFilePath); - String fileName = UUID.randomUUID()+FileUtils.getSuffix(file.getOriginalFilename(), true); - File uploadFile = new File(digestFilePath+sep+fileName); + String fileName = UUID.randomUUID() + FileUtils.getSuffix(file.getOriginalFilename(), true); + File uploadFile = new File(digestFilePath + sep + fileName); FileCopyUtils.copy(file.getBytes(), uploadFile); Date creatTime = entity.getCreateTime(); - //获取文件摘要接口调用 - Map fileMap = new HashMap(); + // 获取文件摘要接口调用 + Map fileMap = new HashMap(); fileMap.put("filetype", FileUtils.getSuffix(file.getOriginalFilename(), false)); - fileMap.put("datatype", "dbSystem");//源文件存入数据中心 - - fileMap.put("createTime",creatTime); - fileMap.put("key",FileUtils.getPrefix(file.getOriginalFilename(), false)); + fileMap.put("datatype", "dbSystem");// 源文件存入数据中心 + + fileMap.put("createTime", creatTime); + fileMap.put("key", FileUtils.getPrefix(file.getOriginalFilename(), false)); fileMap.put("fileName", file.getOriginalFilename()); String md5 = DigestUtils.md5Hex(file.getBytes()); fileMap.put("checksum", md5); result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap)); - logger.info("获取文件摘要响应信息:"+result); - } - mailCfgService.saveMailCfg(entity,result); - addMessage(redirectAttributes,"success", "save_success"); - } catch ( Exception e) { - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.info("获取文件摘要响应信息:" + result); + } + mailCfgService.saveMailCfg(entity, result); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+entity.getFunctionId(); + + return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + entity.getFunctionId(); } - @RequestMapping(value = {"ajaxMailSubList"}) - public String ajaxMailSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = mailCfgService.getMailCfg(cfgId,compileId); + + @RequestMapping(value = { "ajaxMailSubList" }) + public String ajaxMailSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = mailCfgService.getMailCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getComplexList()!=null){ + if (cfg.getComplexList() != null) { String cfgType = null; - for(ComplexkeywordCfg keyword:cfg.getComplexList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"3",keyword.getCfgType()}); + for (ComplexkeywordCfg keyword : cfg.getComplexList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "3", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - if(cfg.getDigestList()!=null){ + if (cfg.getDigestList() != null) { String cfgType = null; - for(FileDigestCfg digest:cfg.getDigestList()){ - if(!digest.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"5",digest.getCfgType()}); + for (FileDigestCfg digest : cfg.getDigestList()) { + if (!digest.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "5", digest.getCfgType() }); cfgType = digest.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/mail/mailSubList"; } - @RequestMapping(value = {"updateMailCfgValid"}) - @RequiresPermissions(value={"mail:config"}) - public String updateMailCfgValid(Integer isValid,String ids,Integer functionId) { - mailCfgService.updateMailCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId; + + @RequestMapping(value = { "updateMailCfgValid" }) + @RequiresPermissions(value = { "mail:config" }) + public String updateMailCfgValid(Integer isValid, String ids, Integer functionId) { + mailCfgService.updateMailCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + functionId; } - @RequestMapping(value = {"auditMailCfg"}) - @RequiresPermissions(value={"mail:confirm"}) - public String auditMailCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)) { + + @RequestMapping(value = { "auditMailCfg" }) + @RequiresPermissions(value = { "mail:confirm" }) + public String auditMailCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = mailCfgService.getMailCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = mailCfgService.getMailCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - mailCfgService.auditMailCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); - } catch ( Exception e) { + mailCfgService.auditMailCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { e.printStackTrace(); - logger.error("mail配置下发失败:"+e.getMessage()); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("mail配置下发失败:" + e.getMessage()); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } } - }else { - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } return mailList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + functionId; } - - //mail配置导出 - @RequestMapping(value = "exportmail") - public void exportmail(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = mailCfgService.getMailList(pageInfo, entity); - ipLists=page.getList(); - } - - titleList.add(entity.getMenuNameCode()); - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 ntcSubscribeIdCfgNoExport=",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,"; - String regionCfgNoExport=",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,"; - if(entity.getFunctionId()!=null){ - if(entity.getFunctionId()!=37){ - titleList.add("NTC_IP"); - titleList.add("NTC_MAIL_BODY"); - - classMap.put("NTC_IP", IpPortCfg.class); - classMap.put("NTC_MAIL_BODY", ComplexkeywordCfg.class); - - noExportMap.put("NTC_IP", ipPortInfoNoExport); - noExportMap.put("NTC_MAIL_BODY", regionCfgNoExport); - - } - } - titleList.add("NTC_MAIL_HDR"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_MAIL_HDR", ComplexkeywordCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_MAIL_HDR", regionCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - List mailBodyList=new ArrayList(); - List mailReqHdrList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=mailCfgService.exportmail(cfg); - mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR")); - mailBodyList.addAll(maps.get("NTC_MAIL_BODY")); - ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); - subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - mailBodyList=ComplexkeywordCfg.replaceComplexKeyList(mailBodyList); - mailReqHdrList=ComplexkeywordCfg.replaceComplexKeyList(mailReqHdrList); - if(entity.getFunctionId()!=null){ - if(entity.getFunctionId()!=37){ - dataMap.put("NTC_IP", ipList); - dataMap.put("NTC_MAIL_BODY", mailBodyList); - - } - } - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_MAIL_HDR", mailReqHdrList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("mail export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + + // mail配置导出 + @RequestMapping(value = "exportmail") + public void exportmail(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = mailCfgService.getMailList(pageInfo, entity); + ipLists = page.getList(); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + + titleList.add(entity.getMenuNameCode()); + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 ntcSubscribeIdCfgNoExport = ",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,"; + String regionCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + if (entity.getFunctionId() != null) { + if (entity.getFunctionId() != 37) { + titleList.add("NTC_IP"); + titleList.add("NTC_MAIL_BODY"); + + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_MAIL_BODY", ComplexkeywordCfg.class); + + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_MAIL_BODY", regionCfgNoExport); + + } + } + titleList.add("NTC_MAIL_HDR"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_MAIL_HDR", ComplexkeywordCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_MAIL_HDR", regionCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + List mailBodyList = new ArrayList(); + List mailReqHdrList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = mailCfgService.exportmail(cfg); + mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR")); + mailBodyList.addAll(maps.get("NTC_MAIL_BODY")); + ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); + subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + mailBodyList = ComplexkeywordCfg.replaceComplexKeyList(mailBodyList); + mailReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(mailReqHdrList); + if (entity.getFunctionId() != null) { + if (entity.getFunctionId() != 37) { + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_MAIL_BODY", mailBodyList); + + } + } + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_MAIL_HDR", mailReqHdrList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("mail export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index b2d57d3fe..6ab6a5608 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -50,39 +50,43 @@ import com.nis.web.security.UserUtils; /** * 网站配置 + * * @author dell * */ @Controller @RequestMapping("${adminPath}/ntc/website/") -public class WebsiteController extends BaseController{ - - @RequestMapping(value = {"httpList"}) -// @RequiresPermissions(value={"website:http:config"}) - public String httpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); +public class WebsiteController extends BaseController { + + @RequestMapping(value = { "httpList" }) + // @RequiresPermissions(value={"website:http:config"}) + public String httpList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = websiteCfgService.getWebsiteList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/website/httpList"; } - @RequestMapping(value = {"dnsList"}) -// @RequiresPermissions(value={"website:dns:config"}) - public String dnsList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); + + @RequestMapping(value = { "dnsList" }) + // @RequiresPermissions(value={"website:dns:config"}) + public String dnsList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = websiteCfgService.getWebsiteList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/website/dnsList"; } - - @RequestMapping(value = {"httpForm"}) - @RequiresPermissions(value={"website:http:config"}) - public String httpForm(Model model,String ids,CfgIndexInfo entity) { - if(StringUtils.isNotBlank(ids)){ - entity = websiteCfgService.getHttpCfg(Long.parseLong(ids),null); - - //设置http各类配置的配置域类型 + + @RequestMapping(value = { "httpForm" }) + @RequiresPermissions(value = { "website:http:config" }) + public String httpForm(Model model, String ids, CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + entity = websiteCfgService.getHttpCfg(Long.parseLong(ids), null); + + // 设置http各类配置的配置域类型 IpPortCfg ipCfg = new IpPortCfg(); ipCfg.setCfgType(Constants.HTTP_IP_REGION); entity.setIpPort(ipCfg); @@ -104,39 +108,36 @@ public class WebsiteController extends BaseController{ NtcSubscribeIdCfg subscribeId = new NtcSubscribeIdCfg(); subscribeId.setCfgType(Constants.NTC_SUBSCRIBE_ID); entity.setNtcSubscribeIdCfg(subscribeId); - - int httpReqCfgNum = entity.getIpPortList().size()+ - entity.getHttpUrlList().size()+ - entity.getHttpReqBodyList().size()+ - entity.getHttpReqHdrList().size(); - int httpResCfgNum = entity.getHttpResHdrList().size()+ - entity.getHttpResBodyList().size(); + + int httpReqCfgNum = entity.getIpPortList().size() + entity.getHttpUrlList().size() + + entity.getHttpReqBodyList().size() + entity.getHttpReqHdrList().size(); + int httpResCfgNum = entity.getHttpResHdrList().size() + entity.getHttpResBodyList().size(); model.addAttribute("httpReqCfgNum", httpReqCfgNum); model.addAttribute("httpResCfgNum", httpResCfgNum); - if(entity.getIpPortList().size()==0){ + if (entity.getIpPortList().size() == 0) { entity.getIpPortList().add(ipCfg); } - if(entity.getHttpUrlList().size()==0){ + if (entity.getHttpUrlList().size() == 0) { entity.getHttpUrlList().add(urlCfg); } - if(entity.getHttpReqHdrList().size()==0){ + if (entity.getHttpReqHdrList().size() == 0) { entity.getHttpReqHdrList().add(reqHdrCfg); } - if(entity.getHttpResHdrList().size()==0){ + if (entity.getHttpResHdrList().size() == 0) { entity.getHttpResHdrList().add(resHdrCfg); } - if(entity.getHttpReqBodyList().size()==0){ + if (entity.getHttpReqBodyList().size() == 0) { entity.getHttpReqBodyList().add(reqBodyCfg); } - if(entity.getHttpResBodyList().size()==0){ + if (entity.getHttpResBodyList().size() == 0) { entity.getHttpResBodyList().add(resBodyCfg); } - if(entity.getNtcSubscribeIdCfgList().size()==0){ + if (entity.getNtcSubscribeIdCfgList().size() == 0) { entity.getNtcSubscribeIdCfgList().add(subscribeId); } - initUpdateFormCondition(model,entity); - }else{ - //设置http各类配置的配置域类型 + initUpdateFormCondition(model, entity); + } else { + // 设置http各类配置的配置域类型 IpPortCfg ipCfg = new IpPortCfg(); ipCfg.setCfgType(Constants.HTTP_IP_REGION); entity.setIpPort(ipCfg); @@ -158,774 +159,826 @@ public class WebsiteController extends BaseController{ NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg(); subscribeIdCfg.setCfgType(Constants.NTC_SUBSCRIBE_ID); entity.setNtcSubscribeIdCfg(subscribeIdCfg); - - List ipList=new ArrayList(); + + List ipList = new ArrayList(); ipList.add(ipCfg); entity.setIpPortList(ipList); - List urlList=new ArrayList(); + List urlList = new ArrayList(); urlList.add(urlCfg); entity.setHttpUrlList(urlList); - List reqHdrList=new ArrayList(); + List reqHdrList = new ArrayList(); reqHdrList.add(reqHdrCfg); entity.setHttpReqHdrList(reqHdrList); - List resHdrList=new ArrayList(); + List resHdrList = new ArrayList(); resHdrList.add(resHdrCfg); entity.setHttpResHdrList(resHdrList); - List reqBodyList=new ArrayList(); + List reqBodyList = new ArrayList(); reqBodyList.add(reqBodyCfg); entity.setHttpReqBodyList(reqBodyList); - List resBodyList=new ArrayList(); + List resBodyList = new ArrayList(); resBodyList.add(resBodyCfg); entity.setHttpResBodyList(resBodyList); - List subscribeIdList=new ArrayList(); + List subscribeIdList = new ArrayList(); subscribeIdList.add(subscribeIdCfg); entity.setNtcSubscribeIdCfgList(subscribeIdList); - initFormCondition(model,entity); + initFormCondition(model, entity); } - + model.addAttribute("_cfg", entity); return "/cfg/website/httpForm"; } - - @RequestMapping(value = {"saveHttpCfg"}) - @RequiresPermissions(value={"website:http:config"}) - public String saveHttpCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) { + + @RequestMapping(value = { "saveHttpCfg" }) + @RequiresPermissions(value = { "website:http:config" }) + public String saveHttpCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response, + String ids, CfgIndexInfo entity) { websiteCfgService.saveHttpCfg(entity); - return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + entity.getFunctionId(); } - @RequestMapping(value = {"ajaxHttpSubList"}) - public String ajaxHttpSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = websiteCfgService.getHttpCfg(cfgId,compileId); - model.addAttribute("_cfg", cfg); + + @RequestMapping(value = { "ajaxHttpSubList" }) + public String ajaxHttpSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = websiteCfgService.getHttpCfg(cfgId, compileId); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); return "/cfg/website/httpSubList"; } - @RequestMapping(value = {"updateHttpCfgValid"}) - @RequiresPermissions(value={"website:http:config"}) - public String updateHttpCfgValid(Integer isValid,String ids,Integer functionId) { - websiteCfgService.updateHttpCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+functionId; + + @RequestMapping(value = { "updateHttpCfgValid" }) + @RequiresPermissions(value = { "website:http:config" }) + public String updateHttpCfgValid(Integer isValid, String ids, Integer functionId) { + websiteCfgService.updateHttpCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + functionId; } - @RequestMapping(value = {"auditHttpCfg"}) - @RequiresPermissions(value={"website:http:confirm"}) - public String auditHttpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)) { + + @RequestMapping(value = { "auditHttpCfg" }) + @RequiresPermissions(value = { "website:http:confirm" }) + public String auditHttpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = websiteCfgService.getHttpCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = websiteCfgService.getHttpCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - websiteCfgService.auditHttpCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + websiteCfgService.auditHttpCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { - logger.error("http配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "request_service_failed"); - }catch (Exception e) { - logger.error("http配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("http配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("http配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "audit_failed"); } } - }else{//条件下所有配置审核 - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else {// 条件下所有配置审核 + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return httpList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + functionId; } - @RequestMapping(value = {"sslList"}) -// @RequiresPermissions(value={"website:ssl:config"}) - public String sslList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); + + @RequestMapping(value = { "sslList" }) + // @RequiresPermissions(value={"website:ssl:config"}) + public String sslList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = websiteCfgService.getWebsiteList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/website/sslList"; } - @RequestMapping(value = {"sslForm"}) - @RequiresPermissions(value={"website:ssl:config"}) - public String sslForm(Model model,String ids,CfgIndexInfo entity) { - if(StringUtils.isNotBlank(ids)){ - entity = websiteCfgService.getSslCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + + @RequestMapping(value = { "sslForm" }) + @RequiresPermissions(value = { "website:ssl:config" }) + public String sslForm(Model model, String ids, CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + entity = websiteCfgService.getSslCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/website/sslForm"; } - @RequestMapping(value = {"saveSslCfg"}) - @RequiresPermissions(value={"website:ssl:config"}) - public String saveSslCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) { + + @RequestMapping(value = { "saveSslCfg" }) + @RequiresPermissions(value = { "website:ssl:config" }) + public String saveSslCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response, + String ids, CfgIndexInfo entity) { websiteCfgService.saveSslCfg(entity); - return "redirect:" + adminPath +"/ntc/website/sslList?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/website/sslList?functionId=" + entity.getFunctionId(); } - @RequestMapping(value = {"ajaxSslSubList"}) - public String ajaxSslSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = websiteCfgService.getSslCfg(cfgId,compileId); - /*List regionList = DictUtils.getFunctionRegionDictList(cfg.getFunctionId()); - model.addAttribute("regionList", regionList);*/ + + @RequestMapping(value = { "ajaxSslSubList" }) + public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = websiteCfgService.getSslCfg(cfgId, compileId); + /* + * List regionList = + * DictUtils.getFunctionRegionDictList(cfg.getFunctionId()); + * model.addAttribute("regionList", regionList); + */ List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getSslList()!=null){ + if (cfg.getSslList() != null) { String cfgType = null; - for(BaseStringCfg keyword:cfg.getSslList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (BaseStringCfg keyword : cfg.getSslList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/website/sslSubList"; } - @RequestMapping(value = {"updateSslCfgValid"}) - @RequiresPermissions(value={"website:ssl:config"}) - public String updateSslCfgValid(Integer isValid,String ids,Integer functionId) { - websiteCfgService.updateSslCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/website/sslList?functionId="+functionId; + + @RequestMapping(value = { "updateSslCfgValid" }) + @RequiresPermissions(value = { "website:ssl:config" }) + public String updateSslCfgValid(Integer isValid, String ids, Integer functionId) { + websiteCfgService.updateSslCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/website/sslList?functionId=" + functionId; } - @RequestMapping(value = {"auditSslCfg"}) - @RequiresPermissions(value={"website:ssl:confirm"}) - public String auditSslCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isAudit, - Integer isValid, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletRequest request, - HttpServletResponse response) { - if(!StringUtil.isEmpty(ids)) { + + @RequestMapping(value = { "auditSslCfg" }) + @RequiresPermissions(value = { "website:ssl:confirm" }) + public String auditSslCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isAudit, Integer isValid, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletRequest request, + HttpServletResponse response) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = websiteCfgService.getSslCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = websiteCfgService.getSslCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - websiteCfgService.auditSslCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); - } catch ( Exception e) { + websiteCfgService.auditSslCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { e.printStackTrace(); - logger.error("ssl配置下发失败:"+e.getMessage()); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - - }else if(e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes,"error","call_external_procedures_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + logger.error("ssl配置下发失败:" + e.getMessage()); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + + } else if (e instanceof CallExternalProceduresException) { + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } } - }else{//条件下所有配置审核 + } else {// 条件下所有配置审核 try { - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return sslList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/website/sslList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/website/sslList?functionId=" + functionId; } - - @RequestMapping(value = {"dnsForm"}) - @RequiresPermissions(value={"website:dns:config"}) - public String dnsForm(Model model,String ids,CfgIndexInfo entity) { - if(StringUtils.isNotBlank(ids)){ - entity = websiteCfgService.getDnsCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + + @RequestMapping(value = { "dnsForm" }) + @RequiresPermissions(value = { "website:dns:config" }) + public String dnsForm(Model model, String ids, CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + entity = websiteCfgService.getDnsCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } - //获取所有响应策略信息 - List resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1); + // 获取所有响应策略信息 + List resStrategys = dnsResStrategyService.findDnsResStrategys(null, 1, 1); model.addAttribute("dnsResStrategys", resStrategys); model.addAttribute("_cfg", entity); return "/cfg/website/dnsForm"; } - @RequestMapping(value = {"saveDnsCfg"}) - @RequiresPermissions(value={"website:dns:config"}) - public String saveDnsCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) { + + @RequestMapping(value = { "saveDnsCfg" }) + @RequiresPermissions(value = { "website:dns:config" }) + public String saveDnsCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response, + String ids, CfgIndexInfo entity) { websiteCfgService.saveDnsCfg(entity); - return "redirect:" + adminPath +"/ntc/website/dnsList?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + entity.getFunctionId(); } - @RequestMapping(value = {"ajaxDnsSubList"}) - public String ajaxDnsSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = websiteCfgService.getDnsCfg(cfgId,compileId); + + @RequestMapping(value = { "ajaxDnsSubList" }) + public String ajaxDnsSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = websiteCfgService.getDnsCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getDomainList()!=null){ + if (cfg.getDomainList() != null) { String cfgType = null; - for(ComplexkeywordCfg keyword:cfg.getDomainList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"3",keyword.getCfgType()}); + for (ComplexkeywordCfg keyword : cfg.getDomainList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "3", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/website/dnsSubList"; } - @RequestMapping(value = {"updateDnsCfgValid"}) - @RequiresPermissions(value={"website:dns:config"}) - public String updateDnsCfgValid(Integer isValid,String ids,Integer functionId) { - websiteCfgService.updateDnsCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/website/dnsList?functionId="+functionId; + + @RequestMapping(value = { "updateDnsCfgValid" }) + @RequiresPermissions(value = { "website:dns:config" }) + public String updateDnsCfgValid(Integer isValid, String ids, Integer functionId) { + websiteCfgService.updateDnsCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId; } - @RequestMapping(value = {"auditDnsCfg"}) - @RequiresPermissions(value={"website:dns:confirm"}) - public String auditDnsCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isAudit, - Integer isValid, - String ids, - Integer functionId, - HttpServletRequest request, - HttpServletResponse response, - RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(ids)) { + + @RequestMapping(value = { "auditDnsCfg" }) + @RequiresPermissions(value = { "website:dns:confirm" }) + public String auditDnsCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isAudit, Integer isValid, + String ids, Integer functionId, HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = websiteCfgService.getDnsCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = websiteCfgService.getDnsCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - websiteCfgService.auditDnsCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + websiteCfgService.auditDnsCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); - logger.info("dns配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "request_service_failed"); - }catch (Exception e) { + logger.info("dns配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { e.printStackTrace(); - logger.info("dns配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "audit_failed"); + logger.info("dns配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "audit_failed"); } } - }else{//条件下所有配置审核 - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else {// 条件下所有配置审核 + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return dnsList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/website/dnsList?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId; } + @Deprecated - //下载导入模板 + // 下载导入模板 @RequestMapping(value = "import/template") - public void importFileTemplate(HttpServletRequest request,HttpServletResponse response, - RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) { + public void importFileTemplate(HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) { this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode); } - //http配置导入 - /*@RequestMapping(value = "importHttp", method=RequestMethod.POST) - public String importHttpFile(HttpServletRequest request,Model model,HttpServletResponse response, RedirectAttributes redirectAttributes, - @RequestParam("file") MultipartFile file,CfgIndexInfo cfgIndex,Integer protocolId) { - try { - ImportExcel ei = new ImportExcel(file, 0, 0); - if(cfgIndex.getCfgType().equals(Constants.HTTP_IP_REGION)){ - List list = ei.getDataList(IpCfgTemplate.class); - for(IpCfgTemplate cfg : list){ - List ipList = new ArrayList(); - BeanUtils.copyProperties(cfg, cfgIndex); - IpPortCfg ip = new IpPortCfg(); - BeanUtils.copyProperties(cfg, ip); - ip.setProtocolId(protocolId); - ip.setCfgRegionCode(cfgIndex.getCfgRegionCode()); - ip.setCfgType(cfgIndex.getCfgType()); - ipList.add(ip); - cfgIndex.setIpPortList(ipList); - cfgIndex.setIsAreaEffective(0); - websiteCfgService.saveHttpCfg(cfgIndex); - } - - }else if(cfgIndex.getCfgType().equals(Constants.HTTP_URL_REGION)){ - List list = ei.getDataList(StringCfgTemplate.class); - for(StringCfgTemplate cfg : list){ - List urlList = new ArrayList(); - BeanUtils.copyProperties(cfg, cfgIndex); - HttpUrlCfg url = new HttpUrlCfg(); - BeanUtils.copyProperties(cfg, url); - url.setCfgRegionCode(cfgIndex.getCfgRegionCode()); - url.setCfgType(cfgIndex.getCfgType()); - urlList.add(url); - cfgIndex.setHttpUrlList(urlList); - cfgIndex.setIsAreaEffective(0); - websiteCfgService.saveHttpCfg(cfgIndex); - } - - }else if(cfgIndex.getCfgType().equals(Constants.HTTP_REQ_HEAD_REGION)){ - List list = ei.getDataList(ComplexStringCfgTemplate.class); - for(ComplexStringCfgTemplate cfg : list){ - List headList = new ArrayList(); - BeanUtils.copyProperties(cfg, cfgIndex); - HttpReqHeadCfg head = new HttpReqHeadCfg(); - BeanUtils.copyProperties(cfg, head); - head.setCfgRegionCode(cfgIndex.getCfgRegionCode()); - head.setCfgType(cfgIndex.getCfgType()); - headList.add(head); - cfgIndex.setHttpReqHdrList(headList); - cfgIndex.setIsAreaEffective(0); - websiteCfgService.saveHttpCfg(cfgIndex); - } - - }else if(cfgIndex.getCfgType().equals(Constants.HTTP_REQ_BODY_REGION)){ - List list = ei.getDataList(StringCfgTemplate.class); - for(StringCfgTemplate cfg : list){ - List bodyList = new ArrayList(); - BeanUtils.copyProperties(cfg, cfgIndex); - HttpBodyCfg body = new HttpBodyCfg(); - BeanUtils.copyProperties(cfg, body); - body.setCfgRegionCode(cfgIndex.getCfgRegionCode()); - body.setCfgType(cfgIndex.getCfgType()); - bodyList.add(body); - cfgIndex.setHttpReqBodyList(bodyList); - cfgIndex.setIsAreaEffective(0); - websiteCfgService.saveHttpCfg(cfgIndex); - } - - }else if(cfgIndex.getCfgType().equals(Constants.HTTP_RES_HEAD_REGION)){ - List list = ei.getDataList(ComplexStringCfgTemplate.class); - for(ComplexStringCfgTemplate cfg : list){ - List headList = new ArrayList(); - BeanUtils.copyProperties(cfg, cfgIndex); - HttpResHeadCfg head = new HttpResHeadCfg(); - BeanUtils.copyProperties(cfg, head); - head.setCfgRegionCode(cfgIndex.getCfgRegionCode()); - head.setCfgType(cfgIndex.getCfgType()); - headList.add(head); - cfgIndex.setHttpResHdrList(headList); - cfgIndex.setIsAreaEffective(0); - websiteCfgService.saveHttpCfg(cfgIndex); - } - - }else if(cfgIndex.getCfgType().equals(Constants.HTTP_RES_BODY_REGION)){ - List list = ei.getDataList(StringCfgTemplate.class); - for(StringCfgTemplate cfg : list){ - List bodyList = new ArrayList(); - BeanUtils.copyProperties(cfg, cfgIndex); - HttpBodyCfg body = new HttpBodyCfg(); - BeanUtils.copyProperties(cfg, body); - body.setCfgRegionCode(cfgIndex.getCfgRegionCode()); - body.setCfgType(cfgIndex.getCfgType()); - bodyList.add(body); - cfgIndex.setHttpResBodyList(bodyList); - cfgIndex.setIsAreaEffective(0); - websiteCfgService.saveHttpCfg(cfgIndex); - } - - } - - - } catch (Exception e) { - addMessage(redirectAttributes, e.getMessage()); - e.printStackTrace(); - } - return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+cfgIndex.getFunctionId(); - - }*/ - - - + // http配置导入 + /* + * @RequestMapping(value = "importHttp", method=RequestMethod.POST) public + * String importHttpFile(HttpServletRequest request,Model + * model,HttpServletResponse response, RedirectAttributes + * redirectAttributes, + * + * @RequestParam("file") MultipartFile file,CfgIndexInfo cfgIndex,Integer + * protocolId) { try { ImportExcel ei = new ImportExcel(file, 0, 0); + * if(cfgIndex.getCfgType().equals(Constants.HTTP_IP_REGION)){ + * List list = ei.getDataList(IpCfgTemplate.class); + * for(IpCfgTemplate cfg : list){ List ipList = new ArrayList(); + * BeanUtils.copyProperties(cfg, cfgIndex); IpPortCfg ip = new IpPortCfg(); + * BeanUtils.copyProperties(cfg, ip); ip.setProtocolId(protocolId); + * ip.setCfgRegionCode(cfgIndex.getCfgRegionCode()); + * ip.setCfgType(cfgIndex.getCfgType()); ipList.add(ip); + * cfgIndex.setIpPortList(ipList); cfgIndex.setIsAreaEffective(0); + * websiteCfgService.saveHttpCfg(cfgIndex); } + * + * }else if(cfgIndex.getCfgType().equals(Constants.HTTP_URL_REGION)){ + * List list = ei.getDataList(StringCfgTemplate.class); + * for(StringCfgTemplate cfg : list){ List urlList = new + * ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpUrlCfg url = + * new HttpUrlCfg(); BeanUtils.copyProperties(cfg, url); + * url.setCfgRegionCode(cfgIndex.getCfgRegionCode()); + * url.setCfgType(cfgIndex.getCfgType()); urlList.add(url); + * cfgIndex.setHttpUrlList(urlList); cfgIndex.setIsAreaEffective(0); + * websiteCfgService.saveHttpCfg(cfgIndex); } + * + * }else if(cfgIndex.getCfgType().equals(Constants.HTTP_REQ_HEAD_REGION)){ + * List list = + * ei.getDataList(ComplexStringCfgTemplate.class); + * for(ComplexStringCfgTemplate cfg : list){ List headList = + * new ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpReqHeadCfg + * head = new HttpReqHeadCfg(); BeanUtils.copyProperties(cfg, head); + * head.setCfgRegionCode(cfgIndex.getCfgRegionCode()); + * head.setCfgType(cfgIndex.getCfgType()); headList.add(head); + * cfgIndex.setHttpReqHdrList(headList); cfgIndex.setIsAreaEffective(0); + * websiteCfgService.saveHttpCfg(cfgIndex); } + * + * }else if(cfgIndex.getCfgType().equals(Constants.HTTP_REQ_BODY_REGION)){ + * List list = ei.getDataList(StringCfgTemplate.class); + * for(StringCfgTemplate cfg : list){ List bodyList = new + * ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpBodyCfg body = + * new HttpBodyCfg(); BeanUtils.copyProperties(cfg, body); + * body.setCfgRegionCode(cfgIndex.getCfgRegionCode()); + * body.setCfgType(cfgIndex.getCfgType()); bodyList.add(body); + * cfgIndex.setHttpReqBodyList(bodyList); cfgIndex.setIsAreaEffective(0); + * websiteCfgService.saveHttpCfg(cfgIndex); } + * + * }else if(cfgIndex.getCfgType().equals(Constants.HTTP_RES_HEAD_REGION)){ + * List list = + * ei.getDataList(ComplexStringCfgTemplate.class); + * for(ComplexStringCfgTemplate cfg : list){ List headList = + * new ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpResHeadCfg + * head = new HttpResHeadCfg(); BeanUtils.copyProperties(cfg, head); + * head.setCfgRegionCode(cfgIndex.getCfgRegionCode()); + * head.setCfgType(cfgIndex.getCfgType()); headList.add(head); + * cfgIndex.setHttpResHdrList(headList); cfgIndex.setIsAreaEffective(0); + * websiteCfgService.saveHttpCfg(cfgIndex); } + * + * }else if(cfgIndex.getCfgType().equals(Constants.HTTP_RES_BODY_REGION)){ + * List list = ei.getDataList(StringCfgTemplate.class); + * for(StringCfgTemplate cfg : list){ List bodyList = new + * ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpBodyCfg body = + * new HttpBodyCfg(); BeanUtils.copyProperties(cfg, body); + * body.setCfgRegionCode(cfgIndex.getCfgRegionCode()); + * body.setCfgType(cfgIndex.getCfgType()); bodyList.add(body); + * cfgIndex.setHttpResBodyList(bodyList); cfgIndex.setIsAreaEffective(0); + * websiteCfgService.saveHttpCfg(cfgIndex); } + * + * } + * + * + * } catch (Exception e) { addMessage(redirectAttributes, e.getMessage()); + * e.printStackTrace(); } return "redirect:" + adminPath + * +"/ntc/website/httpList?functionId="+cfgIndex.getFunctionId(); + * + * } + */ - //http配置导出 - @RequestMapping(value = "exportHttp") - public void exportHttp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity); - ipLists=page.getList(); - } - //条件导出数据大于最大导出数,只导出最大导出条数 - - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - String httpUrlCfgNoExport=",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,"; - String httpReqHeadCfgNoExport=",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,"; - String httpResHeadCfgNoExport=",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,"; - String httpReqBodyCfgNoExport=",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,"; - String httpResBodyCfgNoExport=",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,"; - String ipPortCfgNoExport=",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 ntcSubscribeIdCfgNoExport=",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,"; - List httpUrlList = new ArrayList<>(); - List httpReqHdrList = new ArrayList<>(); - List httpResHdrList = new ArrayList<>(); - List httpReqBodyList = new ArrayList<>(); - List httpResBodyList = new ArrayList<>(); - List ipPortList = new ArrayList<>(); - List subscribeIdList = new ArrayList<>(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=websiteCfgService.exportHttpCfg(cfg); - httpUrlList.addAll(maps.get("NTC_HTTP_URL")); - httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR")); - httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR")); - httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY")); - httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY")); - ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP")); - subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - httpUrlList=BaseStringCfg.replaceBaseKeyList(httpUrlList); - httpReqHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList); - httpResHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList); - httpReqBodyList=BaseStringCfg.replaceBaseKeyList(httpReqBodyList); - httpResBodyList=BaseStringCfg.replaceBaseKeyList(httpResBodyList); - subscribeIdList=BaseStringCfg.baseHexList(subscribeIdList); - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(),ipLists); - - if(entity.getFunctionId()!=635){ - titleList.add("NTC_HTTP_URL"); - titleList.add("NTC_HTTP_REQ_HDR"); - titleList.add("NTC_HTTP_RES_HDR"); - classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); - classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class); - classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class); - noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport); - noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport); - noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport); - dataMap.put("NTC_HTTP_URL", httpUrlList); - dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList); - dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList); - } - titleList.add("NTC_HTTP_REQ_BODY"); - titleList.add("NTC_HTTP_RES_BODY"); - classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class); - classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class); - noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport); - noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport); - dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList); - dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList); - if(entity.getFunctionId()!=635){ - titleList.add("NTC_UNIVERSAL_IP"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - dataMap.put("NTC_UNIVERSAL_IP", ipPortList); - dataMap.put("NTC_SUBSCRIBE_ID",subscribeIdList); - } - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("http export failed",e); - addMessage(redirectAttributes,"error", "export_failed"); - } - //return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId(); + // http配置导出 + @RequestMapping(value = "exportHttp") + public void exportHttp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity); + ipLists = page.getList(); + } + // 条件导出数据大于最大导出数,只导出最大导出条数 + + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String httpUrlCfgNoExport = ",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,"; + String httpReqHeadCfgNoExport = ",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,"; + String httpResHeadCfgNoExport = ",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,"; + String httpReqBodyCfgNoExport = ",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,"; + String httpResBodyCfgNoExport = ",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,"; + String ipPortCfgNoExport = ",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 ntcSubscribeIdCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; } - //dns配置导出 + List httpUrlList = new ArrayList<>(); + List httpReqHdrList = new ArrayList<>(); + List httpResHdrList = new ArrayList<>(); + List httpReqBodyList = new ArrayList<>(); + List httpResBodyList = new ArrayList<>(); + List ipPortList = new ArrayList<>(); + List subscribeIdList = new ArrayList<>(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = websiteCfgService.exportHttpCfg(cfg); + httpUrlList.addAll(maps.get("NTC_HTTP_URL")); + httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR")); + httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR")); + httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY")); + httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY")); + ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP")); + subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + httpUrlList = BaseStringCfg.replaceBaseKeyList(httpUrlList); + httpReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList); + httpResHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList); + httpReqBodyList = BaseStringCfg.replaceBaseKeyList(httpReqBodyList); + httpResBodyList = BaseStringCfg.replaceBaseKeyList(httpResBodyList); + subscribeIdList = BaseStringCfg.baseHexList(subscribeIdList); + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + + if (entity.getFunctionId() != 635) { + titleList.add("NTC_HTTP_URL"); + titleList.add("NTC_HTTP_REQ_HDR"); + titleList.add("NTC_HTTP_RES_HDR"); + classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); + classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class); + classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class); + noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport); + noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport); + noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport); + dataMap.put("NTC_HTTP_URL", httpUrlList); + dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList); + dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList); + } + titleList.add("NTC_HTTP_REQ_BODY"); + titleList.add("NTC_HTTP_RES_BODY"); + classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class); + classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class); + noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport); + noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport); + dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList); + dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList); + if (entity.getFunctionId() != 635) { + titleList.add("NTC_UNIVERSAL_IP"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + dataMap.put("NTC_UNIVERSAL_IP", ipPortList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList); + } + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("http export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/website/httpList?functionId="+entity.getFunctionId(); + } + + // dns配置导出 @RequestMapping(value = "exportdns") - public void exportdns(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ + public void exportdns(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); Properties msgProp = getMsgProp(); - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = websiteCfgService.getWebsiteList(pageInfo, entity); - ipLists=page.getList(); - } - - for (int i = 0; i < ipLists.size(); i++) { - if(ipLists.get(i).getDnsStrategyId()!=null && ipLists.get(i).getDnsStrategyId()!=0){ - List resStrategys=dnsResStrategyService.findDnsResStrategys(ipLists.get(i).getDnsStrategyId(), 1,1); - if(resStrategys!=null && resStrategys.size()>0){ - String msg= msgProp.getProperty(resStrategys.get(0).getCfgDesc()); - if(!StringUtil.isEmpty(msg)){ - ipLists.get(i).setDnsStrategyName(msg); - }else{ - ipLists.get(i).setDnsStrategyName(resStrategys.get(0).getCfgDesc()); - } - }else{ - ipLists.get(i).setDnsStrategyName(msgProp.getProperty("no_strategy")); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = websiteCfgService.getWebsiteList(pageInfo, entity); + ipLists = page.getList(); + } + + for (int i = 0; i < ipLists.size(); i++) { + if (ipLists.get(i).getDnsStrategyId() != null && ipLists.get(i).getDnsStrategyId() != 0) { + List resStrategys = dnsResStrategyService + .findDnsResStrategys(ipLists.get(i).getDnsStrategyId(), 1, 1); + if (resStrategys != null && resStrategys.size() > 0) { + String msg = msgProp.getProperty(resStrategys.get(0).getCfgDesc()); + if (!StringUtil.isEmpty(msg)) { + ipLists.get(i).setDnsStrategyName(msg); + } else { + ipLists.get(i).setDnsStrategyName(resStrategys.get(0).getCfgDesc()); } - }else{ + } else { ipLists.get(i).setDnsStrategyName(msgProp.getProperty("no_strategy")); } + } else { + ipLists.get(i).setDnsStrategyName(msgProp.getProperty("no_strategy")); } - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_IP"); - titleList.add("NTC_DNS_REGION"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_IP", IpPortCfg.class); - classMap.put("NTC_DNS_REGION", ComplexkeywordCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - 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 ntcSubscribeIdCfgNoExport=",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,"; - String regionCfgNoExport=",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,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_IP", ipPortInfoNoExport); - noExportMap.put("NTC_DNS_REGION", regionCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - List ipList=new ArrayList(); - List subscribeInfoList=new ArrayList(); - List regionInfoList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - CfgIndexInfo cfgIndexInfo=websiteCfgService.exportdns(cfg); - ipList.addAll(cfgIndexInfo.getIpPortList()); - subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); - regionInfoList.addAll(cfgIndexInfo.getDomainList()); - } - subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - regionInfoList=ComplexkeywordCfg.replaceComplexKeyList(regionInfoList); - dataMap.put(entity.getMenuNameCode(),ipLists); - dataMap.put("NTC_IP", ipList); - dataMap.put("NTC_DNS_REGION", regionInfoList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); - - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("dns export failed",e); - addMessage(redirectAttributes,"error", "export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); - } - - //ssl配置导出 - @RequestMapping(value = "exportSsl") - public void exportSsl(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = websiteCfgService.getWebsiteList(pageInfo, entity); - ipLists=page.getList(); - } - - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_UNIVERSAL_IP"); - titleList.add("NTC_SSL_SNI"); - titleList.add("NTC_SSL_SAN"); - titleList.add("NTC_SSL_CN"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); - classMap.put("NTC_SSL_SNI", BaseStringCfg.class); - classMap.put("NTC_SSL_SAN", BaseStringCfg.class); - classMap.put("NTC_SSL_CN", BaseStringCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - String sslNoExport=",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,"; - String ipPortCfgNoExport=",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 ntcSubscribeIdCfgNoExport=",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,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport); - noExportMap.put("NTC_SSL_SNI", sslNoExport); - noExportMap.put("NTC_SSL_SAN", sslNoExport); - noExportMap.put("NTC_SSL_CN", sslNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - - List sslSniList = new ArrayList<>(); - List sslSnaList = new ArrayList<>(); - List sslCnList = new ArrayList<>(); - List ipPortList = new ArrayList<>(); - List subscribeIdList = new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=websiteCfgService.exportssl(cfg); - sslSniList.addAll(maps.get("NTC_SSL_SNI")); - sslSnaList.addAll(maps.get("NTC_SSL_SAN")); - sslCnList.addAll(maps.get("NTC_SSL_CN")); - ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP")); - subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - sslSniList=BaseStringCfg.replaceBaseKeyList(sslSniList); - sslSnaList=BaseStringCfg.replaceBaseKeyList(sslSnaList); - sslCnList=BaseStringCfg.replaceBaseKeyList(sslCnList); - subscribeIdList=BaseStringCfg.baseHexList(subscribeIdList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_UNIVERSAL_IP", ipPortList); - dataMap.put("NTC_SSL_SNI", sslSniList); - dataMap.put("NTC_SSL_SAN", sslSnaList); - dataMap.put("NTC_SSL_CN", sslCnList); - dataMap.put("NTC_SUBSCRIBE_ID",subscribeIdList); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("http export failed",e); - addMessage(redirectAttributes,"error", "export_failed"); } - //return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId(); + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_IP"); + titleList.add("NTC_DNS_REGION"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_DNS_REGION", ComplexkeywordCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + String cfgIndexInfoNoExport = ",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + 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 ntcSubscribeIdCfgNoExport = ",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,"; + String regionCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_DNS_REGION", regionCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList = new ArrayList(); + List subscribeInfoList = new ArrayList(); + List regionInfoList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + CfgIndexInfo cfgIndexInfo = websiteCfgService.exportdns(cfg); + ipList.addAll(cfgIndexInfo.getIpPortList()); + subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); + regionInfoList.addAll(cfgIndexInfo.getDomainList()); + } + subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList); + regionInfoList = ComplexkeywordCfg.replaceComplexKeyList(regionInfoList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_DNS_REGION", regionInfoList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("dns export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // ssl配置导出 + @RequestMapping(value = "exportSsl") + public void exportSsl(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = websiteCfgService.getWebsiteList(pageInfo, entity); + ipLists = page.getList(); + } + + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_UNIVERSAL_IP"); + titleList.add("NTC_SSL_SNI"); + titleList.add("NTC_SSL_SAN"); + titleList.add("NTC_SSL_CN"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); + classMap.put("NTC_SSL_SNI", BaseStringCfg.class); + classMap.put("NTC_SSL_SAN", BaseStringCfg.class); + classMap.put("NTC_SSL_CN", BaseStringCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String sslNoExport = ",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,"; + String ipPortCfgNoExport = ",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 ntcSubscribeIdCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport); + noExportMap.put("NTC_SSL_SNI", sslNoExport); + noExportMap.put("NTC_SSL_SAN", sslNoExport); + noExportMap.put("NTC_SSL_CN", sslNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + + List sslSniList = new ArrayList<>(); + List sslSnaList = new ArrayList<>(); + List sslCnList = new ArrayList<>(); + List ipPortList = new ArrayList<>(); + List subscribeIdList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = websiteCfgService.exportssl(cfg); + sslSniList.addAll(maps.get("NTC_SSL_SNI")); + sslSnaList.addAll(maps.get("NTC_SSL_SAN")); + sslCnList.addAll(maps.get("NTC_SSL_CN")); + ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP")); + subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + sslSniList = BaseStringCfg.replaceBaseKeyList(sslSniList); + sslSnaList = BaseStringCfg.replaceBaseKeyList(sslSnaList); + sslCnList = BaseStringCfg.replaceBaseKeyList(sslCnList); + subscribeIdList = BaseStringCfg.baseHexList(subscribeIdList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_UNIVERSAL_IP", ipPortList); + dataMap.put("NTC_SSL_SNI", sslSniList); + dataMap.put("NTC_SSL_SAN", sslSnaList); + dataMap.put("NTC_SSL_CN", sslCnList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("http export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/website/httpList?functionId="+entity.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java index 1794ef977..0f26c49db 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java @@ -33,145 +33,151 @@ import com.nis.web.security.UserUtils; /** * 白名单 + * * @author dell * */ @Controller @RequestMapping("${adminPath}/ntc/whitelist") -public class WhiteListController extends CommonController{ - - @RequestMapping(value = {"ip/list"}) - //@RequiresPermissions(value={"whitelist:ip:config","whitelist:ip:confirm","whitelist:ip:aduit"},logical=Logical.OR) - public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); +public class WhiteListController extends CommonController { + + @RequestMapping(value = { "ip/list" }) + // @RequiresPermissions(value={"whitelist:ip:config","whitelist:ip:confirm","whitelist:ip:aduit"},logical=Logical.OR) + public String ipList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = ipCfgService.getIpCfgList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/whitelist/ipList"; } - @RequestMapping(value = {"ajaxIpSubList"}) - public String ajaxIpSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = ipCfgService.getIpPortCfg(cfgId,compileId); + + @RequestMapping(value = { "ajaxIpSubList" }) + public String ajaxIpSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = ipCfgService.getIpPortCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/whitelist/ipSubList"; } - @RequestMapping(value = {"ip/form"}) - @RequiresPermissions(value={"whitelist:ip:config"}) - public String ipForm(Model model,String ids,CfgIndexInfo entity) { - if(StringUtils.isNotBlank(ids)){ - - entity = this.ipCfgService.getIpPortCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + + @RequestMapping(value = { "ip/form" }) + @RequiresPermissions(value = { "whitelist:ip:config" }) + public String ipForm(Model model, String ids, CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + + entity = this.ipCfgService.getIpPortCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/whitelist/ipForm"; } - @RequestMapping(value = {"ip/save"}) - public String saveIpCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) { + + @RequestMapping(value = { "ip/save" }) + public String saveIpCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response, + String ids, CfgIndexInfo entity) { ipCfgService.saveIpCfg(entity); - return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + entity.getFunctionId(); } - @RequestMapping(value = {"ip/audit"}) + + @RequestMapping(value = { "ip/audit" }) @RequiresPermissions("whitelist:ip:confirm") - public String auditIp(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request - ) { - if(!StringUtil.isEmpty(ids)){ + public String auditIp(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = ipCfgService.getIpPortCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = ipCfgService.getIpPortCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - ipCfgService.auditIpCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + ipCfgService.auditIpCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { - logger.info("ip配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "request_service_failed"); - }catch (Exception e) { - logger.info("ip配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error", "audit_failed"); + logger.info("ip配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.info("ip配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "audit_failed"); } } - }else{ - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return ipList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + functionId; } - @RequestMapping(value = {"updateIpValid"}) - @RequiresPermissions(value={"whitelist:ip:config"}) - public String updateIpCfgValid(Integer isValid,String ids,Integer functionId) { - ipCfgService.updateIpCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+functionId; + + @RequestMapping(value = { "updateIpValid" }) + @RequiresPermissions(value = { "whitelist:ip:config" }) + public String updateIpCfgValid(Integer isValid, String ids, Integer functionId) { + ipCfgService.updateIpCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + functionId; } - @RequestMapping(value = {"domain/list"}) - //@RequiresPermissions(value={"whitelist:domain:config","whitelist:domain:confirm","whitelist:domain:aduit"},logical=Logical.OR) - public String domainList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); + + @RequestMapping(value = { "domain/list" }) + // @RequiresPermissions(value={"whitelist:domain:config","whitelist:domain:confirm","whitelist:domain:aduit"},logical=Logical.OR) + public String domainList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = domainService.getDomainList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); + initPageCondition(model, cfg); return "/cfg/whitelist/domainList"; } - - @RequestMapping(value = {"saveHttpUrlCfgs"}) - public String saveHttpUrlCfgs(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,CfgIndexInfo entity) { - if(!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())){ - - CfgIndexInfo sourceCfg=websiteCfgService.getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId()); + + @RequestMapping(value = { "saveHttpUrlCfgs" }) + public String saveHttpUrlCfgs(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response, + CfgIndexInfo entity) { + if (!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())) { + + CfgIndexInfo sourceCfg = websiteCfgService + .getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId()); for (HttpUrlCfg httpUrlCfg : entity.getHttpUrlList()) { - CfgIndexInfo cfg=new CfgIndexInfo(); - List httpList=new ArrayList<>(); + CfgIndexInfo cfg = new CfgIndexInfo(); + List httpList = new ArrayList<>(); httpUrlCfg.setRequestId(sourceCfg.getRequestId()); BeanUtils.copyProperties(httpUrlCfg, cfg); httpList.add(httpUrlCfg); @@ -179,258 +185,315 @@ public class WhiteListController extends CommonController{ websiteCfgService.saveHttpCfg(cfg); } } - return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + entity.getFunctionId(); } - - @RequestMapping(value = {"domain/form"}) - @RequiresPermissions(value={"whitelist:domain:config"}) - public String domainForm(Model model,String ids,CfgIndexInfo entity) { - if(StringUtils.isNotBlank(ids)){ - entity = domainService.getDomainCfg(Long.parseLong(ids),null); + + @RequestMapping(value = { "domain/form" }) + @RequiresPermissions(value = { "whitelist:domain:config" }) + public String domainForm(Model model, String ids, CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + entity = domainService.getDomainCfg(Long.parseLong(ids), null); HttpUrlCfg urlCfg = new HttpUrlCfg(); urlCfg.setCfgType(Constants.HTTP_URL_REGION); entity.setHttpUrl(urlCfg); - if(entity.getHttpUrlList().size()==0){ + if (entity.getHttpUrlList().size() == 0) { entity.getHttpUrlList().add(urlCfg); } - initUpdateFormCondition(model,entity); - }else{ + initUpdateFormCondition(model, entity); + } else { HttpUrlCfg urlCfg = new HttpUrlCfg(); urlCfg.setCfgType(Constants.HTTP_URL_REGION); entity.setHttpUrl(urlCfg); - List urlList=new ArrayList(); + List urlList = new ArrayList(); urlList.add(urlCfg); entity.setHttpUrlList(urlList); - initFormCondition(model,entity); + initFormCondition(model, entity); } model.addAttribute("_cfg", entity); return "/cfg/whitelist/domainForm"; } - @RequestMapping(value = {"domain/save"}) - public String saveOrUpdateDomain(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) { + + @RequestMapping(value = { "domain/save" }) + public String saveOrUpdateDomain(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response, + String ids, CfgIndexInfo entity) { domainService.saveDomainCfg(entity); - return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + entity.getFunctionId(); } - @RequestMapping(value = {"domain/ajaxSubList"}) - public String ajaxDomainSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = domainService.getDomainCfg(cfgId,compileId); + + @RequestMapping(value = { "domain/ajaxSubList" }) + public String ajaxDomainSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = domainService.getDomainCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getHttpUrlList()!=null){ + if (cfg.getHttpUrlList() != null) { String cfgType = null; - for(BaseStringCfg keyword:cfg.getHttpUrlList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (BaseStringCfg keyword : cfg.getHttpUrlList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - if(cfg.getNtcSubscribeIdCfgList()!=null){ + if (cfg.getNtcSubscribeIdCfgList() != null) { String cfgType = null; - for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/whitelist/domianSubList"; } - @RequestMapping(value = {"domain/updateValid"}) - @RequiresPermissions(value={"whitelist:domain:config"}) - public String updateDomainValid(Integer isValid,String ids,Integer functionId) { - domainService.updateDomainCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+functionId; + + @RequestMapping(value = { "domain/updateValid" }) + @RequiresPermissions(value = { "whitelist:domain:config" }) + public String updateDomainValid(Integer isValid, String ids, Integer functionId) { + domainService.updateDomainCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId; } - @RequestMapping(value = {"domain/delete"}) + + @RequestMapping(value = { "domain/delete" }) @RequiresPermissions("whitelist:domain:config") - public String deleteDomain(String ids,Integer functionId,RedirectAttributes model) { - try{ + public String deleteDomain(String ids, Integer functionId, RedirectAttributes model) { + try { domainService.deleteWhiteDomain(ids); - addMessage(model,"success","delete_success"); - }catch(Exception e){ + addMessage(model, "success", "delete_success"); + } catch (Exception e) { logger.error("删除失败", e); - addMessage(model,"error","delete_failed"); + addMessage(model, "error", "delete_failed"); } - return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId; } - - @RequestMapping(value = {"domain/audit"}) + + @RequestMapping(value = { "domain/audit" }) @RequiresPermissions("whitelist:domain:confirm") - public String auditDomain(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)) { + public String auditDomain(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = domainService.getDomainCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = domainService.getDomainCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - domainService.auditDomainCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); + domainService.auditDomainCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); - logger.error("domain配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error","request_service_failed"); - }catch (Exception e) { + logger.error("domain配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { e.printStackTrace(); - logger.error("domain配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes,"error","audit_failed"); + logger.error("domain配置下发失败:" + e.getMessage()); + addMessage(redirectAttributes, "error", "audit_failed"); } } - }else{//条件下所有配置审核 - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else {// 条件下所有配置审核 + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return domainList(model, cfg, request, response); } - return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+functionId; + return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId; } - //ip配置导入 - /*@RequestMapping(value = "ip/import", method=RequestMethod.POST) - public String importIp(String cfgName,RedirectAttributes redirectAttributes, - @RequestParam("file") MultipartFile file,IpPortCfg cfg) { - this._importIp(cfgName,redirectAttributes, file,cfg,WhiteListIpTemplate.class); - return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); - }*/ - //ip模板下载 + + // ip配置导入 + /* + * @RequestMapping(value = "ip/import", method=RequestMethod.POST) public + * String importIp(String cfgName,RedirectAttributes redirectAttributes, + * + * @RequestParam("file") MultipartFile file,IpPortCfg cfg) { + * this._importIp(cfgName,redirectAttributes, + * file,cfg,WhiteListIpTemplate.class); return "redirect:" + adminPath + * +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); } + */ + // ip模板下载 @RequestMapping(value = "ip/import/template") - public void importFileTemplate(HttpServletRequest request,HttpServletResponse response, - RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) { - this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,WhiteListIpTemplate.class); + public void importFileTemplate(HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) { + this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode, + WhiteListIpTemplate.class); } - //ip配置导出 + + // ip配置导出 @RequestMapping(value = "ip/export") - public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){ - this._exportIp(columns,model, request, response, entity, ids, redirectAttributes); + public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") IpPortCfg entity, String ids, RedirectAttributes redirectAttributes) { + this._exportIp(columns, model, request, response, entity, ids, redirectAttributes); } - - //ip配置导出 - @RequestMapping(value = "exportIpAddr") - public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipCfgService.getIpCfgList(pageInfo, entity); - ipLists=page.getList(); - } - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_IP"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_IP", IpPortCfg.class); - String cfgIndexInfoNoExport=",policy_name,do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - String ipPortInfoNoExport=",protocol,direction,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,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_IP", ipPortInfoNoExport); - List ipList=new ArrayList(); - for (CfgIndexInfo cfg :ipLists) { - CfgIndexInfo cfgIndexInfo=ipCfgService.exportIpInfo(cfg); - ipList.addAll(cfgIndexInfo.getIpPortList()); - } - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_IP", ipList); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("ip white export failed",e); - addMessage(redirectAttributes,"error", "export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + + // ip配置导出 + @RequestMapping(value = "exportIpAddr") + public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipCfgService.getIpCfgList(pageInfo, entity); + ipLists = page.getList(); } - //ip配置导出 - @RequestMapping(value = "exportdomain") - public void exportdomain(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = domainService.getDomainList(pageInfo, entity); - ipLists=page.getList(); - } - - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_HTTP_URL"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - String httpUrlInfoNoExport=",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,"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport); - List httpurlList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - CfgIndexInfo cfgIndexInfo=domainService.exportDomainInfo(cfg); - httpurlList.addAll(cfgIndexInfo.getHttpUrlList()); - } - httpurlList=BaseStringCfg.replaceBaseKeyList(httpurlList); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_HTTP_URL", httpurlList); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("ip white export failed",e); - addMessage(redirectAttributes,"error", "export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); - } - + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_IP"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_IP", IpPortCfg.class); + String cfgIndexInfoNoExport = ",policy_name,do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String ipPortInfoNoExport = ",protocol,direction,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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_IP", ipPortInfoNoExport); + List ipList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + CfgIndexInfo cfgIndexInfo = ipCfgService.exportIpInfo(cfg); + ipList.addAll(cfgIndexInfo.getIpPortList()); + } + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_IP", ipList); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("ip white export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // ip配置导出 + @RequestMapping(value = "exportdomain") + public void exportdomain(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = domainService.getDomainList(pageInfo, entity); + ipLists = page.getList(); + } + + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_HTTP_URL"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String httpUrlInfoNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport); + List httpurlList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + CfgIndexInfo cfgIndexInfo = domainService.exportDomainInfo(cfg); + httpurlList.addAll(cfgIndexInfo.getHttpUrlList()); + } + httpurlList = BaseStringCfg.replaceBaseKeyList(httpurlList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_HTTP_URL", httpurlList); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("ip white export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + } diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java index 0b722959c..1567bf284 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java @@ -44,35 +44,37 @@ import jersey.repackaged.com.google.common.collect.Lists; /** * http重定向策略 + * * @author zhangwei * */ @Controller @RequestMapping("${adminPath}/proxy/control/httpRedirect") -public class HttpRedirectPolicyController extends BaseController{ - @RequestMapping(value = {"httpRedirectList","httpBlockList","httpReplaceList","httpMonitList","httpWhitelistList"}) - public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg){ - Page searchPage=new Page(request,response,"a"); +public class HttpRedirectPolicyController extends BaseController { + @RequestMapping(value = { "httpRedirectList", "httpBlockList", "httpReplaceList", "httpMonitList", + "httpWhitelistList" }) + public String list(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo cfg) { + Page searchPage = new Page(request, response, "a"); Page page = httpRedirectCfgService.getHttpRedirectList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); - //获取所有的响应文件内容,阻断,或重定向时可以选择 - List allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg()); + initPageCondition(model, cfg); + // 获取所有的响应文件内容,阻断,或重定向时可以选择 + List allProxyFileStrategys = proxyFileStrategyService + .getProxyFileStrategyCfgList(new ProxyFileStrategyCfg()); model.addAttribute("allProxyFileStrategys", allProxyFileStrategys); return "/cfg/proxy/control/httpRedirectList"; } - @RequestMapping(value = {"form"}) - @RequiresPermissions(value={"control:httpBlock:config" - ,"control:httpRedirect:config" - ,"control:httpReplace:config" - ,"control:httpMinit:config" - ,"control:httpWhitelist:config" - } - ,logical=Logical.OR) - public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity){ - if(StringUtils.isNotBlank(ids)){ - entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids),null); - + + @RequestMapping(value = { "form" }) + @RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config", + "control:httpReplace:config", "control:httpMinit:config", + "control:httpWhitelist:config" }, logical = Logical.OR) + public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids), null); + HttpUrlCfg urlCfg = new HttpUrlCfg(); urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION); entity.setHttpUrl(urlCfg); @@ -94,31 +96,31 @@ public class HttpRedirectPolicyController extends BaseController{ NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg(); subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION); entity.setNtcSubscribeIdCfg(subscribeIdCfg); - - if(entity.getHttpUrlList().size()==0){ + + if (entity.getHttpUrlList().size() == 0) { entity.getHttpUrlList().add(urlCfg); } - if(entity.getHttpReqHdrList().size()==0){ + if (entity.getHttpReqHdrList().size() == 0) { entity.getHttpReqHdrList().add(reqHdrCfg); } - if(entity.getHttpResHdrList().size()==0){ + if (entity.getHttpResHdrList().size() == 0) { entity.getHttpResHdrList().add(resHdrCfg); } - if(entity.getHttpReqBodyList().size()==0){ + if (entity.getHttpReqBodyList().size() == 0) { entity.getHttpReqBodyList().add(reqBodyCfg); } - if(entity.getHttpResBodyList().size()==0){ + if (entity.getHttpResBodyList().size() == 0) { entity.getHttpResBodyList().add(resBodyCfg); } - if(entity.getIpPortList().size()==0){ + if (entity.getIpPortList().size() == 0) { entity.getIpPortList().add(ipPortCfg); } - if(entity.getNtcSubscribeIdCfgList().size()==0){ + if (entity.getNtcSubscribeIdCfgList().size() == 0) { entity.getNtcSubscribeIdCfgList().add(subscribeIdCfg); } - initUpdateFormCondition(model,entity); - }else{ - //设置http各类配置的配置域类型 + initUpdateFormCondition(model, entity); + } else { + // 设置http各类配置的配置域类型 HttpUrlCfg urlCfg = new HttpUrlCfg(); urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION); entity.setHttpUrl(urlCfg); @@ -137,303 +139,321 @@ public class HttpRedirectPolicyController extends BaseController{ IpPortCfg ipPortCfg = new IpPortCfg(); ipPortCfg.setCfgType(Constants.HTTP_IP_REGION); entity.setIpPort(ipPortCfg); - //subscribeId + // subscribeId NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg(); subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION); entity.setNtcSubscribeIdCfg(subscribeIdCfg); - - List urlList=new ArrayList(); + + List urlList = new ArrayList(); urlList.add(urlCfg); entity.setHttpUrlList(urlList); - List reqHdrList=new ArrayList(); + List reqHdrList = new ArrayList(); reqHdrList.add(reqHdrCfg); entity.setHttpReqHdrList(reqHdrList); - List resHdrList=new ArrayList(); + List resHdrList = new ArrayList(); resHdrList.add(resHdrCfg); entity.setHttpResHdrList(resHdrList); - List reqBodyList=new ArrayList(); + List reqBodyList = new ArrayList(); reqBodyList.add(reqBodyCfg); entity.setHttpReqBodyList(reqBodyList); - List resBodyList=new ArrayList(); + List resBodyList = new ArrayList(); resBodyList.add(resBodyCfg); entity.setHttpResBodyList(resBodyList); - - List ipPortList=new ArrayList(); + + List ipPortList = new ArrayList(); ipPortList.add(ipPortCfg); entity.setIpPortList(ipPortList); - + List subscribeCfgList = Lists.newArrayList(); subscribeCfgList.add(subscribeIdCfg); entity.setNtcSubscribeIdCfgList(subscribeCfgList); - - initFormCondition(model,entity); + + initFormCondition(model, entity); } - //获取所有的响应文件内容,阻断,或重定向时可以选择 - List allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg()); + // 获取所有的响应文件内容,阻断,或重定向时可以选择 + List allProxyFileStrategys = proxyFileStrategyService + .getProxyFileStrategyCfgList(new ProxyFileStrategyCfg()); model.addAttribute("_cfg", entity); model.addAttribute("allProxyFileStrategys", allProxyFileStrategys); return "/cfg/proxy/control/httpRedirectForm"; } - - @RequestMapping(value = {"saveOrUpdate"}) - @RequiresPermissions(value={"control:httpBlock:config" - ,"control:httpRedirect:config" - ,"control:httpReplace:config" - ,"control:httpMinit:config" - ,"control:httpWhitelist:config"} - ,logical=Logical.OR) - public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){ - try{ + + @RequestMapping(value = { "saveOrUpdate" }) + @RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config", + "control:httpReplace:config", "control:httpMinit:config", + "control:httpWhitelist:config" }, logical = Logical.OR) + public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) { + try { httpRedirectCfgService.saveHttpCfg(cfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); + addMessage(redirectAttributes, "success", "save_success"); + } catch (Exception e) { + logger.error("信息保存失败", e); e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - - return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+cfg.getFunctionId(); + + return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + + cfg.getFunctionId(); } - @RequestMapping(value = {"ajaxHttpSubList"}) - public String ajaxHttpSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId,compileId); - model.addAttribute("_cfg", cfg); + + @RequestMapping(value = { "ajaxHttpSubList" }) + public String ajaxHttpSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId, compileId); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); return "/cfg/proxy/control/httpRedirectSubList"; } - @RequestMapping(value = {"delete"}) - @RequiresPermissions(value={"control:httpBlock:config" - ,"control:httpRedirect:config" - ,"control:httpReplace:config" - ,"control:httpMinit:config" - ,"control:httpWhitelist:config"} - ,logical=Logical.OR) - public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){ - httpRedirectCfgService.updateHttpCfgValid(isValid,ids,functionId); - return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId; + + @RequestMapping(value = { "delete" }) + @RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config", + "control:httpReplace:config", "control:httpMinit:config", + "control:httpWhitelist:config" }, logical = Logical.OR) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId) { + httpRedirectCfgService.updateHttpCfgValid(isValid, ids, functionId); + return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId; } - @RequestMapping(value = {"audit"}) - @RequiresPermissions(value={"control:httpBlock:confirm" - ,"control:httpRedirect:confirm" - ,"control:httpReplace:confirm" - ,"control:httpMinit:confirm" - ,"control:httpWhitelist:confirm"} - ,logical=Logical.OR) - public String audit(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)) { - CfgIndexInfo entity = new CfgIndexInfo(); - String[] idArray = ids.split(","); - for(String id :idArray){ - entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(id),null); - entity.setIsAudit(isAudit); - entity.setIsValid(isValid); - entity.setAuditorId(UserUtils.getUser().getId()); - entity.setAuditTime(new Date()); - entity.setFunctionId(functionId); - try { - httpRedirectCfgService.auditHttpCfg(entity,isAudit); - addMessage(redirectAttributes,"success", "audit_success"); - } catch ( Exception e) { - e.printStackTrace(); - logger.info("http重定向配置下发失败:"+e.getMessage()); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","audit_failed"); - } - } - } - }else{//条件下所有配置审核 - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); - BeanUtils.copyProperties(searchPage, auditPage); - + + @RequestMapping(value = { "audit" }) + @RequiresPermissions(value = { "control:httpBlock:confirm", "control:httpRedirect:confirm", + "control:httpReplace:confirm", "control:httpMinit:confirm", + "control:httpWhitelist:confirm" }, logical = Logical.OR) + public String audit(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { + CfgIndexInfo entity = new CfgIndexInfo(); + String[] idArray = ids.split(","); + for (String id : idArray) { + entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(id), null); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); try { - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + httpRedirectCfgService.auditHttpCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + e.printStackTrace(); + logger.info("http重定向配置下发失败:" + e.getMessage()); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - } - - return list(model, request, response, cfg); } - return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId; - } - - - //http配置导出 - @RequestMapping(value = "exportHttp") - public void exportHttp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ + } else {// 条件下所有配置审核 + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); + BeanUtils.copyProperties(searchPage, auditPage); + try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity); - ipLists=page.getList(); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); + } + + } + + return list(model, request, response, cfg); + } + return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId; + } + + // http配置导出 + @RequestMapping(value = "exportHttp") + public void exportHttp(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity); + ipLists = page.getList(); + } + + Properties prop = getMsgProp(); + for (CfgIndexInfo str : ipLists) { + if (entity.getFunctionId() != 210 && entity.getFunctionId() != 211) { + String type = "RESPONSE_CODE"; + if (entity.getFunctionId() == 207) { + type = "RESPONSE_CODE"; + } else if (entity.getFunctionId() == 208) { + type = "REDIRECT_RESPONSE_CODE"; + } else if (entity.getFunctionId() == 209) { + type = "CONTROL_REPLACE_ZONE"; } - - Properties prop = getMsgProp(); - for (CfgIndexInfo str :ipLists) { - if(entity.getFunctionId()!=210 && entity.getFunctionId()!=211){ - String type="RESPONSE_CODE"; - if(entity.getFunctionId()==207){ - type="RESPONSE_CODE"; - }else if(entity.getFunctionId()==208){ - type="REDIRECT_RESPONSE_CODE"; - }else if(entity.getFunctionId()==209){ - type="CONTROL_REPLACE_ZONE"; - } - String dictlabel= DictUtils.getDictLabel(type, str.getUserRegion1()); - str.setUserRegion1(prop.getProperty(dictlabel)); - if(entity.getFunctionId()==207 || entity.getFunctionId()==208){ - if(StringUtil.isEmpty(str.getUserRegion2())){ - if(!StringUtil.isEmpty(str.getUserRegion3())){ - ProxyFileStrategyCfg file= new ProxyFileStrategyCfg(); - file.setCompileId(Integer.valueOf(str.getUserRegion3())); - List allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(file); - if(allProxyFileStrategys!=null && allProxyFileStrategys.size()>0){ - str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc()); - } + String dictlabel = DictUtils.getDictLabel(type, str.getUserRegion1()); + str.setUserRegion1(prop.getProperty(dictlabel)); + if (entity.getFunctionId() == 207 || entity.getFunctionId() == 208) { + if (StringUtil.isEmpty(str.getUserRegion2())) { + if (!StringUtil.isEmpty(str.getUserRegion3())) { + ProxyFileStrategyCfg file = new ProxyFileStrategyCfg(); + file.setCompileId(Integer.valueOf(str.getUserRegion3())); + List allProxyFileStrategys = proxyFileStrategyService + .getProxyFileStrategyCfgList(file); + if (allProxyFileStrategys != null && allProxyFileStrategys.size() > 0) { + str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc()); } } - } } } - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - if(entity.getFunctionId()==207){ - cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-"; - }else if(entity.getFunctionId()==208){ - cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:redirect_response_code-userregion2:redirect_url-"; - }else if(entity.getFunctionId()==209){ - cfgIndexInfoNoExport=",policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-"; - }else if(entity.getFunctionId()==211){ - cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - } - String httpUrlCfgNoExport=",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,"; - String httpReqHeadCfgNoExport=",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,"; - String httpResHeadCfgNoExport=",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,"; - String httpReqBodyCfgNoExport=",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,"; - String httpResBodyCfgNoExport=",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,"; - String ipPortCfgNoExport=",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 ntcSubscribeIdCfgNoExport=",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,"; - List httpUrlList = new ArrayList<>(); - List httpReqHdrList = new ArrayList<>(); - List httpResHdrList = new ArrayList<>(); - List httpReqBodyList = new ArrayList<>(); - List httpResBodyList = new ArrayList<>(); - List ipPortList = new ArrayList<>(); - List subscribeIdList = new ArrayList<>(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=httpRedirectCfgService.exportHttpCfg(cfg); - httpUrlList.addAll(maps.get("NTC_HTTP_URL")); - httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR")); - httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR")); - httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY")); - httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY")); - ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP")); - subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - httpUrlList=BaseStringCfg.replaceBaseKeyList(httpUrlList); - httpReqHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList); - httpResHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList); - httpReqBodyList=BaseStringCfg.replaceBaseKeyList(httpReqBodyList); - httpResBodyList=BaseStringCfg.replaceBaseKeyList(httpResBodyList); - subscribeIdList=BaseStringCfg.baseHexList(subscribeIdList); - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_HTTP_URL"); - titleList.add("NTC_HTTP_REQ_HDR"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); - classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class); - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport); - noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport); - dataMap.put(entity.getMenuNameCode(), ipLists); - dataMap.put("NTC_HTTP_URL", httpUrlList); - dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList); - if(entity.getFunctionId()!=208 && entity.getFunctionId()!=211){ - titleList.add("NTC_HTTP_RES_BODY"); - classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class); - noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport); - dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList); - }else if(entity.getFunctionId()!=211){ - titleList.add("NTC_HTTP_RES_HDR"); - titleList.add("NTC_HTTP_REQ_BODY"); - classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class); - classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class); - noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport); - noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport); - dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList); - dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList); - } - titleList.add("NTC_UNIVERSAL_IP"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - dataMap.put("NTC_UNIVERSAL_IP", ipPortList); - dataMap.put("NTC_SUBSCRIBE_ID",subscribeIdList); - - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("http export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + } } - /*return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();*/ + String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + if (entity.getFunctionId() == 207) { + cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-"; + } else if (entity.getFunctionId() == 208) { + cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:redirect_response_code-userregion2:redirect_url-"; + } else if (entity.getFunctionId() == 209) { + cfgIndexInfoNoExport = ",policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-"; + } else if (entity.getFunctionId() == 211) { + cfgIndexInfoNoExport = ",do_log,log_total,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + } + String httpUrlCfgNoExport = ",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,"; + String httpReqHeadCfgNoExport = ",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,"; + String httpResHeadCfgNoExport = ",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,"; + String httpReqBodyCfgNoExport = ",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,"; + String httpResBodyCfgNoExport = ",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,"; + String ipPortCfgNoExport = ",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 ntcSubscribeIdCfgNoExport = ",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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + List httpUrlList = new ArrayList<>(); + List httpReqHdrList = new ArrayList<>(); + List httpResHdrList = new ArrayList<>(); + List httpReqBodyList = new ArrayList<>(); + List httpResBodyList = new ArrayList<>(); + List ipPortList = new ArrayList<>(); + List subscribeIdList = new ArrayList<>(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = httpRedirectCfgService.exportHttpCfg(cfg); + httpUrlList.addAll(maps.get("NTC_HTTP_URL")); + httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR")); + httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR")); + httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY")); + httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY")); + ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP")); + subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + httpUrlList = BaseStringCfg.replaceBaseKeyList(httpUrlList); + httpReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList); + httpResHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList); + httpReqBodyList = BaseStringCfg.replaceBaseKeyList(httpReqBodyList); + httpResBodyList = BaseStringCfg.replaceBaseKeyList(httpResBodyList); + subscribeIdList = BaseStringCfg.baseHexList(subscribeIdList); + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_HTTP_URL"); + titleList.add("NTC_HTTP_REQ_HDR"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); + classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class); + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport); + noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("NTC_HTTP_URL", httpUrlList); + dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList); + if (entity.getFunctionId() != 208 && entity.getFunctionId() != 211) { + titleList.add("NTC_HTTP_RES_BODY"); + classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class); + noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport); + dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList); + } else if (entity.getFunctionId() != 211) { + titleList.add("NTC_HTTP_RES_HDR"); + titleList.add("NTC_HTTP_REQ_BODY"); + classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class); + classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class); + noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport); + noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport); + dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList); + dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList); + } + titleList.add("NTC_UNIVERSAL_IP"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + dataMap.put("NTC_UNIVERSAL_IP", ipPortList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList); + + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("http export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } + /* + * return "redirect:" + adminPath + * +"/ntc/website/httpList?functionId="+entity.getFunctionId(); + */ + } } diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java index c96d0c2a3..bd907b350 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java @@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; - import com.nis.domain.Page; import com.nis.domain.basics.PolicyGroupInfo; import com.nis.domain.configuration.BaseStringCfg; @@ -36,315 +35,347 @@ import com.nis.web.security.UserUtils; /** * IP相关配置控制类 + * * @author dell * */ @Controller -@RequestMapping(value={"${adminPath}/proxy/intercept"}) -public class InterceptController extends CommonController{ - - @RequestMapping(value = {"/ip/list","/domain/list","/ippayload/list"}) - public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { - Page searchPage=new Page(request,response,"a"); +@RequestMapping(value = { "${adminPath}/proxy/intercept" }) +public class InterceptController extends CommonController { + + @RequestMapping(value = { "/ip/list", "/domain/list", "/ippayload/list" }) + public String ipList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, + HttpServletResponse response) { + Page searchPage = new Page(request, response, "a"); Page page = websiteCfgService.getWebsiteList(searchPage, cfg); model.addAttribute("page", page); - initPageCondition(model,cfg); - - //获取证书信息 - List certificateList=new ArrayList(); - if(cfg.getFunctionId().equals(200)){ - certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); + initPageCondition(model, cfg); + + // 获取证书信息 + List certificateList = new ArrayList(); + if (cfg.getFunctionId().equals(200)) { + certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); } - if(cfg.getFunctionId().equals(201)){ - certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); + if (cfg.getFunctionId().equals(201)) { + certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); } model.addAttribute("certificateList", certificateList); - //IP地址仿冒策略使用策略组 - List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(6); + // IP地址仿冒策略使用策略组 + List policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6); model.addAttribute("policyGroups", policyGroups); return "/cfg/intercept/interceptList"; } - @RequestMapping(value = {"/interceptIpForm","interceptDomainForm","interceptIpPayloadForm"}) - public String interceptIpForm(Model model,String ids,CfgIndexInfo entity) { - if(StringUtils.isNotBlank(ids)){ - entity = interceptCfgService.getInterceptCfg(Long.parseLong(ids),null); - initUpdateFormCondition(model,entity); - }else{ - initFormCondition(model,entity); + + @RequestMapping(value = { "/interceptIpForm", "interceptDomainForm", "interceptIpPayloadForm" }) + public String interceptIpForm(Model model, String ids, CfgIndexInfo entity) { + if (StringUtils.isNotBlank(ids)) { + entity = interceptCfgService.getInterceptCfg(Long.parseLong(ids), null); + initUpdateFormCondition(model, entity); + } else { + initFormCondition(model, entity); } - //获取证书信息 - List certificateList=new ArrayList(); - if(entity.getFunctionId().equals(200)){ - certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); + // 获取证书信息 + List certificateList = new ArrayList(); + if (entity.getFunctionId().equals(200)) { + certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); } - if(entity.getFunctionId().equals(201)){ - certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); + if (entity.getFunctionId().equals(201)) { + certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); } model.addAttribute("certificateList", certificateList); - + model.addAttribute("_cfg", entity); - //IP地址仿冒策略使用策略组 - List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(6); + // IP地址仿冒策略使用策略组 + List policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6); model.addAttribute("policyGroups", policyGroups); - + return "/cfg/intercept/interceptForm"; } - @RequestMapping(value = {"/ip/saveOrUpdate","/domain/saveOrUpdate","/ippayload/SaveOrUpdate"}) - public String saveInterceptIpCfg(RedirectAttributes redirectAttributes,Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) { + + @RequestMapping(value = { "/ip/saveOrUpdate", "/domain/saveOrUpdate", "/ippayload/SaveOrUpdate" }) + public String saveInterceptIpCfg(RedirectAttributes redirectAttributes, Model model, HttpServletRequest request, + HttpServletResponse response, String ids, CfgIndexInfo entity) { try { interceptCfgService.saveInterceptCfg(entity); - addMessage(redirectAttributes,"success","save_success"); + addMessage(redirectAttributes, "success", "save_success"); } catch (Exception e) { logger.error("save_failed", e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); } } - return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+entity.getFunctionId(); + return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + entity.getFunctionId(); } - - @RequestMapping(value = {"/ajaxInterceptIpSubList","/ajaxInterceptDomainSubList","/ajaxInterceptIpPayloadSubList"}) - public String ajaxInterceptIpSubList(Model model,Long cfgId,Integer index,Integer compileId) { - CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId,compileId); + + @RequestMapping(value = { "/ajaxInterceptIpSubList", "/ajaxInterceptDomainSubList", + "/ajaxInterceptIpPayloadSubList" }) + public String ajaxInterceptIpSubList(Model model, Long cfgId, Integer index, Integer compileId) { + CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId, compileId); List tabList = new ArrayList(); - if(cfg.getIpPortList()!=null){ + if (cfg.getIpPortList() != null) { String cfgType = null; - for(IpPortCfg ip:cfg.getIpPortList()){ - if(!ip.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"1",ip.getCfgType()}); + for (IpPortCfg ip : cfg.getIpPortList()) { + if (!ip.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "1", ip.getCfgType() }); cfgType = ip.getCfgType(); } } } - if(cfg.getInterceptPktBinList()!=null){ + if (cfg.getInterceptPktBinList() != null) { String cfgType = null; - for(BaseStringCfg keyword:cfg.getInterceptPktBinList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (BaseStringCfg keyword : cfg.getInterceptPktBinList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - if(cfg.getHttpUrlList()!=null){ + if (cfg.getHttpUrlList() != null) { String cfgType = null; - for(BaseStringCfg keyword:cfg.getHttpUrlList()){ - if(!keyword.getCfgType().equals(cfgType)){ - tabList.add(new String[]{"2",keyword.getCfgType()}); + for (BaseStringCfg keyword : cfg.getHttpUrlList()) { + if (!keyword.getCfgType().equals(cfgType)) { + tabList.add(new String[] { "2", keyword.getCfgType() }); cfgType = keyword.getCfgType(); } } } - model.addAttribute("_cfg", cfg); + model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); return "/cfg/intercept/interceptSubList"; } - - @RequestMapping(value = {"auditInterceptIpCfg","auditInterceptDomainCfg","auditInterceptIpPayloadCfg"}) - public String auditInterceptIpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)) { + + @RequestMapping(value = { "auditInterceptIpCfg", "auditInterceptDomainCfg", "auditInterceptIpPayloadCfg" }) + public String auditInterceptIpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); - for(String id :idArray){ - entity = interceptCfgService.getInterceptCfg(Long.parseLong(id),null); + for (String id : idArray) { + entity = interceptCfgService.getInterceptCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - interceptCfgService.auditInterceptIpCfg(entity,isAudit); - addMessage(redirectAttributes,"success","audit_success"); - } catch ( Exception e) { - logger.error("intercept ip audit failed",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + interceptCfgService.auditInterceptIpCfg(entity, isAudit); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("intercept ip audit failed", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } } } - }else{//条件下所有配置审核 - Page searchPage=new Page(request,response,"a"); - Page auditPage=new Page(request,response,"a"); + } else {// 条件下所有配置审核 + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); BeanUtils.copyProperties(searchPage, auditPage); - + try { - auditAll(auditPage,isValid , cfg); + auditAll(auditPage, isValid, cfg); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - + return ipList(model, cfg, request, response); } - return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId; + return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + functionId; } - - @RequestMapping(value = {"updateInterceptIpValid","updateInterceptDomainValid","updateInterceptIpPayloadValid"}) - public String updateInterceptIpValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + + @RequestMapping(value = { "updateInterceptIpValid", "updateInterceptDomainValid", "updateInterceptIpPayloadValid" }) + public String updateInterceptIpValid(Integer isValid, String ids, Integer functionId, + RedirectAttributes redirectAttributes) { try { - interceptCfgService.updatInterceptValid(isValid,ids,functionId); - addMessage(redirectAttributes,"success","delete_success"); + interceptCfgService.updatInterceptValid(isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); } catch (Exception e) { - logger.error("intercept ip delete failed",e); - addMessage(redirectAttributes,"error","delete_failed"); + logger.error("intercept ip delete failed", e); + addMessage(redirectAttributes, "error", "delete_failed"); } - return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId; + return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + functionId; } - + /* - //ip配置导入 - @RequestMapping(value = "/ip/import", method=RequestMethod.POST) - public String importIp(String cfgName,RedirectAttributes redirectAttributes, - @RequestParam("file") MultipartFile file,IpPortCfg cfg) { - this._importIp(cfgName,redirectAttributes, file,cfg,IpAddrTemplate.class); - redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip"); - redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip"); - return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId(); - } - @RequestMapping(value = "/ip/import/template") - public void importFileTemplate(HttpServletRequest request,HttpServletResponse response, - RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) { - this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpAddrTemplate.class); - } - //ip配置导出 - @RequestMapping(value = "/ip/export") - public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){ - this._exportIp(columns,model, request, response, entity, ids, redirectAttributes); - }*/ - - //ip配置导出 - @RequestMapping(value = "exportIpAddr") - public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - Map replaceExportMap=new HashMap(); - Properties prop = getMsgProp(); - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=ipCfgService.getByIdsList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipCfgService.getIpCfgList(pageInfo, entity); - ipLists=page.getList(); - } - //获取证书信息 - List certificateList=new ArrayList(); - if(entity.getFunctionId().equals(200)){ - certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); - } - if(entity.getFunctionId().equals(201)){ - certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); - } - for (CfgIndexInfo str : ipLists) { - if(!StringUtil.isEmpty(str.getUserRegion5())){ - String cs= DictUtils.getDictLabel("INTERCEPT_DOMAIN_INTENSITY", str.getUserRegion5()); - str.setUserRegion5(prop.getProperty(cs)); - } - if(certificateList!=null){ - if(entity.getFunctionId()==200|| entity.getFunctionId()==201){ - if(!StringUtil.isEmpty(str.getUserRegion1())){ - boolean flag=false; - for (PxyObjKeyring pxyObjKeyring : certificateList) { - if(str.getUserRegion1().equals(String.valueOf(pxyObjKeyring.getCompileId()))){ - str.setUserRegion1(pxyObjKeyring.getCfgDesc()); - flag=true; - break; - } - } - if(!flag){ - str.setUserRegion1(null); - } - } - } - - } - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - String cfgIndexInfoNoExport=""; - 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 interceptNoExport=",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 httpUrlCfgNoExport=",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,"; - - List ipList=new ArrayList(); - List httpUrlList=new ArrayList(); - List pktBinList=new ArrayList(); - for (CfgIndexInfo cfg : ipLists) { - Map maps=interceptCfgService.exportIpInfo(cfg); - httpUrlList.addAll(maps.get("NTC_HTTP_URL")); - ipList.addAll(maps.get("PXY_INTERCEPT_IP")); - pktBinList.addAll(maps.get("PXY_INTERCEPT_PKT_BIN")); - } - pktBinList=BaseStringCfg.replaceBaseKeyList(pktBinList); - httpUrlList=BaseStringCfg.baseHexList(httpUrlList); - dataMap.put(entity.getMenuNameCode(), ipLists); - if(entity.getFunctionId()==212){ //IP Payload - cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-"; - titleList.add("PXY_INTERCEPT_IP"); - titleList.add("PXY_INTERCEPT_PKT_BIN"); - classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class); - classMap.put("PXY_INTERCEPT_PKT_BIN", InterceptPktBin.class); - noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport); - noExportMap.put("PXY_INTERCEPT_PKT_BIN", interceptNoExport); - dataMap.put("PXY_INTERCEPT_IP", ipList); - dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList); - }else if(entity.getFunctionId()==200){//IP拦截 - cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:ratelimit-userregion1:certificate-"; - titleList.add("PXY_INTERCEPT_IP"); - classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class); - noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport); - dataMap.put("PXY_INTERCEPT_IP", ipList); - }else if(entity.getFunctionId()==201){//域名拦截 - cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,&userregion2:ratelimit-userregion1:certificate-userregion5:intercept_intensity-"; - titleList.add("NTC_HTTP_URL"); - classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); - noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport); - dataMap.put("NTC_HTTP_URL", httpUrlList); - } - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("ip addr export failed",e); - addMessage(redirectAttributes,"error","export_failed"); + * //ip配置导入 + * + * @RequestMapping(value = "/ip/import", method=RequestMethod.POST) public + * String importIp(String cfgName,RedirectAttributes redirectAttributes, + * + * @RequestParam("file") MultipartFile file,IpPortCfg cfg) { + * this._importIp(cfgName,redirectAttributes, + * file,cfg,IpAddrTemplate.class); + * redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip"); + * redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip" + * ); return "redirect:" + adminPath + * +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId(); } + * + * @RequestMapping(value = "/ip/import/template") public void + * importFileTemplate(HttpServletRequest request,HttpServletResponse + * response, RedirectAttributes redirectAttributes,Integer + * functionId,Integer cfgRegionCode) { this._importFileTemplate(request, + * response, redirectAttributes, functionId, + * cfgRegionCode,IpAddrTemplate.class); } //ip配置导出 + * + * @RequestMapping(value = "/ip/export") public void exportIp(String + * columns,Model model,HttpServletRequest request,HttpServletResponse + * response, + * + * @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes + * redirectAttributes){ this._exportIp(columns,model, request, response, + * entity, ids, redirectAttributes); } + */ + + // ip配置导出 + @RequestMapping(value = "exportIpAddr") + public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + Map replaceExportMap = new HashMap(); + Properties prop = getMsgProp(); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = ipCfgService.getByIdsList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipCfgService.getIpCfgList(pageInfo, entity); + ipLists = page.getList(); } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + // 获取证书信息 + List certificateList = new ArrayList(); + if (entity.getFunctionId().equals(200)) { + certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); + } + if (entity.getFunctionId().equals(201)) { + certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); + } + for (CfgIndexInfo str : ipLists) { + if (!StringUtil.isEmpty(str.getUserRegion5())) { + String cs = DictUtils.getDictLabel("INTERCEPT_DOMAIN_INTENSITY", str.getUserRegion5()); + str.setUserRegion5(prop.getProperty(cs)); + } + if (certificateList != null) { + if (entity.getFunctionId() == 200 || entity.getFunctionId() == 201) { + if (!StringUtil.isEmpty(str.getUserRegion1())) { + boolean flag = false; + for (PxyObjKeyring pxyObjKeyring : certificateList) { + if (str.getUserRegion1().equals(String.valueOf(pxyObjKeyring.getCompileId()))) { + str.setUserRegion1(pxyObjKeyring.getCfgDesc()); + flag = true; + break; + } + } + if (!flag) { + str.setUserRegion1(null); + } + } + } + + } + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + String cfgIndexInfoNoExport = ""; + 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 interceptNoExport = ",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 httpUrlCfgNoExport = ",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,"; + + List ipList = new ArrayList(); + List httpUrlList = new ArrayList(); + List pktBinList = new ArrayList(); + for (CfgIndexInfo cfg : ipLists) { + Map maps = interceptCfgService.exportIpInfo(cfg); + httpUrlList.addAll(maps.get("NTC_HTTP_URL")); + ipList.addAll(maps.get("PXY_INTERCEPT_IP")); + pktBinList.addAll(maps.get("PXY_INTERCEPT_PKT_BIN")); + } + pktBinList = BaseStringCfg.replaceBaseKeyList(pktBinList); + httpUrlList = BaseStringCfg.baseHexList(httpUrlList); + dataMap.put(entity.getMenuNameCode(), ipLists); + if (entity.getFunctionId() == 212) { // IP Payload + cfgIndexInfoNoExport = ",do_log,log_total,policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-"; + titleList.add("PXY_INTERCEPT_IP"); + titleList.add("PXY_INTERCEPT_PKT_BIN"); + classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class); + classMap.put("PXY_INTERCEPT_PKT_BIN", InterceptPktBin.class); + noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport); + noExportMap.put("PXY_INTERCEPT_PKT_BIN", interceptNoExport); + dataMap.put("PXY_INTERCEPT_IP", ipList); + dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList); + } else if (entity.getFunctionId() == 200) {// IP拦截 + cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:ratelimit-userregion1:certificate-"; + titleList.add("PXY_INTERCEPT_IP"); + classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class); + noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport); + dataMap.put("PXY_INTERCEPT_IP", ipList); + } else if (entity.getFunctionId() == 201) {// 域名拦截 + cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,&userregion2:ratelimit-userregion1:certificate-userregion5:intercept_intensity-"; + titleList.add("NTC_HTTP_URL"); + classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); + noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport); + dataMap.put("NTC_HTTP_URL", httpUrlList); + }else if(entity.getFunctionId()==214){ + cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:With-userregion1:Spoofing-"; + } + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("ip addr export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + } diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java index 7ad6a5603..531c5fc9f 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java @@ -61,827 +61,854 @@ import com.nis.web.controller.BaseController; /** * 拦截策略 + * * @author ddm * */ @Controller @RequestMapping("${adminPath}/proxy/intercept/strateagy") -public class PxyObjKeyringController extends BaseController { - public Map certInfoMap=new HashMap<>(); - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - @RequestMapping(value = {"/form"}) - @RequiresPermissions(value={"proxy:intercept:config"}) - public String from(Model model, - HttpServletRequest request, - HttpServletResponse response, - String ids, - @ModelAttribute("cfg")PxyObjKeyring cfg - ,RedirectAttributes redirectAttributes){ - if(cfg == null){ - cfg=new PxyObjKeyring(); +public class PxyObjKeyringController extends BaseController { + public Map certInfoMap = new HashMap<>(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + @RequestMapping(value = { "/form" }) + @RequiresPermissions(value = { "proxy:intercept:config" }) + public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") PxyObjKeyring cfg, RedirectAttributes redirectAttributes) { + if (cfg == null) { + cfg = new PxyObjKeyring(); } - if(!StringUtil.isEmpty(ids)){ - cfg = pxyObjKeyringService.getPxyObjKeyring(Long.valueOf(ids),-1); + if (!StringUtil.isEmpty(ids)) { + cfg = pxyObjKeyringService.getPxyObjKeyring(Long.valueOf(ids), -1); initFormCondition(model, cfg); model.addAttribute("isAdd", false); - }else{ + } else { initFormCondition(model, cfg); model.addAttribute("isAdd", true); } - + model.addAttribute("_cfg", cfg); return "/cfg/intercept/strateagy/form"; } - - @RequestMapping(value = {"/saveOrUpdate"}) - @RequiresPermissions(value={"proxy:intercept:config"}) - public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")PxyObjKeyring cfg, - MultipartFile privateKeyFileI, - MultipartFile publicKeyFileI, - RedirectAttributes redirectAttributes){ - File file = null; - boolean validFlag=true; - try { - Properties msgProp = this.getMsgProp(); - boolean publicKeyFileflag=validCertFileContent(publicKeyFileI,"-incert"); - boolean privateKeyFileflag=validCertFileContent(privateKeyFileI,"-inkey"); - if(!publicKeyFileflag && !privateKeyFileflag){ - addMessage(redirectAttributes,"error","save_failed"); - logger.error(publicKeyFileI.getOriginalFilename()+" and "+privateKeyFileI.getOriginalFilename()+" file non certificate file format "); - throw new MultiPartNewException( - msgProp.getProperty("certificate_error") - ); - }else if(!publicKeyFileflag){ - addMessage(redirectAttributes,"error","save_failed"); - logger.error(publicKeyFileI.getOriginalFilename()+" file non public key file format "); - throw new MultiPartNewException(msgProp.getProperty("public_file_error")); - }else if(!privateKeyFileflag){ - addMessage(redirectAttributes,"error","save_failed"); - logger.error(privateKeyFileI.getOriginalFilename()+" file non private key file format "); - throw new MultiPartNewException(msgProp.getProperty("private_file_error")); - } + + @RequestMapping(value = { "/saveOrUpdate" }) + @RequiresPermissions(value = { "proxy:intercept:config" }) + public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") PxyObjKeyring cfg, MultipartFile privateKeyFileI, MultipartFile publicKeyFileI, + RedirectAttributes redirectAttributes) { + File file = null; + boolean validFlag = true; + try { + Properties msgProp = this.getMsgProp(); + boolean publicKeyFileflag = validCertFileContent(publicKeyFileI, "-incert"); + boolean privateKeyFileflag = validCertFileContent(privateKeyFileI, "-inkey"); + if (!publicKeyFileflag && !privateKeyFileflag) { + addMessage(redirectAttributes, "error", "save_failed"); + logger.error(publicKeyFileI.getOriginalFilename() + " and " + privateKeyFileI.getOriginalFilename() + + " file non certificate file format "); + throw new MultiPartNewException(msgProp.getProperty("certificate_error")); + } else if (!publicKeyFileflag) { + addMessage(redirectAttributes, "error", "save_failed"); + logger.error(publicKeyFileI.getOriginalFilename() + " file non public key file format "); + throw new MultiPartNewException(msgProp.getProperty("public_file_error")); + } else if (!privateKeyFileflag) { + addMessage(redirectAttributes, "error", "save_failed"); + logger.error(privateKeyFileI.getOriginalFilename() + " file non private key file format "); + throw new MultiPartNewException(msgProp.getProperty("private_file_error")); + } } catch (Exception e) { - validFlag=false; - logger.error("证书文件校验失败",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof MaatConvertException){ - addMessage(redirectAttributes,"error",e.getMessage()); - }else { - addMessage(redirectAttributes,"error","save_failed"); - } + validFlag = false; + logger.error("证书文件校验失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + } } - - try{ - if(validFlag){ - validFlag=true; - if(publicKeyFileI != null) { + + try { + if (validFlag) { + validFlag = true; + if (publicKeyFileI != null) { // 获取公钥信息 - if(certInfoMap != null && certInfoMap.size() >0){ - - String issuer=StringUtil.isEmpty(certInfoMap.get("ca issuer")) ? "":certInfoMap.get("ca issuer").toString();//颁发者 - String subject=StringUtil.isEmpty(certInfoMap.get("ca subjectname")) ? "":certInfoMap.get("ca subjectname").toString();//颁发给 - String notBeforeStr=""; + if (certInfoMap != null && certInfoMap.size() > 0) { + + String issuer = StringUtil.isEmpty(certInfoMap.get("ca issuer")) ? "" + : certInfoMap.get("ca issuer").toString();// 颁发者 + String subject = StringUtil.isEmpty(certInfoMap.get("ca subjectname")) ? "" + : certInfoMap.get("ca subjectname").toString();// 颁发给 + String notBeforeStr = ""; if (!StringUtil.isEmpty(certInfoMap.get("ca notbefore"))) { - Date notBeforeTime=new Date(certInfoMap.get("ca notbefore").toString());//开始时间 - notBeforeStr=sdf.format(notBeforeTime); + Date notBeforeTime = new Date(certInfoMap.get("ca notbefore").toString());// 开始时间 + notBeforeStr = sdf.format(notBeforeTime); } - String notAfterStr=""; + String notAfterStr = ""; if (!StringUtil.isEmpty(certInfoMap.get("ca notafter"))) { - Date notAfterTime=new Date(certInfoMap.get("ca notafter").toString());//结束时间 - notAfterStr=sdf.format(notAfterTime); + Date notAfterTime = new Date(certInfoMap.get("ca notafter").toString());// 结束时间 + notAfterStr = sdf.format(notAfterTime); } - String cn="";//CN - //CN精确信息获取 - if(!StringUtil.isEmpty(subject)){ - for (String cnStr : subject.split(",")) { - cnStr=StringUtil.isEmpty(cnStr) ? "":cnStr.trim(); - if(cnStr.split("=").length > 1){ - cn=cnStr.split("=")[1]; - cn=StringUtil.isEmpty(cn) ? "":cn.trim(); + String cn = "";// CN + // CN精确信息获取 + if (!StringUtil.isEmpty(subject)) { + for (String cnStr : subject.split(",")) { + cnStr = StringUtil.isEmpty(cnStr) ? "" : cnStr.trim(); + if (cnStr.split("=").length > 1) { + cn = cnStr.split("=")[1]; + cn = StringUtil.isEmpty(cn) ? "" : cn.trim(); } } } - String altName=StringUtil.isEmpty(certInfoMap.get("ca altname")) ? "":certInfoMap.get("ca altname").toString();//SAN - + String altName = StringUtil.isEmpty(certInfoMap.get("ca altname")) ? "" + : certInfoMap.get("ca altname").toString();// SAN + cfg.setIssuer(issuer); cfg.setSubject(subject); cfg.setCn(cn); cfg.setAltName(altName); cfg.setNotBeforeTime(notBeforeStr); cfg.setNotAfterTime(notAfterStr); - }else{ + } else { logger.info("无证书信息"); } } } - }catch (Exception e) { - validFlag=false; - logger.error("证书信息获取失败",e); - logger.error("证书文件校验失败",e); - if(e instanceof MaatConvertException){ - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof MultiPartNewException){ - addMessage(redirectAttributes,"error",e.getMessage()); - }else{ - addMessage(redirectAttributes,"error","save_failed"); - } - } - try{ - if(validFlag){ - if(publicKeyFileI != null) { + } catch (Exception e) { + validFlag = false; + logger.error("证书信息获取失败", e); + logger.error("证书文件校验失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof MultiPartNewException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + } + } + try { + if (validFlag) { + if (publicKeyFileI != null) { String filename = publicKeyFileI.getOriginalFilename(); String prefix = FileUtils.getPrefix(filename, false); String suffix = FileUtils.getSuffix(filename, false); - file = File.createTempFile("file_"+ prefix, suffix); - publicKeyFileI.transferTo(file);//复制文件 + file = File.createTempFile("file_" + prefix, suffix); + publicKeyFileI.transferTo(file);// 复制文件 String md5 = FileUtils.getFileMD5(file); - Map srcMap = Maps.newHashMap(); + Map srcMap = Maps.newHashMap(); srcMap.put("filetype", suffix); - srcMap.put("datatype", "dbSystem");//源文件存入数据中心 - srcMap.put("createTime",new Date()); - srcMap.put("key",prefix); + srcMap.put("datatype", "dbSystem");// 源文件存入数据中心 + srcMap.put("createTime", new Date()); + srcMap.put("key", prefix); srcMap.put("fileName", filename); srcMap.put("checksum", md5); ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); - logger.info("proxy 证书文件策略公钥 文件上传响应信息:"+JsonMapper.toJsonString(result)); + logger.info("proxy 证书文件策略公钥 文件上传响应信息:" + JsonMapper.toJsonString(result)); String publicKeyFileAccessUrl = null; - if(!StringUtil.isEmpty(result)){ + if (!StringUtil.isEmpty(result)) { ResponseData data = result.getData(); - publicKeyFileAccessUrl=data.getAccessUrl(); - cfg.setPublicKeyFile(publicKeyFileAccessUrl);; + publicKeyFileAccessUrl = data.getAccessUrl(); + cfg.setPublicKeyFile(publicKeyFileAccessUrl); + ; } - } - if(privateKeyFileI != null) { + } + if (privateKeyFileI != null) { String filename = privateKeyFileI.getOriginalFilename(); String prefix = FileUtils.getPrefix(filename, false); String suffix = FileUtils.getSuffix(filename, false); - file = File.createTempFile("file_"+ prefix, suffix); - privateKeyFileI.transferTo(file);//复制文件 + file = File.createTempFile("file_" + prefix, suffix); + privateKeyFileI.transferTo(file);// 复制文件 String md5 = FileUtils.getFileMD5(file); - Map srcMap = Maps.newHashMap(); + Map srcMap = Maps.newHashMap(); srcMap.put("filetype", suffix); - srcMap.put("datatype", "dbSystem");//源文件存入数据中心 - srcMap.put("createTime",new Date()); - srcMap.put("key",prefix); + srcMap.put("datatype", "dbSystem");// 源文件存入数据中心 + srcMap.put("createTime", new Date()); + srcMap.put("key", prefix); srcMap.put("fileName", filename); srcMap.put("checksum", md5); ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); - logger.info("proxy 证书文件策略私钥 上传响应信息:"+JsonMapper.toJsonString(result)); + logger.info("proxy 证书文件策略私钥 上传响应信息:" + JsonMapper.toJsonString(result)); String privateKeyFileAccessUrl = null; - if(!StringUtil.isEmpty(result)){ + if (!StringUtil.isEmpty(result)) { ResponseData data = result.getData(); - privateKeyFileAccessUrl=data.getAccessUrl(); - cfg.setPrivateKeyFile(privateKeyFileAccessUrl);; + privateKeyFileAccessUrl = data.getAccessUrl(); + cfg.setPrivateKeyFile(privateKeyFileAccessUrl); + ; } } pxyObjKeyringService.saveOrUpdate(cfg); - addMessage(redirectAttributes,"success","save_success"); - } - - }catch(Exception e){ - logger.error("证书上传失败",e); - if(e instanceof MaatConvertException){ - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof MultiPartNewException){ - addMessage(redirectAttributes,"error",e.getMessage()); - }else{ - addMessage(redirectAttributes,"error","save_failed"); - } - } - - return "redirect:" + adminPath +"/proxy/intercept/strateagy/list?functionId="+cfg.getFunctionId(); + addMessage(redirectAttributes, "success", "save_success"); + } + + } catch (Exception e) { + logger.error("证书上传失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof MultiPartNewException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + } + } + + return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + cfg.getFunctionId(); } - + /** * * @param file - * @param validateType --incert证书校验 --inkey 私钥 - * @param certType 证书类型 + * @param validateType + * --incert证书校验 --inkey 私钥 + * @param certType + * 证书类型 * @return * @throws Exception */ - public boolean validCertFileContent(MultipartFile file,String validateType)throws Exception{ + public boolean validCertFileContent(MultipartFile file, String validateType) throws Exception { String os = System.getProperty("os.name").toLowerCase(); - if(!os.contains("windows") && file != null){ - //证书文件临时保存路径 + if (!os.contains("windows") && file != null) { + // 证书文件临时保存路径 String certFilePath = Constants.CERT_FILE_PATH; FileUtils.createDirectory(certFilePath); - String filePath=certFilePath - +File.separator - +UUID.randomUUID() - +FileUtils.getSuffix(file.getOriginalFilename(), true); + String filePath = certFilePath + File.separator + UUID.randomUUID() + + FileUtils.getSuffix(file.getOriginalFilename(), true); File uploadFile = new File(filePath); FileCopyUtils.copy(file.getBytes(), uploadFile); - //加载x509脚本 - String x509Shell=Thread.currentThread() - .getContextClassLoader() - .getResource( - File.separator+"shell" - +File.separator - +Constants.CERT_VALIDATE_FILE).getPath(); - //x509脚本分配可执行权限 - Map resultMap1=this.execShell("","chmod","+x",x509Shell); - logger.info("x509 chmod +x :"+resultMap1.get("out").toString()); - logger.info("x509脚本分配可执行权限:"+"chmod"+" "+"+x"+" "+x509Shell); - //验证文件 - logger.info(x509Shell+" "+validateType+" "+filePath); - Map resultMap=this.execShell(x509Shell,validateType,filePath); - - if(resultMap == null || StringUtil.isEmpty(resultMap.get("out"))){ - //临时文件删除 - logger.info("delete file"+filePath); + // 加载x509脚本 + String x509Shell = Thread.currentThread().getContextClassLoader() + .getResource(File.separator + "shell" + File.separator + Constants.CERT_VALIDATE_FILE).getPath(); + // x509脚本分配可执行权限 + Map resultMap1 = this.execShell("", "chmod", "+x", x509Shell); + logger.info("x509 chmod +x :" + resultMap1.get("out").toString()); + logger.info("x509脚本分配可执行权限:" + "chmod" + " " + "+x" + " " + x509Shell); + // 验证文件 + logger.info(x509Shell + " " + validateType + " " + filePath); + Map resultMap = this.execShell(x509Shell, validateType, filePath); + + if (resultMap == null || StringUtil.isEmpty(resultMap.get("out"))) { + // 临时文件删除 + logger.info("delete file" + filePath); FileUtils.deleteFile(filePath); return false; - }else{ - /*logger.info("x509 Out Info:"+resultMap.get("out").toString()); - Pattern p = Pattern.compile("\\s*|\t|\r|\n"); - Matcher m = p.matcher(resultMap.get("out").toString()); - logger.info(m.replaceAll("test"));*/ - } - if(resultMap != null - && !StringUtil.isEmpty(resultMap.get("out")) - && (!(resultMap.get("out").toString().indexOf(Constants.CERT_VALIDATE_SUCCESS_INFO) > -1)) - ){ - logger.error("x509 Out Info:"+resultMap.get("out").toString()); - //临时文件删除 - logger.info("delete file"+filePath); + } else { + /* + * logger.info("x509 Out Info:"+resultMap.get("out").toString()) + * ; Pattern p = Pattern.compile("\\s*|\t|\r|\n"); Matcher m = + * p.matcher(resultMap.get("out").toString()); + * logger.info(m.replaceAll("test")); + */ + } + if (resultMap != null && !StringUtil.isEmpty(resultMap.get("out")) + && (!(resultMap.get("out").toString().indexOf(Constants.CERT_VALIDATE_SUCCESS_INFO) > -1))) { + logger.error("x509 Out Info:" + resultMap.get("out").toString()); + // 临时文件删除 + logger.info("delete file" + filePath); FileUtils.deleteFile(filePath); - + return false; } - //临时文件删除 - logger.info("delete file"+filePath); + // 临时文件删除 + logger.info("delete file" + filePath); FileUtils.deleteFile(filePath); } return true; } - @RequestMapping(value = {"/list"}) - public String list(Model model,HttpServletRequest request,HttpServletResponse response - ,@ModelAttribute("cfg")PxyObjKeyring entity - ,RedirectAttributes redirectAttributes){ - //查询时left join policyGroup - Page page = pxyObjKeyringService.findPage(new Page(request, response,"r"), entity); + + @RequestMapping(value = { "/list" }) + public String list(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") PxyObjKeyring entity, RedirectAttributes redirectAttributes) { + // 查询时left join policyGroup + Page page = pxyObjKeyringService.findPage(new Page(request, response, "r"), + entity); model.addAttribute("page", page); - initPageCondition(model,entity); + initPageCondition(model, entity); return "/cfg/intercept/strateagy/list"; } - - @RequestMapping(value = {"/delete"}) - @RequiresPermissions(value={"proxy:intercept:config"}) - public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId - ,Model model,HttpServletRequest request - ,HttpServletResponse response - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(ids)){ - pxyObjKeyringService.delete(isAudit,isValid,ids,functionId); + + @RequestMapping(value = { "/delete" }) + @RequiresPermissions(value = { "proxy:intercept:config" }) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { + pxyObjKeyringService.delete(isAudit, isValid, ids, functionId); } - - return "redirect:" + adminPath +"/proxy/intercept/strateagy/list?functionId="+functionId; + + return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + functionId; } - - @RequestMapping(value = {"/audit"}) - @RequiresPermissions(value={"proxy:intercept:confirm"}) - public String audit(Model model,@ModelAttribute("cfg")PxyObjKeyring cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ + + @RequestMapping(value = { "/audit" }) + @RequiresPermissions(value = { "proxy:intercept:confirm" }) + public String audit(Model model, @ModelAttribute("cfg") PxyObjKeyring cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ + Date auditTime = new Date(); + for (String id : idArray) { try { - pxyObjKeyringService.audit(isAudit,isValid,functionId,id,auditTime); - addMessage(redirectAttributes,"success", "audit_success"); + pxyObjKeyringService.audit(isAudit, isValid, functionId, id, auditTime); + addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { logger.error(e); - addMessage(redirectAttributes,"error", "request_service_failed"); - }catch (Exception e) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { logger.error(e); - addMessage(redirectAttributes,"error", "audit_failed"); + addMessage(redirectAttributes, "error", "audit_failed"); } } - - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); try { BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); } - + } - - return list(model, request, response, cfg,redirectAttributes); + + return list(model, request, response, cfg, redirectAttributes); } - return "redirect:" + adminPath +"/proxy/intercept/strateagy/list?functionId="+functionId; + return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + functionId; } + @ResponseBody @RequestMapping(value = "/validCfgId") public boolean validCfgId(Long cfgId) { - PxyObjKeyring dns=pxyObjKeyringService.getPxyObjKeyring(cfgId,null); - if(dns == null ){ + PxyObjKeyring dns = pxyObjKeyringService.getPxyObjKeyring(cfgId, null); + if (dns == null) { return false; - }else{ + } else { return true; } } - - - //pxyObjKeyring配置导出 - @RequestMapping(value = "exportPxy") - public void exportPxy(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")PxyObjKeyring entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=pxyObjKeyringService.findByList(ids); - }else{ - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = pxyObjKeyringService.findPage(pageInfo, entity); - ipLists=page.getList(); - } - - for (int i = 0; i titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - List ipLists=new ArrayList(); - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - ipLists=pxyObjKeyringService.findByCertList(ids); - }else{ - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = pxyObjKeyringService.findTrustedCertPage(pageInfo, entity); - ipLists=page.getList(); - } - for (PxyObjTrustedCaCert cert:ipLists) { - if(!StringUtil.isEmpty(cert.getCompileId())){ - cert.setCrlFile(ConfigDictUtils.getTrustedCrlByCerId(cert.getCompileId())); - } - } - titleList.add(entity.getMenuNameCode()); - classMap.put(entity.getMenuNameCode(), PxyObjTrustedCaCert.class); - String cfgIndexInfoNoExport=",whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:cert_name-"; - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), ipLists); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("pxyObjKeyring export failed",e); - addMessage(redirectAttributes, "error","export_failed"); - } - //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); - } - - - @RequestMapping(value = {"/trustedCertList"}) - public String trustedCertList(Model model,HttpServletRequest request,HttpServletResponse response - ,@ModelAttribute("cfg")PxyObjTrustedCaCert entity - ,RedirectAttributes redirectAttributes){ - Page page = pxyObjKeyringService.findTrustedCertPage(new Page(request, response,"r"), entity); - model.addAttribute("page", page); - initPageCondition(model,entity); - return "/cfg/intercept/strateagy/trustedCertList"; - } - - @RequestMapping(value = {"/trustedCertForm"}) - @RequiresPermissions(value={"proxy:trustedCert:config"}) - public String trustedCertFrom(Model model, - HttpServletRequest request, - HttpServletResponse response, - String ids, - @ModelAttribute("cfg")PxyObjTrustedCaCert cfg - ,RedirectAttributes redirectAttributes){ - if(cfg == null){ - cfg=new PxyObjTrustedCaCert(); - } - if(!StringUtil.isEmpty(ids)){ - cfg = pxyObjKeyringService.getPxyObjTrustedCaCert(Long.valueOf(ids)); - initFormCondition(model, cfg); - model.addAttribute("isAdd", false); - }else{ - initFormCondition(model, cfg); - model.addAttribute("isAdd", true); - } - - model.addAttribute("_cfg", cfg); - return "/cfg/intercept/strateagy/trustedCertForm"; - } - - @RequestMapping(value = {"/trustedCertSaveOrUpdate"}) - @RequiresPermissions(value={"proxy:trustedCert:config"}) - public String trustedCertSaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")PxyObjTrustedCaCert cfg, - MultipartFile certFileI, - RedirectAttributes redirectAttributes){ - File file = null; - boolean validFlag=true; - try { - boolean certFileflag=validCertFileContent(certFileI,"-incert"); - if(!certFileflag){ - addMessage(redirectAttributes,"error","save_failed"); - logger.error(certFileI.getOriginalFilename()+" file non Certificate file format "); - throw new MultiPartNewException(this.getMsgProp().getProperty("certificate_file_error")); - } - } catch (Exception e) { - validFlag=false; - logger.error("证书文件校验失败",e); - if(e instanceof MaatConvertException){ - addMessage(redirectAttributes,"error",e.getMessage()); - }else{ - addMessage(redirectAttributes,"error","save_failed"); - } - } - - try{ - if(validFlag){ - validFlag=true; - if(certFileI != null) { - // 获取公钥信息 - if(certInfoMap != null && certInfoMap.size() >0){ - String issuer=StringUtil.isEmpty(certInfoMap.get("ca issuer")) ? "":certInfoMap.get("ca issuer").toString();//颁发者 - logger.info("issuer:"+issuer); - cfg.setIssuer(issuer); - }else{ - logger.info("无证书信息"); - } - } - } - }catch (Exception e) { - validFlag=false; - logger.error("证书信息获取失败",e); - addMessage(redirectAttributes,"error","save_failed"); - } - try{ - if(validFlag){ - if(certFileI != null) { - String filename = certFileI.getOriginalFilename(); - String prefix = FileUtils.getPrefix(filename, false); - String suffix = FileUtils.getSuffix(filename, false); - file = File.createTempFile("file_"+ prefix, suffix); - certFileI.transferTo(file);//复制文件 - String md5 = FileUtils.getFileMD5(file); - Map srcMap = Maps.newHashMap(); - srcMap.put("filetype", suffix); - srcMap.put("datatype", "dbSystem");//源文件存入数据中心 - srcMap.put("createTime",new Date()); - srcMap.put("key",prefix); - srcMap.put("fileName", filename); - srcMap.put("checksum", md5); - ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); - logger.info("proxy 可信证书 文件上传响应信息:"+JsonMapper.toJsonString(result)); - String certFileAccessUrl = null; - if(!StringUtil.isEmpty(result)){ - ResponseData data = result.getData(); - certFileAccessUrl=data.getAccessUrl(); - cfg.setCertFile(certFileAccessUrl);; - } - } - pxyObjKeyringService.trustedCertsaveOrUpdate(cfg); - addMessage(redirectAttributes,"success","save_success"); - } - - }catch(Exception e){ - logger.error("证书上传失败",e); - if(e instanceof MultiPartNewException) { - addMessage(redirectAttributes,"error",e.getMessage()); - }else if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error","request_service_failed"); - }else { - addMessage(redirectAttributes,"error","save_failed"); - } - } - - return "redirect:" + adminPath +"/proxy/intercept/strateagy/trustedCertList?functionId="+cfg.getFunctionId(); - } - @RequestMapping(value = {"/addOrAuditCrl"}) - /*@RequiresPermissions(value={"proxy:trustedCert:config","proxy:trustedCert:confirm"})*/ - public String trustedCrlSaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")PxyObjTrustedCaCrl cfg, - MultipartFile crlFileI, - RedirectAttributes redirectAttributes){ - File file = null; - boolean validFlag=true; - try { - if( crlFileI != null){ - boolean certFileflag=validCertFileContent(crlFileI,"-incrl"); - if(!certFileflag){ - addMessage(redirectAttributes,"error","save_failed"); - logger.error(crlFileI.getOriginalFilename()+" file non crl file format "); - throw new MultiPartNewException(this.getMsgProp().getProperty("crl_file_error")); - } - } - } catch (Exception e) { - validFlag=false; - logger.error("证书文件校验失败",e); - if(e instanceof MaatConvertException){ - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof MultiPartNewException){ - addMessage(redirectAttributes,"error",e.getMessage()); - }else{ - addMessage(redirectAttributes,"error","save_failed"); - } - } - - try{ - if(validFlag){ - validFlag=true; - if(crlFileI != null) { - // 获取issuer - if(certInfoMap != null && certInfoMap.size() >0){ - String issuer=StringUtil.isEmpty(certInfoMap.get("crl issuer")) ? "":certInfoMap.get("crl issuer").toString();//颁发者 - if(cfg != null){ - if((cfg.getCertId() != null && cfg.getCertId() > 0) && (!cfg.getIssuer().equals(issuer))){ - logger.error("cert 和 crl的issuser不符合"); - throw new MultiPartNewException(this.getMsgProp().getProperty("crl_issuer_error")); - }else{ - cfg.setIssuer(issuer); - } - - } - }else{ - logger.error("crl的issuser为空"); - throw new MultiPartNewException(this.getMsgProp().getProperty("crl_issuer_null")); - } - } - } - }catch (Exception e) { - validFlag=false; - logger.error("crl issuer比对失败",e); - if(e instanceof MultiPartNewException){ - addMessage(redirectAttributes,"error",e.getMessage()); - }else{ - addMessage(redirectAttributes,"error","save_failed"); - } - } - try{ - if(validFlag){ - if(crlFileI != null) { - String filename = crlFileI.getOriginalFilename(); - String prefix = FileUtils.getPrefix(filename, false); - String suffix = FileUtils.getSuffix(filename, false); - file = File.createTempFile("file_"+ prefix, suffix); - crlFileI.transferTo(file);//复制文件 - String md5 = FileUtils.getFileMD5(file); - Map srcMap = Maps.newHashMap(); - srcMap.put("filetype", suffix); - srcMap.put("datatype", "dbSystem");//源文件存入数据中心 - srcMap.put("createTime",new Date()); - srcMap.put("key",prefix); - srcMap.put("fileName", filename); - srcMap.put("checksum", md5); - ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); - logger.info("可信证书crl 文件上传响应信息:"+JsonMapper.toJsonString(result)); - String crlFileAccessUrl = null; - if(!StringUtil.isEmpty(result)){ - ResponseData data = result.getData(); - crlFileAccessUrl=data.getAccessUrl(); - cfg.setCrlFile(crlFileAccessUrl); - } - } - pxyObjKeyringService.trustedCrlsaveOrUpdate(cfg); - - addMessage(redirectAttributes,"success","save_success"); - } - - }catch(Exception e){ - logger.error("crl上传失败",e); - if(e instanceof MaatConvertException){ - addMessage(redirectAttributes,"error","request_service_failed"); - }else if(e instanceof MultiPartNewException){ - addMessage(redirectAttributes,"error",e.getMessage()); - }else{ - addMessage(redirectAttributes,"error","save_failed"); - } - } - - return "redirect:" + adminPath +"/proxy/intercept/strateagy/trustedCertList?functionId="+cfg.getFunctionId(); - } - - /** - * 调用shell脚本 返回运行结果 - * - * @param shellName - * @param params - * @return - */ - public Map execShell(String shellName, - String... params) { - Map result = new HashMap(); - StringBuilder sb = new StringBuilder(); - sb.append(shellName); - for (String temp : params) { - sb.append(" " + temp); - } - String os = System.getProperty("os.name").toLowerCase(); - String cmd1 = ""; - String cmd2 = ""; - if(os.contains("windows")){ - cmd1 = "cmd.exe"; - cmd2 = "/c"; - }else{ - cmd1 = "/bin/sh"; - cmd2 = "-c"; - } - logger.info("调用脚本信息,cmd1:"+cmd1+",cmd2:"+cmd2); - String cmdarray[] = new String[] {cmd1, cmd2 ,sb.toString() }; - BufferedReader br = null; - BufferedReader bre = null; - Process exec=null; - try { - exec = Runtime.getRuntime().exec(cmdarray); - exec.getInputStream(); - br = new BufferedReader( - new InputStreamReader(exec.getInputStream())); - bre = new BufferedReader(new InputStreamReader( - exec.getErrorStream())); - String s = null; - StringBuilder out = new StringBuilder(); - String key=""; - String value=""; - if((sb.toString().indexOf("inlist") > -1) - || ( sb.toString().indexOf("incrl") > -1 ) - || ( sb.toString().indexOf("incert") > -1 )){ - certInfoMap=new HashMap<>(); - } - while ((s = br.readLine()) != null) { - logger.info(s); - //可信证书pem信息收集 - if(sb.toString().indexOf("inlist") > -1){ - if(s.indexOf(":") > -1){ - key=s.substring(0, s.indexOf(":", 0)); - key=StringUtil.isEmpty(key) ?"": key.toLowerCase().trim(); - value=s.substring(s.indexOf(":", 0)+1, s.length()); - value=StringUtil.isEmpty(value) ?"": value.trim(); - certInfoMap.put(key, value); - - } - } - //crl信息收集 - if(sb.toString().indexOf("incrl") > -1){ - if(s.indexOf(":") > -1){ - key=s.substring(0, s.indexOf(":", 0)); - key=StringUtil.isEmpty(key) ?"": key.toLowerCase().trim(); - value=s.substring(s.indexOf(":", 0)+1, s.length()); - value=StringUtil.isEmpty(value) ?"": value.trim(); - certInfoMap.put(key, value); - } - } - //证书信息收集 - if(sb.toString().indexOf("incert") > -1){ - if(s.indexOf(":") > -1){ - key=s.substring(0, s.indexOf(":", 0)); - key=StringUtil.isEmpty(key) ?"": key.toLowerCase().trim(); - value=s.substring(s.indexOf(":", 0)+1, s.length()); - value=StringUtil.isEmpty(value) ?"": value.trim(); - certInfoMap.put(key, value); - } - } - out.append(s); - } - result.put("out", out.toString());//输出参数 - out.setLength(0);//清空 - while ((s = bre.readLine()) != null) { - out.append(s); - } - result.put("error", out.toString());//错误信息 - int waitFor = exec.waitFor(); - logger.info("调用脚本:"+sb.toString()+",执行返回状态值:"+waitFor); - result.put("exitStatus", waitFor);//执行状态 - } catch (Exception e) { - e.printStackTrace(); - logger.error("调用 " + shellName + " 脚本异常", e); - } finally { - if (br != null) - try { - br.close(); - } catch (IOException e) { - e.printStackTrace(); - } - if (bre != null) - try { - bre.close(); - } catch (IOException e) { - e.printStackTrace(); - } - if (exec != null) - exec.destroy(); - - } - return result; - } - - @RequestMapping(value = {"/trustedCertDelete"}) - @RequiresPermissions(value={"proxy:trustedCert:config"}) - public String trustedCertDelete(Integer isAudit,Integer isValid,String ids,Integer functionId - ,Model model,HttpServletRequest request - ,HttpServletResponse response - ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(ids)){ - pxyObjKeyringService.trustedCertDelete(isAudit,isValid,ids,functionId); + // pxyObjKeyring配置导出 + @RequestMapping(value = "exportPxy") + public void exportPxy(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") PxyObjKeyring entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = pxyObjKeyringService.findByList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = pxyObjKeyringService.findPage(pageInfo, entity); + ipLists = page.getList(); } - - return "redirect:" + adminPath +"/proxy/intercept/strateagy/trustedCertList?functionId="+functionId; + + for (int i = 0; i < ipLists.size(); i++) { + ipLists.get(i).setKeyringName(ipLists.get(i).getCfgDesc()); + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), PxyObjKeyring.class); + String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("pxyObjKeyring export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); } - - @RequestMapping(value = {"/trustedCertAudit"}) - @RequiresPermissions(value={"proxy:trustedCert:confirm"}) - public String trustedCertAudit(Model model,@ModelAttribute("cfg")PxyObjTrustedCaCert cfg, - Integer isValid, - Integer isAudit, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes, - HttpServletResponse response, - HttpServletRequest request) { - if(!StringUtil.isEmpty(ids)){ - String[] idArray = ids.split(","); - Date auditTime=new Date(); - for(String id :idArray){ - try { - pxyObjKeyringService.trustedCertAudit(isAudit,isValid,functionId,id,auditTime); - } catch (MaatConvertException e) { - e.printStackTrace(); - logger.error(e); - addMessage(redirectAttributes,"error", "request_service_failed"); - }catch (Exception e) { - e.printStackTrace(); - logger.error(e); - addMessage(redirectAttributes,"error", "audit_failed"); + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + // pxyObjTrustedCert配置导出 + @RequestMapping(value = "exportCert") + public void exportCert(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") PxyObjTrustedCaCert entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = pxyObjKeyringService.findByCertList(ids); + } else { + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = pxyObjKeyringService.findTrustedCertPage(pageInfo, entity); + ipLists = page.getList(); + } + for (PxyObjTrustedCaCert cert : ipLists) { + if (!StringUtil.isEmpty(cert.getCompileId())) { + cert.setCrlFile(ConfigDictUtils.getTrustedCrlByCerId(cert.getCompileId())); + } + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), PxyObjTrustedCaCert.class); + String cfgIndexInfoNoExport = ",whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:cert_name-"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + /* } */ + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("pxyObjKeyring export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + // return "redirect:" + adminPath + // +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + + @RequestMapping(value = { "/trustedCertList" }) + public String trustedCertList(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") PxyObjTrustedCaCert entity, RedirectAttributes redirectAttributes) { + Page page = pxyObjKeyringService + .findTrustedCertPage(new Page(request, response, "r"), entity); + model.addAttribute("page", page); + initPageCondition(model, entity); + return "/cfg/intercept/strateagy/trustedCertList"; + } + + @RequestMapping(value = { "/trustedCertForm" }) + @RequiresPermissions(value = { "proxy:trustedCert:config" }) + public String trustedCertFrom(Model model, HttpServletRequest request, HttpServletResponse response, String ids, + @ModelAttribute("cfg") PxyObjTrustedCaCert cfg, RedirectAttributes redirectAttributes) { + if (cfg == null) { + cfg = new PxyObjTrustedCaCert(); + } + if (!StringUtil.isEmpty(ids)) { + cfg = pxyObjKeyringService.getPxyObjTrustedCaCert(Long.valueOf(ids)); + initFormCondition(model, cfg); + model.addAttribute("isAdd", false); + } else { + initFormCondition(model, cfg); + model.addAttribute("isAdd", true); + } + + model.addAttribute("_cfg", cfg); + return "/cfg/intercept/strateagy/trustedCertForm"; + } + + @RequestMapping(value = { "/trustedCertSaveOrUpdate" }) + @RequiresPermissions(value = { "proxy:trustedCert:config" }) + public String trustedCertSaveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") PxyObjTrustedCaCert cfg, MultipartFile certFileI, + RedirectAttributes redirectAttributes) { + File file = null; + boolean validFlag = true; + try { + boolean certFileflag = validCertFileContent(certFileI, "-incert"); + if (!certFileflag) { + addMessage(redirectAttributes, "error", "save_failed"); + logger.error(certFileI.getOriginalFilename() + " file non Certificate file format "); + throw new MultiPartNewException(this.getMsgProp().getProperty("certificate_file_error")); + } + } catch (Exception e) { + validFlag = false; + logger.error("证书文件校验失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + } + } + + try { + if (validFlag) { + validFlag = true; + if (certFileI != null) { + // 获取公钥信息 + if (certInfoMap != null && certInfoMap.size() > 0) { + String issuer = StringUtil.isEmpty(certInfoMap.get("ca issuer")) ? "" + : certInfoMap.get("ca issuer").toString();// 颁发者 + logger.info("issuer:" + issuer); + cfg.setIssuer(issuer); + } else { + logger.info("无证书信息"); } } - - }else { - Page searchPage=new Page(request,response,"r"); - Page auditPage=new Page(request,response,"r"); + } + } catch (Exception e) { + validFlag = false; + logger.error("证书信息获取失败", e); + addMessage(redirectAttributes, "error", "save_failed"); + } + try { + if (validFlag) { + if (certFileI != null) { + String filename = certFileI.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + file = File.createTempFile("file_" + prefix, suffix); + certFileI.transferTo(file);// 复制文件 + String md5 = FileUtils.getFileMD5(file); + Map srcMap = Maps.newHashMap(); + srcMap.put("filetype", suffix); + srcMap.put("datatype", "dbSystem");// 源文件存入数据中心 + srcMap.put("createTime", new Date()); + srcMap.put("key", prefix); + srcMap.put("fileName", filename); + srcMap.put("checksum", md5); + ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); + logger.info("proxy 可信证书 文件上传响应信息:" + JsonMapper.toJsonString(result)); + String certFileAccessUrl = null; + if (!StringUtil.isEmpty(result)) { + ResponseData data = result.getData(); + certFileAccessUrl = data.getAccessUrl(); + cfg.setCertFile(certFileAccessUrl); + ; + } + } + pxyObjKeyringService.trustedCertsaveOrUpdate(cfg); + addMessage(redirectAttributes, "success", "save_success"); + } + } catch (Exception e) { + logger.error("证书上传失败", e); + if (e instanceof MultiPartNewException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + } + } + + return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + cfg.getFunctionId(); + } + + @RequestMapping(value = { "/addOrAuditCrl" }) + /* + * @RequiresPermissions(value={"proxy:trustedCert:config", + * "proxy:trustedCert:confirm"}) + */ + public String trustedCrlSaveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") PxyObjTrustedCaCrl cfg, MultipartFile crlFileI, + RedirectAttributes redirectAttributes) { + File file = null; + boolean validFlag = true; + try { + if (crlFileI != null) { + boolean certFileflag = validCertFileContent(crlFileI, "-incrl"); + if (!certFileflag) { + addMessage(redirectAttributes, "error", "save_failed"); + logger.error(crlFileI.getOriginalFilename() + " file non crl file format "); + throw new MultiPartNewException(this.getMsgProp().getProperty("crl_file_error")); + } + } + } catch (Exception e) { + validFlag = false; + logger.error("证书文件校验失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof MultiPartNewException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + } + } + + try { + if (validFlag) { + validFlag = true; + if (crlFileI != null) { + // 获取issuer + if (certInfoMap != null && certInfoMap.size() > 0) { + String issuer = StringUtil.isEmpty(certInfoMap.get("crl issuer")) ? "" + : certInfoMap.get("crl issuer").toString();// 颁发者 + if (cfg != null) { + if ((cfg.getCertId() != null && cfg.getCertId() > 0) && (!cfg.getIssuer().equals(issuer))) { + logger.error("cert 和 crl的issuser不符合"); + throw new MultiPartNewException(this.getMsgProp().getProperty("crl_issuer_error")); + } else { + cfg.setIssuer(issuer); + } + + } + } else { + logger.error("crl的issuser为空"); + throw new MultiPartNewException(this.getMsgProp().getProperty("crl_issuer_null")); + } + } + } + } catch (Exception e) { + validFlag = false; + logger.error("crl issuer比对失败", e); + if (e instanceof MultiPartNewException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + } + } + try { + if (validFlag) { + if (crlFileI != null) { + String filename = crlFileI.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + file = File.createTempFile("file_" + prefix, suffix); + crlFileI.transferTo(file);// 复制文件 + String md5 = FileUtils.getFileMD5(file); + Map srcMap = Maps.newHashMap(); + srcMap.put("filetype", suffix); + srcMap.put("datatype", "dbSystem");// 源文件存入数据中心 + srcMap.put("createTime", new Date()); + srcMap.put("key", prefix); + srcMap.put("fileName", filename); + srcMap.put("checksum", md5); + ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); + logger.info("可信证书crl 文件上传响应信息:" + JsonMapper.toJsonString(result)); + String crlFileAccessUrl = null; + if (!StringUtil.isEmpty(result)) { + ResponseData data = result.getData(); + crlFileAccessUrl = data.getAccessUrl(); + cfg.setCrlFile(crlFileAccessUrl); + } + } + pxyObjKeyringService.trustedCrlsaveOrUpdate(cfg); + + addMessage(redirectAttributes, "success", "save_success"); + } + + } catch (Exception e) { + logger.error("crl上传失败", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else if (e instanceof MultiPartNewException) { + addMessage(redirectAttributes, "error", e.getMessage()); + } else { + addMessage(redirectAttributes, "error", "save_failed"); + } + } + + return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + cfg.getFunctionId(); + } + + /** + * 调用shell脚本 返回运行结果 + * + * @param shellName + * @param params + * @return + */ + public Map execShell(String shellName, String... params) { + Map result = new HashMap(); + StringBuilder sb = new StringBuilder(); + sb.append(shellName); + for (String temp : params) { + sb.append(" " + temp); + } + String os = System.getProperty("os.name").toLowerCase(); + String cmd1 = ""; + String cmd2 = ""; + if (os.contains("windows")) { + cmd1 = "cmd.exe"; + cmd2 = "/c"; + } else { + cmd1 = "/bin/sh"; + cmd2 = "-c"; + } + logger.info("调用脚本信息,cmd1:" + cmd1 + ",cmd2:" + cmd2); + String cmdarray[] = new String[] { cmd1, cmd2, sb.toString() }; + BufferedReader br = null; + BufferedReader bre = null; + Process exec = null; + try { + exec = Runtime.getRuntime().exec(cmdarray); + exec.getInputStream(); + br = new BufferedReader(new InputStreamReader(exec.getInputStream())); + bre = new BufferedReader(new InputStreamReader(exec.getErrorStream())); + String s = null; + StringBuilder out = new StringBuilder(); + String key = ""; + String value = ""; + if ((sb.toString().indexOf("inlist") > -1) || (sb.toString().indexOf("incrl") > -1) + || (sb.toString().indexOf("incert") > -1)) { + certInfoMap = new HashMap<>(); + } + while ((s = br.readLine()) != null) { + logger.info(s); + // 可信证书pem信息收集 + if (sb.toString().indexOf("inlist") > -1) { + if (s.indexOf(":") > -1) { + key = s.substring(0, s.indexOf(":", 0)); + key = StringUtil.isEmpty(key) ? "" : key.toLowerCase().trim(); + value = s.substring(s.indexOf(":", 0) + 1, s.length()); + value = StringUtil.isEmpty(value) ? "" : value.trim(); + certInfoMap.put(key, value); + + } + } + // crl信息收集 + if (sb.toString().indexOf("incrl") > -1) { + if (s.indexOf(":") > -1) { + key = s.substring(0, s.indexOf(":", 0)); + key = StringUtil.isEmpty(key) ? "" : key.toLowerCase().trim(); + value = s.substring(s.indexOf(":", 0) + 1, s.length()); + value = StringUtil.isEmpty(value) ? "" : value.trim(); + certInfoMap.put(key, value); + } + } + // 证书信息收集 + if (sb.toString().indexOf("incert") > -1) { + if (s.indexOf(":") > -1) { + key = s.substring(0, s.indexOf(":", 0)); + key = StringUtil.isEmpty(key) ? "" : key.toLowerCase().trim(); + value = s.substring(s.indexOf(":", 0) + 1, s.length()); + value = StringUtil.isEmpty(value) ? "" : value.trim(); + certInfoMap.put(key, value); + } + } + out.append(s); + } + result.put("out", out.toString());// 输出参数 + out.setLength(0);// 清空 + while ((s = bre.readLine()) != null) { + out.append(s); + } + result.put("error", out.toString());// 错误信息 + int waitFor = exec.waitFor(); + logger.info("调用脚本:" + sb.toString() + ",执行返回状态值:" + waitFor); + result.put("exitStatus", waitFor);// 执行状态 + } catch (Exception e) { + e.printStackTrace(); + logger.error("调用 " + shellName + " 脚本异常", e); + } finally { + if (br != null) try { - BeanUtils.copyProperties(searchPage, auditPage); - auditAll(auditPage,isValid , cfg); - addMessage(redirectAttributes,"success", "audit_success"); - } catch (Exception e) { - logger.error("配置下发失败:",e); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error", "request_service_failed"); - }else { - addMessage(redirectAttributes,"error", "audit_failed"); - } - + br.close(); + } catch (IOException e) { + e.printStackTrace(); } - - return trustedCertList(model, request, response, cfg, redirectAttributes); - } - return "redirect:" + adminPath +"/proxy/intercept/strateagy/trustedCertList?functionId="+functionId; + if (bre != null) + try { + bre.close(); + } catch (IOException e) { + e.printStackTrace(); + } + if (exec != null) + exec.destroy(); + } + return result; + } + + @RequestMapping(value = { "/trustedCertDelete" }) + @RequiresPermissions(value = { "proxy:trustedCert:config" }) + public String trustedCertDelete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + if (!StringUtil.isEmpty(ids)) { + pxyObjKeyringService.trustedCertDelete(isAudit, isValid, ids, functionId); + } + + return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + functionId; + } + + @RequestMapping(value = { "/trustedCertAudit" }) + @RequiresPermissions(value = { "proxy:trustedCert:confirm" }) + public String trustedCertAudit(Model model, @ModelAttribute("cfg") PxyObjTrustedCaCert cfg, Integer isValid, + Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes, + HttpServletResponse response, HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { + String[] idArray = ids.split(","); + Date auditTime = new Date(); + for (String id : idArray) { + try { + pxyObjKeyringService.trustedCertAudit(isAudit, isValid, functionId, id, auditTime); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.error(e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + e.printStackTrace(); + logger.error(e); + addMessage(redirectAttributes, "error", "audit_failed"); + } + } + + } else { + Page searchPage = new Page(request, response, "r"); + Page auditPage = new Page(request, response, "r"); + + try { + BeanUtils.copyProperties(searchPage, auditPage); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); + } + + } + + return trustedCertList(model, request, response, cfg, redirectAttributes); + } + return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + functionId; + } } diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp index 5cd9f029d..e2dd6506e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp @@ -151,8 +151,20 @@ - +<%-- --%> + +
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ <%-- --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp index 3d4ce186c..bc3d40922 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp @@ -205,8 +205,20 @@ - +<%-- --%> + +
+ + +
+ <%-- --%>
@@ -361,23 +373,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp index dddab3933..a68b65736 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp @@ -218,8 +218,20 @@ - +<%-- --%> + +
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
- +<%-- --%> + +
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
-
${page}
-
- - [:${configStatisticTime }] - +
+ + + [:${configStatisticTime }] + + +
+
+ + +
+
- +
@@ -221,6 +329,7 @@ +
diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index 309f35684..07fb2d01f 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -484,7 +484,10 @@ white-space:nowrap; <%-- --%> -
+ <%-- --%> +
+
+
- - <%-- --%> -
-
href="javascript:;"> diff --git a/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js b/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js index 3611a38e0..5e2745189 100644 --- a/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js +++ b/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js @@ -237,7 +237,7 @@ var $cols = $(val).find('th, td'); return $cols.map(function (i, val) { // 当文字过长有省略时取title导出 - var titleText=$(val).text(); + var titleText=$(val).text().trim(); if($(val).attr("title")!=null&&$(val).attr("title")!=""){ titleText=$(val).attr("title"); } From 9d8786dd2eb817bc2f035e7d4c4b9011d7c6f33e Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Sun, 23 Dec 2018 20:58:42 +0800 Subject: [PATCH 043/147] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B4=BB=E8=B7=83=E7=AB=AF=E5=8F=A3=E8=AF=A6?= =?UTF-8?q?=E6=83=85=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E6=9B=BF=E7=87=95=E5=A7=90=E6=8F=90=E4=BA=A4=E3=80=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=95=8C=E9=9D=A2=E7=BA=BF=E6=95=B0=E6=8D=AE=E7=82=B9?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/Constants.java | 1 + .../dashboard/DashboardController.java | 95 +- src/main/resources/nis.properties | 239 ++--- .../views/dashboard/dashBoardIndex.jsp | 21 +- .../views/dashboard/dashBoardIndex.jsp_new | 935 ------------------ .../dashboard/trafficActionTransList.jsp | 23 +- .../views/dashboard/trafficDomainTrans.jsp | 13 +- .../views/dashboard/trafficIpActiveList.jsp | 12 + .../views/dashboard/trafficPortActiveList.jsp | 288 ++++++ .../views/dashboard/trafficWebTypeList.jsp | 4 +- 10 files changed, 519 insertions(+), 1112 deletions(-) delete mode 100644 src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp_new create mode 100644 src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 79c7af97b..cc17b59ee 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -714,6 +714,7 @@ public final class Constants { public static final String TRAFFIC_WEBSITELIST_NOTIME=Configurations.getStringProperty("trafficWebsiteListNoTime","trafficWebsiteListNoTime"); public static final String TRAFFIC_TOPICLIST=Configurations.getStringProperty("trafficTopicList","trafficTopicList"); public static final String TRAFFIC_DOMAIN_TRANS=Configurations.getStringProperty("trafficDomainTrans","trafficDomainTrans"); + public static final String TRAFFIC_PORTACTIVE_FIVEMINUTE=Configurations.getStringProperty("trafficPortActiveFiveMinute","trafficPortActiveFiveMinute"); /** * httpclient 工具超时时间设置 */ diff --git a/src/main/java/com/nis/web/controller/dashboard/DashboardController.java b/src/main/java/com/nis/web/controller/dashboard/DashboardController.java index 5332038df..a85f0886a 100644 --- a/src/main/java/com/nis/web/controller/dashboard/DashboardController.java +++ b/src/main/java/com/nis/web/controller/dashboard/DashboardController.java @@ -96,6 +96,33 @@ public class DashboardController extends BaseController{ } return list; } + /** + * 跳转活跃端口详情界面 + * @return + */ + @RequestMapping(value="portActiveChart") + @ResponseBody + public List portActiveChart(String beginDate,String endDate){ + Map fromJsonList = new HashMap(); + List list = new ArrayList(); + try { + String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_PORTACTIVE_FIVEMINUTE;//+Constants.TRAFFIC_IPACTIVE_ONEHOUR; + url=urlAddDate(url, beginDate, endDate); + String string = HttpClientUtil.get(url); + Gson gson = new GsonBuilder().create(); + fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); + logger.debug("活跃端口从"+beginDate+"到"+endDate+",间隔5分钟数据"+fromJsonList); + list = (ArrayList) fromJsonList.get("data"); + return list; + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + logger.error("活跃端口详情界面数据获取错误"+e); + } + return list; + } + /** * 跳转活跃端口详情界面 * @return @@ -319,19 +346,19 @@ public class DashboardController extends BaseController{ //将数字替换为标签文字 if(list!=null&&!list.isEmpty()){ for (Map map : list) { - Double value1 = Double.parseDouble(map.get("protoType").toString()); + Double value1 = Double.parseDouble(map.get("protoType").toString().trim()); for (CodeResult code : codeList) { - Double value2 = Double.valueOf(code.getCode()); + Double value2 = Double.valueOf(code.getCode().trim()); if(value1.equals(value2)){ - map.put("protoType", code.getItem()); + map.put("protoType", code.getItem().trim()); break; } } // 协议没匹配的匹配app码表 for (CodeResult code : appCodeList) { - Double value3 = Double.valueOf(code.getCode()); + Double value3 = Double.valueOf(code.getCode().trim()); if(value1.equals(value3)){ - map.put("protoType", code.getItem()); + map.put("protoType", code.getItem().trim()); break; } } @@ -366,11 +393,11 @@ public class DashboardController extends BaseController{ //将数字替换为标签文字 if(list!=null&&!list.isEmpty()){ for (Map map : list) { - Double value1 = Double.parseDouble(map.get("appType").toString()); + Double value1 = Double.parseDouble(map.get("appType").toString().trim()); for (CodeResult code : codeList) { - Double value2 = Double.valueOf(code.getCode()); + Double value2 = Double.valueOf(code.getCode().trim()); if(value1.equals(value2)){ - map.put("appType", code.getItem()); + map.put("appType", code.getItem().trim()); break; } } @@ -405,11 +432,11 @@ public class DashboardController extends BaseController{ //将数字替换为标签文字 if(list!=null&&!list.isEmpty()){ for (Map map : list) { - Double value1 = Double.parseDouble(map.get("osType").toString()); + Double value1 = Double.parseDouble(map.get("osType").toString().trim()); for (CodeResult code : codeList) { - Double value2 = Double.valueOf(code.getCode()); + Double value2 = Double.valueOf(code.getCode().trim()); if(value1.equals(value2)){ - map.put("osType", code.getItem()); + map.put("osType", code.getItem().trim()); break; } } @@ -439,8 +466,8 @@ public class DashboardController extends BaseController{ //将标签文字转为数字 Integer os=null; for (CodeResult codeResult : codeList1) { - if(osType.equalsIgnoreCase(codeResult.getItem())){ - os=Integer.parseInt(codeResult.getCode()); + if(osType.equalsIgnoreCase(codeResult.getItem().trim())){ + os=Integer.parseInt(codeResult.getCode().trim()); break; } } @@ -457,11 +484,11 @@ public class DashboardController extends BaseController{ //将数字替换为标签文字 if(null!=list&&!list.isEmpty()){ for (Map map : list) { - Double value1 = Double.parseDouble(map.get("bsType").toString()); + Double value1 = Double.parseDouble(map.get("bsType").toString().trim()); for (CodeResult code : codeList2) { - Double value2 = Double.valueOf(code.getCode()); + Double value2 = Double.valueOf(code.getCode().trim()); if(value1.equals(value2)){ - map.put("bsType", code.getItem()); + map.put("bsType", code.getItem().trim()); break; } //10个域名之外的为others 设为-1外 @@ -501,11 +528,11 @@ public class DashboardController extends BaseController{ //将数字替换为标签文字 if(list!=null&&!list.isEmpty()){ for (Map map : list) { - Double value1 = Double.parseDouble(map.get("bsType").toString()); + Double value1 = Double.parseDouble(map.get("bsType").toString().trim()); for (CodeResult code : codeList) { - Double value2 = Double.valueOf(code.getCode()); + Double value2 = Double.valueOf(code.getCode().trim()); if(value1.equals(value2)){ - map.put("bsType", code.getItem()); + map.put("bsType", code.getItem().trim()); break; } } @@ -535,13 +562,13 @@ public class DashboardController extends BaseController{ //将标签文字转为数字 Integer bs=null; for (CodeResult codeResult : codeList1) { - if(bsType.equalsIgnoreCase(codeResult.getItem())){ - bs=Integer.parseInt(codeResult.getCode()); + if(bsType.equalsIgnoreCase(codeResult.getItem().trim())){ + bs=Integer.parseInt(codeResult.getCode().trim()); break; } } if(bs==null){ - bs=Integer.parseInt(bsType);//处理为匹配项编码 + bs=Integer.parseInt(bsType.trim());//处理为匹配项编码 } try { String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_SYSTEM_CHART+"?bsType="+bs); @@ -553,16 +580,16 @@ public class DashboardController extends BaseController{ //将数字替换为标签文字 if(null!=list&&!list.isEmpty()){ for (Map map : list) { - Double value1 = Double.parseDouble(map.get("osType").toString()); + Double value1 = Double.parseDouble(map.get("osType").toString().trim()); for (CodeResult code : codeList2) { - Double value2 = Double.valueOf(code.getCode()); + Double value2 = Double.valueOf(code.getCode().trim()); //10个域名之外的为others webId设为-1外 if(map.get("osType").toString().equals("-1")){ map.put("osType", "Others"); break; } if(value1.equals(value2)){ - map.put("osType", code.getItem()); + map.put("osType", code.getItem().trim()); break; } } @@ -599,15 +626,15 @@ public class DashboardController extends BaseController{ if(list!=null&&!list.isEmpty()){ for (Map map : list) { Double value1=0d; - if(StringUtil.isBlank(map.get("websiteServiceId").toString())){ + if(StringUtil.isBlank(map.get("websiteServiceId").toString().trim())){ value1=268435455d; }else{ - value1 = Double.parseDouble(map.get("websiteServiceId").toString()); + value1 = Double.parseDouble(map.get("websiteServiceId").toString().trim()); } for (SysDataDictionaryItem code : codeList) { - Double value2 = Double.valueOf(code.getItemCode()); + Double value2 = Double.valueOf(code.getItemCode().trim()); if(value1.equals(value2)){ - map.put("websiteService", code.getItemValue()); + map.put("websiteService", code.getItemValue().trim()); break; } } @@ -647,7 +674,7 @@ public class DashboardController extends BaseController{ if(wdt!=null){ String domain = wdt.getDomain(); Double domainId = wdt.getId().doubleValue(); - Double webId = Double.parseDouble(dataMap.get("webId").toString()); + Double webId = Double.parseDouble(dataMap.get("webId").toString().trim()); //10个域名之外的为others webId设为-1外 if(dataMap.get("webId").toString().equals("-1")){ dataMap.put("domain", "Others"); @@ -697,12 +724,12 @@ public class DashboardController extends BaseController{ if(StringUtil.isBlank(map.get("topicId").toString())){ value1=268435455d; }else{ - value1 = Double.parseDouble(map.get("topicId").toString()); + value1 = Double.parseDouble(map.get("topicId").toString().trim()); } for (SysDataDictionaryItem code : codeList) { - Double value2 = Double.valueOf(code.getItemCode()); + Double value2 = Double.valueOf(code.getItemCode().trim()); if(value1.equals(value2)){ - map.put("topic", code.getItemValue()); + map.put("topic", code.getItemValue().trim()); break; } } @@ -714,7 +741,7 @@ public class DashboardController extends BaseController{ if(wdt!=null){ String domain = wdt.getDomain(); Double domainId = wdt.getId().doubleValue(); - Double webId = Double.parseDouble(dataMap.get("webId").toString()); + Double webId = Double.parseDouble(dataMap.get("webId").toString().trim()); //10个域名之外的为others webId设为-1 // if(dataMap.get("webId").toString().equals("-1")){ // dataMap.put("domain", "Others"); diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 18c4b640b..dd9089f22 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -1,49 +1,49 @@ -#\u7ba1\u7406\u57fa\u7840\u8def\u5f84, \u9700\u540c\u6b65\u4fee\u6539\uff1aweb.xml +#\u7BA1\u7406\u57FA\u7840\u8DEF\u5F84, \u9700\u540C\u6B65\u4FEE\u6539\uFF1Aweb.xml adminPath=/nis -#Restful\u670d\u52a1\u9ed8\u8ba4\u8def\u5f84\ufffd +#Restful\u670D\u52A1\u9ED8\u8BA4\u8DEF\u5F84\uFFFD servicePath=/service -#\u5206\u9875\u914d\u7f6e +#\u5206\u9875\u914D\u7F6E page.pageSize=20 -#\u5206\u9875\u914d\u7f6e +#\u5206\u9875\u914D\u7F6E page.count=0 -#\u7d22\u5f15\u9875\u8def\u5f84 +#\u7D22\u5F15\u9875\u8DEF\u5F84 web.view.index=/nis/index -#\u7f13\u5b58\u8bbe\u7f6e +#\u7F13\u5B58\u8BBE\u7F6E ehcache.configFile=cache/ehcache-local.xml #ehcache.configFile=cache/ehcache-rmi.xml -#\u4f1a\u8bdd\u8d85\u65f6\uff0c \u5355\u4f4d\uff1a\u6beb\u79d2\uff0c 20m=1200000ms, 30m=1800000ms, 60m=3600000ms +#\u4F1A\u8BDD\u8D85\u65F6\uFF0C \u5355\u4F4D\uFF1A\u6BEB\u79D2\uFF0C 20m=1200000ms, 30m=1800000ms, 60m=3600000ms session.sessionTimeout=1800000 -#\u4f1a\u8bdd\u6e05\u7406\u95f4\u9694\u65f6\u95f4\uff0c \u5355\u4f4d\uff1a\u6beb\u79d2\uff0c2m=120000ms\u3002 +#\u4F1A\u8BDD\u6E05\u7406\u95F4\u9694\u65F6\u95F4\uFF0C \u5355\u4F4D\uFF1A\u6BEB\u79D2\uFF0C2m=120000ms\u3002 session.sessionTimeoutClean=120000 -#\u9759\u6001\u6587\u4ef6\u540e\u7f00 +#\u9759\u6001\u6587\u4EF6\u540E\u7F00 web.staticFile=.css,.js,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.htm,.html,.crx,.xpi,.exe,.ipa,.apk -#\u7f51\u7ad9URL\u540e\u7f00 +#\u7F51\u7AD9URL\u540E\u7F00 urlSuffix=.jsp -#\u89c6\u56fe\u6587\u4ef6\u5b58\u653e\u8def\u5f84 +#\u89C6\u56FE\u6587\u4EF6\u5B58\u653E\u8DEF\u5F84 web.view.prefix=/WEB-INF/views/ web.view.suffix=.jsp -#\u662f\u5426\u4e0d\u5141\u8bb8\u5237\u65b0\u4e3b\u9875\uff0c\u4e0d\u5141\u8bb8\u60c5\u51b5\u4e0b\uff0c\u5237\u65b0\u4e3b\u9875\u4f1a\u5bfc\u81f4\u91cd\u65b0\u767b\u5f55 +#\u662F\u5426\u4E0D\u5141\u8BB8\u5237\u65B0\u4E3B\u9875\uFF0C\u4E0D\u5141\u8BB8\u60C5\u51B5\u4E0B\uFF0C\u5237\u65B0\u4E3B\u9875\u4F1A\u5BFC\u81F4\u91CD\u65B0\u767B\u5F55 notAllowRefreshIndex=false -#\u524d\u7aef\u57fa\u7840\u8def\u5f84 +#\u524D\u7AEF\u57FA\u7840\u8DEF\u5F84 frontPath=/f -#\u662f\u5426\u8fd0\u884c\u591a\u8d26\u6237\u540c\u65f6\u767b\u5f55? +#\u662F\u5426\u8FD0\u884C\u591A\u8D26\u6237\u540C\u65F6\u767B\u5F55? user.multiAccountLogin=true -#\u7855\u6b63\u7ec4\u4ef6\u662f\u5426\u4f7f\u7528\u7f13\u5b58 +#\u7855\u6B63\u7EC4\u4EF6\u662F\u5426\u4F7F\u7528\u7F13\u5B58 supcan.useCache=false -#\u901a\u77e5\u95f4\u9694\u65f6\u95f4\u8bbe\u7f6e, \u5355\u4f4d\uff1a\u6beb\u79d2, 30s=30000ms, 60s=60000ms +#\u901A\u77E5\u95F4\u9694\u65F6\u95F4\u8BBE\u7F6E, \u5355\u4F4D\uFF1A\u6BEB\u79D2, 30s=30000ms, 60s=60000ms work.notify.remind.interval=60000 @@ -51,13 +51,13 @@ work.notify.remind.interval=60000 #===== System settings ======# #============================# -#\u4ea7\u54c1\u4fe1\u606f\u8bbe\u7f6e +#\u4EA7\u54C1\u4FE1\u606F\u8BBE\u7F6E productName=National Traffic Control System copyrightYear=2015 version=V1.0.0 -#\u4e0a\u4f20\u6587\u4ef6\u7edd\u5bf9\u8def\u5f84, \u8def\u5f84\u4e2d\u4e0d\u5141\u8bb8\u5305\u542b\u201cuserfiles\u201d +#\u4E0A\u4F20\u6587\u4EF6\u7EDD\u5BF9\u8DEF\u5F84, \u8DEF\u5F84\u4E2D\u4E0D\u5141\u8BB8\u5305\u542B\u201Cuserfiles\u201D userfiles.basedir=upload @@ -65,7 +65,7 @@ userfiles.basedir=upload #===== webservice settings ======# #============================# -#ESB\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u1e69\ufffd\ufffd\u0373\u04bb\ufffd\ufffd\u05b7 +#ESB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u1E69\uFFFD\uFFFD\u0373\u04BB\uFFFD\uFFFD\u05B7 webservice.esb.endpoint=http://10.55.0.197:7879/TongServiceProxy_doprocess/services/WebService1/ #webservice RID webservice.rid=XFBL @@ -88,47 +88,47 @@ webservice.data.dict.code.sid=s_2042_0660BD17-35E4-4482-AA3A-556F2C024902 #webservice request timeout for seconds webservice.request.timeout=30 -#\ufffd\ufffd\ufffd\ufffd\ufffdURL +#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDURL webservice.jg.service.url=http://10.55.0.155:8080/jgService -#\ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffdURL +#\uFFFD\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDURL webservice.yh.service.url=http://10.55.0.155:8080/ryService -#\ufffd\ufffd\ufffd\ufffd\u05b5\ufffdURL +#\uFFFD\uFFFD\uFFFD\uFFFD\u05B5\uFFFDURL webservice.data.dict.service.url=http://10.55.0.155:8080/sjzdService -#\ufffd\ufffd\ufffd\ufffd\u05b5\ufffd\ufffd\ufffd\ufffdURL +#\uFFFD\uFFFD\uFFFD\uFFFD\u05B5\uFFFD\uFFFD\uFFFD\uFFFDURL webservice.data.dict.bm.url=http://10.55.0.155:8080/sjzdbmService -#\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdURL +#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDURL webservice.data.code.url=http://10.55.0.155:8080/sjmbService -#webservice\ufffd\u04ff\ufffd\ufffd\ufffd\ufffd\u00ff\u04b3\ufffd\ufffd\ufffd\ufffd +#webservice\uFFFD\u04FF\uFFFD\uFFFD\uFFFD\uFFFD\u00FF\u04B3\uFFFD\uFFFD\uFFFD\uFFFD webservice.data.pagesize = 2000 -#webservice\ufffd\ufffd\u01f0\u012c\ufffd\ufffd\u04b3 +#webservice\uFFFD\uFFFD\u01F0\u012C\uFFFD\uFFFD\u04B3 webservice.data.currentpage = 1 -#webservice \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd +#webservice \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD webservice.jgmb.name=CK_T_JC_RY -#webservice \ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd +#webservice \uFFFD\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD webservice.yhmb.name=CK_T_YH_RY -#webservice\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \u022b\ufffd\ufffd +#webservice\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD \u022B\uFFFD\uFFFD webservice.method.name.ql=getData -# webservice\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd +# webservice\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD \uFFFD\uFFFD\uFFFD\uFFFD webservice.method.name.zl=getDataZL -# redis\u914d\u7f6e\u6587\u4ef6 -#redis \u5404\u4e2a\u5206\u7247\u7684 IP\u7aef\u53e3 +# redis\u914D\u7F6E\u6587\u4EF6 +#redis \u5404\u4E2A\u5206\u7247\u7684 IP\u7AEF\u53E3 redis.cluster.host_port=10.0.6.32:6379,10.0.6.32:6380,10.0.6.32:6381,10.0.6.33:6379,10.0.6.33:6380,10.0.6.33:6381 -#\u4e2d\u5fc3\u73b0\u573aredis\u5730\u5740\u548c\u7aef\u53e3 +#\u4E2D\u5FC3\u73B0\u573Aredis\u5730\u5740\u548C\u7AEF\u53E3 #redis.cluster.host_port=10.174.196.33:6379,10.174.196.33:6380,10.174.196.33:6381,10.174.196.34:6379,10.174.196.34:6380,10.174.196.34:6381,10.174.196.35:6379,10.174.196.35:6380,10.174.196.35:6381,10.174.196.36:6379,10.174.196.36:6380,10.174.196.36:6381,10.174.196.37:6379,10.174.196.37:6380,10.174.196.37:6381,10.174.196.38:6379,10.174.196.38:6380,10.174.196.38:6381,10.174.196.39:6379,10.174.196.39:6380,10.174.196.39:6381 redis.cluster.connectiontimeout=5000 redis.cluster.sotimeout=5000 redis.cluster.maxattempts=3 -#redis\u8fde\u63a5\u6c60\u76f8\u5173\u914d\u7f6e +#redis\u8FDE\u63A5\u6C60\u76F8\u5173\u914D\u7F6E redis.pool.maxtotal=500 @@ -141,31 +141,31 @@ redis.pool.testonreturn=false redis.pool.testwhileidle=true redis.pool.timebetweenevictionrunsmillis=60000 redis.pool.minevictableidletimemillis=60000 -#oracle\u6570\u636eredis\u5b58\u50a8\u65f6\u95f4(\u79d2\u4e3a\u5355\u4f4d \u9ed8\u8ba43\u5206\u949f\u5373180s) +#oracle\u6570\u636Eredis\u5B58\u50A8\u65F6\u95F4(\u79D2\u4E3A\u5355\u4F4D \u9ED8\u8BA43\u5206\u949F\u5373180s) oracleExpire=180 -#hive\u6570\u636e\u4e2d\u5fc3\u6570\u636eredis\u5b58\u50a8\u65f6\u95f4(\u79d2\u4e3a\u5355\u4f4d \u9ed8\u8ba420\u5206\u949f\u53731200s) +#hive\u6570\u636E\u4E2D\u5FC3\u6570\u636Eredis\u5B58\u50A8\u65F6\u95F4(\u79D2\u4E3A\u5355\u4F4D \u9ED8\u8BA420\u5206\u949F\u53731200s) hiveExpire=300 -#redis\u5f00\u5173 +#redis\u5F00\u5173 isOpenRedis=false -#\u662f\u5426\u5c06\u6570\u636e\u4e2d\u5fc3\u7684\u65e5\u5fd7\u52a0\u5165\u5230redis\u4e2d +#\u662F\u5426\u5C06\u6570\u636E\u4E2D\u5FC3\u7684\u65E5\u5FD7\u52A0\u5165\u5230redis\u4E2D dataCenterOpenRedis=true -#\u8de8\u57df\u95ee\u9898\u5141\u8bb8 \u7684url Access-Control-Allow-Origin *\u5141\u8bb8\u6240\u6709\uff0c\u8bbe\u7f6e\u6210\u5176\u4ed6url\u53ea\u5141\u8bb8\u8be5url.\u4e0d\u80fd\u8bbe\u7f6e\u591a\u4e2aurl +#\u8DE8\u57DF\u95EE\u9898\u5141\u8BB8 \u7684url Access-Control-Allow-Origin *\u5141\u8BB8\u6240\u6709\uFF0C\u8BBE\u7F6E\u6210\u5176\u4ED6url\u53EA\u5141\u8BB8\u8BE5url.\u4E0D\u80FD\u8BBE\u7F6E\u591A\u4E2Aurl target_url=* -#\u8de8\u57df\u95ee\u9898 3600\uff1a\u8868\u660e\u57283600\u79d2\u5185\uff0c\u4e0d\u9700\u8981\u518d\u53d1\u9001\u9884\u8bf7\u6c42\uff0c\u53ef\u4ee5\u7f13\u5b58\u8be5\u7ed3\u679c +#\u8DE8\u57DF\u95EE\u9898 3600\uFF1A\u8868\u660E\u57283600\u79D2\u5185\uFF0C\u4E0D\u9700\u8981\u518D\u53D1\u9001\u9884\u8BF7\u6C42\uFF0C\u53EF\u4EE5\u7F13\u5B58\u8BE5\u7ED3\u679C ACCESS_CONTROL_MAX_AGE=3600 ##########HTTPCLIENT POOL START################### -#\u4ece\u8fde\u63a5\u6c60\u4e2d\u83b7\u53d6\u5230\u8fde\u63a5\u7684\u6700\u957f\u65f6\u95f4 +#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u5230\u8FDE\u63A5\u7684\u6700\u957F\u65F6\u95F4 http.request.connectionRequestTimeout=500 #5000 http.request.connectTimeout=5000 -#\u6570\u636e\u4f20\u8f93\u7684\u6700\u957f\u65f6\u95f4 +#\u6570\u636E\u4F20\u8F93\u7684\u6700\u957F\u65F6\u95F4 http.request.socketTimeout=30000 -#\u63d0\u4ea4\u8bf7\u6c42\u524d\u6d4b\u8bd5\u8fde\u63a5\u662f\u5426\u53ef\u7528 +#\u63D0\u4EA4\u8BF7\u6C42\u524D\u6D4B\u8BD5\u8FDE\u63A5\u662F\u5426\u53EF\u7528 http.request.staleConnectionCheckEnabled=true -#\u8bbe\u7f6e\u8fde\u63a5\u603b\u6570 +#\u8BBE\u7F6E\u8FDE\u63A5\u603B\u6570 http.pool.maxTotal=200 -#\u8bbe\u7f6e\u6bcf\u4e2a\u5730\u5740\u7684\u5e76\u53d1\u6570 +#\u8BBE\u7F6E\u6BCF\u4E2A\u5730\u5740\u7684\u5E76\u53D1\u6570 http.pool.defaultMaxPerRoute=100 ##########HTTPCLIENT POOL END################### search.dateformat=yyyy-MM-dd HH:mm:ss @@ -176,45 +176,45 @@ search.eshostandport_C=10.0.6.115:9200 #search.eshostandport=10.174.196.135:9200 -#\u65e5\u5fd7\u662f\u5426\u4ecehive\u4e2d\u67e5\u8be2 +#\u65E5\u5FD7\u662F\u5426\u4ECEhive\u4E2D\u67E5\u8BE2 selFromHive=false -#\u662f\u5426\u83b7\u53d6\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2\u8bb0\u5f55\u7684\u603b\u6761\u6570 +#\u662F\u5426\u83B7\u53D6\u6570\u636E\u4E2D\u5FC3\u67E5\u8BE2\u8BB0\u5F55\u7684\u603B\u6761\u6570 isGetHiveCount=false -#\u6bcf\u6b21\u83b7\u53d6\u6570\u636e\u4e2d\u5fc3\u591a\u5c11\u6761\u6570\u636e,\u54b1\u4eec\u5728\u5bf9\u83b7\u53d6\u7684\u6570\u636e\u8fdb\u884c\u5206\u9875\u5904\u7406 +#\u6BCF\u6B21\u83B7\u53D6\u6570\u636E\u4E2D\u5FC3\u591A\u5C11\u6761\u6570\u636E,\u54B1\u4EEC\u5728\u5BF9\u83B7\u53D6\u7684\u6570\u636E\u8FDB\u884C\u5206\u9875\u5904\u7406 everyGetHiveDataNum=10000 -#oracle\u6570\u636e\u5e93\u6709\u95ee\u9898\u4e0d\u4eceoracle\u67e5\u8be2\u6570\u636e,\u6240\u6709\u65e5\u5fd7\u6570\u636e\u5747\u4ece\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2 +#oracle\u6570\u636E\u5E93\u6709\u95EE\u9898\u4E0D\u4ECEoracle\u67E5\u8BE2\u6570\u636E,\u6240\u6709\u65E5\u5FD7\u6570\u636E\u5747\u4ECE\u6570\u636E\u4E2D\u5FC3\u67E5\u8BE2 onlySelFromHive=false -#\u662f\u5426\u67e5\u8be2\u795e\u901a\u6570\u636e\u5e93 +#\u662F\u5426\u67E5\u8BE2\u795E\u901A\u6570\u636E\u5E93 isSelectCluster=true -#\u7528\u6237\u67e5\u8be2\u65e5\u5fd7\u8d85\u8fc7\u591a\u5c11\u5c0f\u65f6\u53bb\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2 +#\u7528\u6237\u67E5\u8BE2\u65E5\u5FD7\u8D85\u8FC7\u591A\u5C11\u5C0F\u65F6\u53BB\u6570\u636E\u4E2D\u5FC3\u67E5\u8BE2 dataCenterTime=48 -#\u662f\u5426\u5f00\u542f\u57fa\u7840\u9a8c\u8bc1 +#\u662F\u5426\u5F00\u542F\u57FA\u7840\u9A8C\u8BC1 baseValidate=true -#\u662f\u5426\u5f00\u542f\u4e1a\u52a1\u9a8c\u8bc1 +#\u662F\u5426\u5F00\u542F\u4E1A\u52A1\u9A8C\u8BC1 serviceValidate=true -#\u65e5\u5fd7\u5b58\u50a8\u672c\u5730\u65f6\u95f4(\u5355\u4f4d\u5c0f\u65f6) +#\u65E5\u5FD7\u5B58\u50A8\u672C\u5730\u65F6\u95F4(\u5355\u4F4D\u5C0F\u65F6) logLocalTime=48 -#\u5b9e\u65f6\u7edf\u8ba1\u9ed8\u8ba4\u67e5\u8be2\u672c\u5730\u4e00\u4e2a\u5c0f\u65f6\u7684\u6570\u636e(\u5355\u4f4d\uff1a\u5c0f\u65f6) +#\u5B9E\u65F6\u7EDF\u8BA1\u9ED8\u8BA4\u67E5\u8BE2\u672C\u5730\u4E00\u4E2A\u5C0F\u65F6\u7684\u6570\u636E(\u5355\u4F4D\uFF1A\u5C0F\u65F6) reportLocalTime=1 -#\u795e\u901a\u6570\u636e\u5e93\u6700\u65e9\u65e5\u5fd7\u65f6\u95f4(A\u7248\u6beb\u79d2) +#\u795E\u901A\u6570\u636E\u5E93\u6700\u65E9\u65E5\u5FD7\u65F6\u95F4(A\u7248\u6BEB\u79D2) #2017-08-13 10:07:25 clusterAStartTime=1503504000725 -#\u795e\u901a\u6570\u636e\u5e93\u6700\u65e9\u7ed3\u675f\u65f6\u95f4(B\u7248\u6beb\u79d2) +#\u795E\u901A\u6570\u636E\u5E93\u6700\u65E9\u7ED3\u675F\u65F6\u95F4(B\u7248\u6BEB\u79D2) #2017-08-13 10:07:25 clusterBStartTime=1503504000725 ############################################################################################################################################ -#\u8bbe\u7f6e\u914d\u7f6e\u662f\u5426\u5165\u5e93 +#\u8BBE\u7F6E\u914D\u7F6E\u662F\u5426\u5165\u5E93 ############################################################################################################################################ isCommit=true ############################################################################################################################################ @@ -272,7 +272,7 @@ trafficAreaStat=trafficAreaStat logServiceTopn=logServiceTopn blockAndDropStat=blockAndDropStat ######################################## -#\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3 +#\u5927\u5C4F\u56FE\u8868\u5C55\u793A\u670D\u52A1\u63A5\u53E3 dashboardUrl=http://192.168.10.204:9999/galaxy-service/service/log/v1/ trafficIpActive=trafficIpActive trafficProtocol=trafficProtocol @@ -296,28 +296,28 @@ logsearch_menu_id=152 #use elasticsearch or not# isUseES=false -#httpclient \u5de5\u5177\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4 +#httpclient \u5DE5\u5177\u8BBE\u7F6E\u8D85\u65F6\u65F6\u95F4 http_socket_timeout=300000 http_connect_timeout=10000 http_connect_request_timeout=50000 http_connect_retry_times=3 -#\u6570\u636e\u4e2d\u5fc3A\u7248\u6570\u636e\u5e93\u540d\u79f0,\u7a0b\u5e8f\u4e2d\u6bcf\u6b21\u67e5\u8be2\u65f6\u4f7f\u7528\u7684\u6570\u636e\u5e93\u540d\u79f0 use dbA +#\u6570\u636E\u4E2D\u5FC3A\u7248\u6570\u636E\u5E93\u540D\u79F0,\u7A0B\u5E8F\u4E2D\u6BCF\u6B21\u67E5\u8BE2\u65F6\u4F7F\u7528\u7684\u6570\u636E\u5E93\u540D\u79F0 use dbA jdbc.hive.AName=xa_dfbhit_hive -#\u6570\u636e\u4e2d\u5fc3B\u7248\u6570\u636e\u5e93\u540d\u79f0 +#\u6570\u636E\u4E2D\u5FC3B\u7248\u6570\u636E\u5E93\u540D\u79F0 jdbc.hive.BName=xa_z2_mesalog_hive maxPageSize=100000 -#\u5bfc\u51fa\u6700\u5927\u6761\u6570 +#\u5BFC\u51FA\u6700\u5927\u6761\u6570 maxExportSize=5000 -#\u5141\u8bb8\u914d\u7f6e\u6700\u5927\u5c42\u7ea7 +#\u5141\u8BB8\u914D\u7F6E\u6700\u5927\u5C42\u7EA7 maxLevelNo=4 -#\u4e0a\u4e0b\u7ea7\u663e\u793a\u95f4\u9694\u6807\u8bc6\u7b26 +#\u4E0A\u4E0B\u7EA7\u663E\u793A\u95F4\u9694\u6807\u8BC6\u7B26 childrenMark=. -#\u4e1a\u52a1\u5b57\u5178\u5728\u8bcd\u5178\u4e2d\u7684\u6807\u8bc6 +#\u4E1A\u52A1\u5B57\u5178\u5728\u8BCD\u5178\u4E2D\u7684\u6807\u8BC6 SERVICE_DICT_ITM_TYPE=SERVICE_DICT_ITM_TYPE -#\u7cfb\u7edf\u5b57\u5178\u5728\u8bcd\u5178\u4e2d\u7684\u6807\u8bc6 +#\u7CFB\u7EDF\u5B57\u5178\u5728\u8BCD\u5178\u4E2D\u7684\u6807\u8BC6 SYS_DICT_ITM_TYPE=SYS_DICT_ITM_TYPE area_region=NTC_IP_RANGE protocol_num_region=NTC_UNIVERSAL_PROTO_TYPE @@ -345,16 +345,16 @@ ssl_ip_region=ssl_ip bgp_ip_region=bgp_ip behav_id_region=BEHAV_ID rate_limit_region=Droprate -#\u5b58\u5728\u4e0e\u8868\u8fbe\u5f0f\u7684\u5173\u952e\u5b57\u7279\u6b8a\u5206\u9694\u7b26 +#\u5B58\u5728\u4E0E\u8868\u8FBE\u5F0F\u7684\u5173\u952E\u5B57\u7279\u6B8A\u5206\u9694\u7B26 keyword_expr=***and*** -#\u65f6\u533a +#\u65F6\u533A time_zone=8 -#\u9700\u8981\u7279\u6b8a\u5904\u7406\u7684\u4e1a\u52a1\u7c7b\u578b +#\u9700\u8981\u7279\u6B8A\u5904\u7406\u7684\u4E1A\u52A1\u7C7B\u578B service_pxy_domain_intercept=513 service_ip_mulitiplex=768 service_ip_ratelimit=1057 service_domain_ratelimit=1058 -#\u7528\u6237\u81ea\u5b9a\u4e49\u57df +#\u7528\u6237\u81EA\u5B9A\u4E49\u57DF userregion_rate_limit=Droprate userregion_ir_strategy=IR_STRATEGY userregion_ir_type=IR_TYPE @@ -364,25 +364,25 @@ userregion_replace_type_key=zone userregion_replace_req_key_value=http_req_body userregion_replace_res_key_value=http_res_body userregion_replace_regex_key=regex -#\u7528\u6237\u81ea\u5b9a\u4e49\u57df\u5360\u4f4d\u7b26 +#\u7528\u6237\u81EA\u5B9A\u4E49\u57DF\u5360\u4F4D\u7B26 user_region_placeholder=0 -#\u7528\u6237\u81ea\u5b9a\u4e49\u57df\u5206\u9694\u7b26 +#\u7528\u6237\u81EA\u5B9A\u4E49\u57DF\u5206\u9694\u7B26 user_region_split=; -#IP\u76f8\u5173\u9a8c\u8bc1\u6b63\u5219 +#IP\u76F8\u5173\u9A8C\u8BC1\u6B63\u5219 ipv4_ip_subnet_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)/(3[0-2]|1[6-9]|2[0-9])$ ipv6_ip_subnet_regexp=^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))/([2-9]|[1-9][0-9]|1[0-2][0-8])$ ipv4_ip_range_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)-(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$ ipv6_ip_range_regexp=^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))-((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))$ ipv4_ip_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$ ipv6_ip_regexp=^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))$ -#\u91cd\u5b9a\u5411\u4e1a\u52a1\u81ea\u5b9a\u4e49\u57df\u76f8\u5173\u53c2\u6570 +#\u91CD\u5B9A\u5411\u4E1A\u52A1\u81EA\u5B9A\u4E49\u57DF\u76F8\u5173\u53C2\u6570 redirect_response_code_key=code redirect_url_key=url redirect_content_key=content redirect_response_code_startwith=30 replace_zone_key=zone replace_substitute_key=substitute -#\u6837\u4f8b\u6587\u4ef6\u4e0a\u4f20\u7684uri\u5173\u952e\u8bcd +#\u6837\u4F8B\u6587\u4EF6\u4E0A\u4F20\u7684uri\u5173\u952E\u8BCD sample_upload_url_keyword=/av digest_upload_url_keyword=/filetransfer cert_upload_url_keyword=/intercept/strateagy @@ -391,53 +391,53 @@ cert_upload_url_keyword=/intercept/strateagy sample_total_file_max_size=12582912 #audio File Types audio_file_type=,mp4,flv,asf,wmv,avi,mpeg,mov,dat,m4v,m4p,m4b,webm,wav,mp3, -#audio File Size 10M 10485760\uff08single\uff09 +#audio File Size 10M 10485760\uFF08single\uFF09 audio_single_file_max_size=0 -#speaker File Types \u8bf4\u8bdd\u4eba\u8bc6\u522b\u6587\u4ef6\u7c7b\u578b +#speaker File Types \u8BF4\u8BDD\u4EBA\u8BC6\u522B\u6587\u4EF6\u7C7B\u578B speaker_file_type= -#audio File Size 10M 10485760\uff08single\uff09 +#audio File Size 10M 10485760\uFF08single\uFF09 speaker_single_file_max_size=0 #video File Types video_file_type=,mp4,flv,asf,wmv,avi,mpeg,mov,dat,m4v,m4p,m4b,webm,ogv, -#video File Size 10M 10485760\uff08single\uff09 +#video File Size 10M 10485760\uFF08single\uFF09 video_single_file_max_size=0 -#face File Types \u4eba\u8138\u8bc6\u522b +#face File Types \u4EBA\u8138\u8BC6\u522B face_file_type= -#face File Size 10M 10485760\uff08single\uff09 +#face File Size 10M 10485760\uFF08single\uFF09 face_single_file_max_size=0 #picture File Types picture_file_type= -#picture File Size 10M 10485760\uff08single\uff09 +#picture File Size 10M 10485760\uFF08single\uFF09 picture_single_file_max_size=10485760 -#logo File Types \u53f0\u6807\u8bc6\u522b +#logo File Types \u53F0\u6807\u8BC6\u522B logo_file_type= -#logo File Size 10M 10485760\uff08single\uff09 +#logo File Size 10M 10485760\uFF08single\uFF09 logo_single_file_max_size=10485760 #voip File Types voip_file_type=,mp4,flv,asf,wmv,avi,mpeg,mov,dat,m4v,m4p,m4b,webm,ogv,wav,mp3, -#voip File Size 10M 10485760\uff08single\uff09 +#voip File Size 10M 10485760\uFF08single\uFF09 voip_single_file_max_size=0 #digest File Types digest_file_type= -#digest File Size 10M 10485760\uff08single\uff09 +#digest File Size 10M 10485760\uFF08single\uFF09 digest_single_file_max_size=10485760 -#digest File Size 12M 12582912\uff08total\uff09 +#digest File Size 12M 12582912\uFF08total\uFF09 digest_total_file_max_size=12582912 -#cert File Size 12M 12582912\uff08total\uff09 +#cert File Size 12M 12582912\uFF08total\uFF09 cert_total_file_max_size=12582912 #public File Types public_file_type= -#public File Size 10M 10485760\uff08single\uff09 +#public File Size 10M 10485760\uFF08single\uFF09 public_single_file_max_size=10485760 #private File Types private_file_type= -#private File Size 10M 10485760\uff08single\uff09 +#private File Size 10M 10485760\uFF08single\uFF09 private_single_file_max_size=10485760 -#YSP\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84 +#YSP\u6587\u4EF6\u4FDD\u5B58\u8DEF\u5F84 av_file_path=/home/ysp/ #av_file_path=D\:\\ysp\\ -#YSP\u6587\u4ef6\u7279\u5f81\u7c7b\u578b +#YSP\u6587\u4EF6\u7279\u5F81\u7C7B\u578B av_sample_audio_region=av_sample_audio av_sample_video_region=av_sample_video av_sample_picture_region=av_sample_picture @@ -446,7 +446,7 @@ mm_speaker_recognization_region=MM_SPEAKER_RECOGNIZATION mm_logo_detection_region=MM_LOGO_DETECTION mm_face_recognization_region=MM_FACE_RECOGNIZATION -#\u6837\u4f8b\u6587\u4ef6\u751f\u6210\u7a0b\u5e8f +#\u6837\u4F8B\u6587\u4EF6\u751F\u6210\u7A0B\u5E8F audio_sample_create_proc=/home/ceiec/av_feature_gen/audio_convert_proc video_sample_create_proc=/home/ceiec/av_feature_gen/extract_frame_feature picture_sample_create_proc=/home/ceiec/av_feature_gen/picture_convert_proc @@ -465,7 +465,7 @@ picture_sample_proc_param_is_translation=false speaker_sample_proc_param_is_translation=false logo_sample_proc_param_is_translation=false face_sample_proc_param_is_translation=false -#\u672c\u5730\u6d4b\u8bd5 +#\u672C\u5730\u6D4B\u8BD5 #audio_sample_create_proc=java -jar D\:\\sampleTest.jar #video_sample_create_proc=java -jar D\:\\sampleTest.jar #picture_sample_create_proc=java -jar D\:\\sampleTest.jar @@ -484,41 +484,41 @@ face_sample_proc_param_is_translation=false #speaker_sample_proc_param_is_translation=true #logo_sample_proc_param_is_translation=true #face_sample_proc_param_is_translation=true -#http\u81ea\u5b9a\u4e49\u57df\u76f8\u5173\u53c2\u6570 +#http\u81EA\u5B9A\u4E49\u57DF\u76F8\u5173\u53C2\u6570 http_header_user_region_key=HTTP_HEADER http_header_dict_module=HTTP_HEADER_DISTRICT -#dns\u81ea\u5b9a\u4e49\u57df\u53c2\u6570key +#dns\u81EA\u5B9A\u4E49\u57DF\u53C2\u6570key dns_strategy_user_region_key=DNS_STRATEGY -#p2p\u81ea\u5b9a\u4e49\u57dfkey +#p2p\u81EA\u5B9A\u4E49\u57DFkey p2p_ip_type_user_region_key=P2P_IP_TYPE p2p_hash_type_user_region_key=P2P_HASH_TYPE -#\u7279\u5b9a\u670d\u52a1\u7c7b\u522b +#\u7279\u5B9A\u670D\u52A1\u7C7B\u522B specific_service_cfg_type_app=social_app specific_service_cfg_type_encrypted_tunnel_behavior=encrypted_tunnel_behavior specific_service_cfg_type_basic_protocol=basic_protocol -#\u57fa\u7840\u534f\u8bae\u81ea\u5b9a\u4e49\u57df +#\u57FA\u7840\u534F\u8BAE\u81EA\u5B9A\u4E49\u57DF proto_id_region=PROTO_ID -#\u62e6\u622aIP\u81ea\u5b9a\u4e49\u57dfkey +#\u62E6\u622AIP\u81EA\u5B9A\u4E49\u57DFkey keyring_id=keyring_id droprate=Droprate bandwidth=Bandwidth intercept_domain_intensity=DOMAIN_INTENSITY -#IP\u9ed8\u8ba4\u503c +#IP\u9ED8\u8BA4\u503C ipv4_default_ip_value=0.0.0.0 ipv6_default_ip_value=\:\: ipv4_default_ip_subnet_value=0.0.0.0/16 ipv6_default_ip_subnet_value=::/128 ipv4_default_ip_range_value=0.0.0.0-1 ipv6_default_ip_range_value=::-:: -#\u7aef\u53e3\u9ed8\u8ba4\u503c +#\u7AEF\u53E3\u9ED8\u8BA4\u503C port_default=0 port_mask_default=0/65535 -#MAAT CFG \u4e00\u4e9b\u9ed8\u8ba4\u503c +#MAAT CFG \u4E00\u4E9B\u9ED8\u8BA4\u503C maat_cfg_dolog_default=2 maat_cfg_dolog_doblacklist_default=1 maat_cfg_dolog_configpercent_default=100 maat_cfg_dolog_configoption_default=1 -#app\uff0c\u57fa\u7840\u534f\u8bae\uff0c\u7279\u5b9a\u670d\u52a1\u7684userregion\u5206\u9694\u7b26 +#app\uFF0C\u57FA\u7840\u534F\u8BAE\uFF0C\u7279\u5B9A\u670D\u52A1\u7684userregion\u5206\u9694\u7B26 app_cfg_userregion_splitor=& app_id_region=APP_ID #application spec service code scope @@ -532,36 +532,36 @@ area_tag=location isp_tag=isp mmFileDigestLog=mmFileDigestLogs ntcStreamMediaLog=ntcStreamMediaLogs -#\u97f3\u89c6\u9891\u6837\u4f8b\u9650\u5236\u65f6\u957f\uff0c\u5355\u4f4d\u79d2 +#\u97F3\u89C6\u9891\u6837\u4F8B\u9650\u5236\u65F6\u957F\uFF0C\u5355\u4F4D\u79D2 av_duration_limit=120 video_to_picture_proc=/home/ceiec/av_feature_gen/save_video_frame -#\u8bc1\u4e66\u6587\u4ef6\u8def\u5f84 +#\u8BC1\u4E66\u6587\u4EF6\u8DEF\u5F84 cert_file_path=/home/cert/ -#\u8bc1\u4e66\u6821\u9a8c\u5de5\u5177\u540d\u79f0 +#\u8BC1\u4E66\u6821\u9A8C\u5DE5\u5177\u540D\u79F0 cert_validate_file=x509 -#\u8bc1\u4e66\u6821\u9a8c\u6210\u529f\u7684\u5173\u952e\u4fe1\u606f +#\u8BC1\u4E66\u6821\u9A8C\u6210\u529F\u7684\u5173\u952E\u4FE1\u606F cert_validate_success_info=Successful -#ipv4 range\u65b0\u683c\u5f0f0.0.0.1-2 +#ipv4 range\u65B0\u683C\u5F0F0.0.0.1-2 ipv4_ip_range_regexp_new=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)-(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$ ipv4_ip_subnet_regexp_original=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)/(3[0-2]|1[0-9]|2[0-9]|[0-9])$ -#\u57df\u540d\u9a8c\u8bc1\u6b63\u5219 +#\u57DF\u540D\u9A8C\u8BC1\u6B63\u5219 domain_regexp=^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$ -#IP\u590d\u7528maat json\u4e2d\u7684ip region\u5355\u6b21send \u6700\u5927\u4e2a\u6570 +#IP\u590D\u7528maat json\u4E2D\u7684ip region\u5355\u6B21send \u6700\u5927\u4E2A\u6570 maat_json_send_size=20000 -#\u5bfc\u5165\u9a8c\u8bc1\u7684\u7ebf\u7a0b\u6570\u91cf +#\u5BFC\u5165\u9A8C\u8BC1\u7684\u7EBF\u7A0B\u6570\u91CF mulity_thread_size=5 ntcRadiusReport=ntcRadiusReport ntcCollectVoipLog=ntcCollectVoipLogs ntcKeywordsUrlLog=ntcKeywordsUrlLogs save_and_del_thread_size=5 -#mysql \u5355\u4e2asql\u5927\u5c0f\u9650\u5236,\u6839\u636emariadb\u76f8\u5173\u53c2\u6570\u914d\u7f6e +#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 +#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 http_max_connection=1000 default_max_perroute=100 poolcm_socket_timeout=3000 app_vignore_user_region_key=VIGNORE -#policies\u83dc\u5355\u7684\u83dc\u5355ID +#policies\u83DC\u5355\u7684\u83DC\u5355ID policies_menu_id=86 userCreate=UserCreate userPasswordSet=UserPasswordSet @@ -571,7 +571,7 @@ userList=UserList ip_reuse_call_cgi_url=http://192.168.11.137:8090/command ipNumGet=IpNumGet allIpGet=AllIpGet -#\u6d41\u91cf\u7edf\u8ba1\u5e26\u5bbd\u8be6\u60c5 +#\u6D41\u91CF\u7EDF\u8BA1\u5E26\u5BBD\u8BE6\u60C5 trafficBandwidthTrans=trafficBandwidthTrans trafficProtocolList=trafficProtocolList irSnatLog=irSnatLogs @@ -591,7 +591,7 @@ trafficBandwidthTransFour=trafficBandwidthTransFour ntcCollectRadiusLog=ntcCollectRadiusLogs ntcConnRecordLog=ntcConnRecordLogs ntcConnRecordPercent=ntcConnRecordPercent -#\u5bfc\u51fa\u6700\u5927\u6761\u6570 +#\u5BFC\u51FA\u6700\u5927\u6761\u6570 maxLogExportSize=2000 pxy_crtl_subscribe_id_region=PXY_CTRL_SUBSCRIBE_ID ntc_subscribe_id_region=NTC_SUBSCRIBE_ID @@ -602,4 +602,5 @@ trafficWebsiteListNoTime=trafficWebsiteListNoTime trafficTopicList=trafficTopicList trafficDomainTrans=trafficDomainTrans #maximum number to import -import_limit=10 \ No newline at end of file +import_limit=10 +trafficPortActiveFiveMinute=trafficPortActiveFiveMinute \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp index 1ea623730..17d655c0d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp @@ -72,7 +72,7 @@ body {
- +

@@ -81,7 +81,7 @@ body {

-

0

+

0

@@ -90,38 +90,37 @@ body {
- +

" class="tooltips" data-flag="false" data-html="true" data-placement="top">

-

0

+

0

- +

" class="tooltips" data-flag="false" data-html="true" data-placement="top">

-

0

- +

0

@@ -220,9 +219,9 @@ body { - <%-- + - --%> +
diff --git a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp_new b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp_new deleted file mode 100644 index bc3ab2e8c..000000000 --- a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp_new +++ /dev/null @@ -1,935 +0,0 @@ -<%@ page contentType="text/html;charset=UTF-8"%> -<%@ include file="/WEB-INF/include/taglib.jsp"%> - - - - - - 数据概览 - - - - - - - - - - - -
- - - - - - - -
-
-
-
- - - - - - - -
-
-
-
- -
-
-
- - - - - - - -
-
-
-
- -
-
-
- - - - -
- -
- - - - - - - - - - -
-
- -
-
- -
- - -
-
-
-
- - - - - - - -
-
-
-
- -
-
-
- - - - -
-
- - - - - - - - - - -
-
-
-
-
-
- <%--
- -
--%> -
-
-
-
-
-
- -
-
-
-
- - - - - - - -
-
-
-
- -
-
-
- - - - -
-
- - - - - - - - - - -
-
- -
-
-
-
-
-
-
- <%--
- -
--%> -
-
-
-
-
- -
-
- - - - - - - - - - - - - -<%-- --%> - - - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index e6b540661..3fdcd0936 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -155,17 +155,18 @@ function showActionTransChart(rs){ credits:{//是否有highcharts水印 enabled:false }, - /* plotOptions: { - area: { - stacking: 'normal', - lineColor: '#666666', - lineWidth: 1, - marker: { - lineWidth: 1, - lineColor: '#666666' - } - } - }, */ + plotOptions: { + series: { + marker: { + radius: 2, + hover: { + enabled: true, + radius: 7, + radiusPlus: 5 + } + } + } + }, // legend: { // layout: 'vertical', // align: 'right', diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 25fc51671..2e78423b6 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -66,7 +66,6 @@ $(document).ready(function(){ }, error: function(data, textStatus, errorThrown){ closeTip(); -// warning_prompt("获取实时列表数据失败!",1500); }, complete:function(XMLHttpRequest,status){//超时设置 closeTip(); @@ -130,6 +129,18 @@ function showDomainTrans(rs){ legend: { enabled:false }, + plotOptions: { + series: { + marker: { + radius: 2, + hover: { + enabled: true, + radius: 7, + radiusPlus: 5 + } + } + } + }, series: series, }); } diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 3c81febbc..921f743c1 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -205,6 +205,18 @@ function showIpActiveChart(rs){ align:'high', }, }, + plotOptions: { + series: { + marker: { + radius: 2, + hover: { + enabled: true, + radius: 7, + radiusPlus: 5 + } + } + } + }, tooltip: { pointFormat: ':{series.name} :{point.y}
' }, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp new file mode 100644 index 000000000..717ede5b6 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp @@ -0,0 +1,288 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + <spring:message code="active_port"></spring:message> + + + +
+ +

+ +

+
+ + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+ + +
+
+ +
+
+
+
+ + + + + + + +<%-- --%> + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 7b91a36e1..56b620563 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -361,11 +361,13 @@ } function openPicWindow(url){ $.jBox("iframe:"+url, { - title: "", + title: "Domain", top: '1%', draggable:false, width: $(document).width()*0.9, height:$(document).height()*0.9, + showScrolling: false, /* 是否显示浏览的滚动条 */ + iframeScrolling: 'no', buttons: { 'close': true } }); } From fcfc7a617d703bd74aed24ba4769de1f8ec50d37 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Mon, 24 Dec 2018 11:06:43 +0800 Subject: [PATCH 044/147] =?UTF-8?q?=E4=BF=AE=E5=A4=8DtabelExport.js?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=AF=BC=E5=87=BA=E6=93=8D=E4=BD=9C=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=8F=90=E4=BA=A4=E8=A1=A8=E5=8D=95=E9=97=AE=E9=A2=98?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/index.jsp | 6 ++++-- src/main/webapp/WEB-INF/views/report/list.jsp | 2 ++ .../static/global/plugins/tableExport-3.3.13/tableexport.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/index.jsp b/src/main/webapp/WEB-INF/views/index.jsp index c61ea5d79..d6b7abb42 100644 --- a/src/main/webapp/WEB-INF/views/index.jsp +++ b/src/main/webapp/WEB-INF/views/index.jsp @@ -103,6 +103,7 @@ // 导出 $(".export-btn").on("click",function(){ + loading(''); var suffix = $(this).data("export-type"); // 导出文件类型 var tableMark = $(this).data("export-table"); //导出table var menuName = $("#menuName").val(); @@ -119,6 +120,7 @@ $("caption").remove(); $(".exportFirst").remove(); $("."+tableMark+" .count").empty(); + closeTip(); }); }); function setTemporaryRows(tableMark){ @@ -195,7 +197,7 @@
- @@ -258,7 +260,7 @@
- diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index 07fb2d01f..11b3a2d51 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -70,6 +70,7 @@ $(document).ready(function() { }); //ajaxServiceLogTotal(); $(".export-btn").click(function(){ + loading(''); var suffix = $(this).data("export-type"); totaltb(1,-1); @@ -85,6 +86,7 @@ $(document).ready(function() { $("#myexport").click(); $("caption").remove(); //totaltb(pato,size); + closeTip(); }); diff --git a/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js b/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js index 5e2745189..69ea324db 100644 --- a/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js +++ b/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js @@ -315,7 +315,7 @@ * @param myClass {String} */ function createObjButton(dataObject, myContent, myClass) { - var exportButton = ""; + var exportButton = ""; checkCaption(exportButton); } }); From 91eb68785a1432a7fb642e9608cb1234f8b15cf1 Mon Sep 17 00:00:00 2001 From: wangxin Date: Mon, 24 Dec 2018 11:49:36 +0600 Subject: [PATCH 045/147] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E9=A1=B5=E9=9D=A2=E5=8A=A0=E8=BD=BD=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E5=8F=98=E6=85=A2=E7=9A=84asn=E7=BB=84=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/web/controller/basics/AsnIpController.java | 6 +++--- src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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 d78ccde84..3736613d4 100644 --- a/src/main/java/com/nis/web/controller/basics/AsnIpController.java +++ b/src/main/java/com/nis/web/controller/basics/AsnIpController.java @@ -50,9 +50,9 @@ public class AsnIpController extends BaseController{ // List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(4); // model.addAttribute("policyGroups", policyGroups); - AsnCacheUtils.init(false); - List policyGroups=AsnCacheUtils.getAllAsnGroup(); - model.addAttribute("policyGroups", policyGroups); +// AsnCacheUtils.init(false); +// List policyGroups=AsnCacheUtils.getAllAsnGroup(); +// model.addAttribute("policyGroups", policyGroups); return "/basics/asnIpCfgList"; } @RequestMapping(value = {"/addForm"}) diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp index 9e6903056..26eecb7cc 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp @@ -100,14 +100,14 @@
-
+ <%--
-
+
--%> <%--
From 0b8c195b1bc227ad1b9aa06f1550ce9c2c175255 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Mon, 24 Dec 2018 12:41:05 +0600 Subject: [PATCH 046/147] =?UTF-8?q?bgp=E5=92=8Cdns=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=8E=BB=E6=8E=89=E9=BB=91=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp | 5 +++-- src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp | 6 +++--- src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp | 1 + src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp index 2b491218c..b7548e56d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp @@ -140,6 +140,7 @@ + @@ -207,7 +208,7 @@
-
+ <%--
@@ -226,7 +227,7 @@
-
+
--%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp index 5a359ae09..02a770fec 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp @@ -371,7 +371,7 @@ - + <%-- --%> @@ -418,13 +418,13 @@ - + <%-- - + --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp index 9f2538bb9..fff8b3634 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp @@ -154,6 +154,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp index b52d159ed..3bf6899de 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp @@ -370,7 +370,7 @@ - + <%-- --%> @@ -422,13 +422,13 @@ - + <%-- - + --%>
From 9a239efb94d94c193cc37190637d5f259bd6fda0 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Mon, 24 Dec 2018 14:54:57 +0800 Subject: [PATCH 047/147] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=9B=BE=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/dynamicpage/dynamicIndex.jsp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp b/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp index f5543bfd5..701270085 100644 --- a/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp @@ -897,14 +897,14 @@ color: 'white', fontSize: 12, formatter: function (value, index) { - if (value > 1000 && value <= 1000000) { - return value/1000 + " K"; + if (value > 1024 && value <= 1048576) { + return value/1024 + " KBps"; } - if (value > 10000000 && value <= 1000000000) { - return value/1000000 + " M"; + if (value > 1048576 && value <= 1073741824) { + return value/1048576 + " MBps"; } - if (value > 100000000) { - return value/1000000000 + " B"; + if (value > 1073741824) { + return value/1073741824 + " GBps"; } return value; } From a4c29ae5fdce2c6fddb915f2fc8162ef2e790a2e Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Mon, 24 Dec 2018 14:56:42 +0800 Subject: [PATCH 048/147] =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B3=A8=E9=87=8AuserRegion=E5=88=97.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/appList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/l2tpLogList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mailList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmFileDigestList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp | 4 ++-- .../webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp | 4 ++-- .../webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmVoipAccountList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp | 2 +- src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/pptpLogList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp | 4 ++-- src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp | 4 ++-- 39 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp b/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp index 67c8d7358..6de17df8c 100644 --- a/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp +++ b/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp @@ -270,7 +270,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -418,7 +418,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp index 0749ce63f..a98de291f 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp @@ -207,7 +207,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -354,7 +354,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp index b421a5d48..d0a0a071a 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp @@ -250,7 +250,7 @@ - + <%-- --%> @@ -363,7 +363,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} ${log.type } diff --git a/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp index 01450527e..a06e7e1bc 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp @@ -272,7 +272,7 @@ - + <%-- --%> @@ -399,7 +399,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp index e074c2b4c..86de617e0 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp @@ -263,7 +263,7 @@ $(document).ready(function(){ - + @@ -399,7 +399,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp index b80380308..0f0bdf8cd 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp @@ -269,7 +269,7 @@ - + <%-- --%> @@ -437,7 +437,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp index 8dd570d54..5e42a1cc3 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp @@ -254,7 +254,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -388,7 +388,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp index 8ce7ecc26..71d3646f7 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp @@ -298,7 +298,7 @@ - + <%-- --%> @@ -421,7 +421,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp index acee93873..0d7cec69e 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp @@ -292,7 +292,7 @@ - + <%-- --%> @@ -474,7 +474,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} 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 0392a8ab4..93515f8de 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp @@ -251,7 +251,7 @@ - + <%-- --%> @@ -360,7 +360,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp index f25efe6fd..6564e31f2 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp @@ -190,7 +190,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -312,7 +312,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp index 940c40327..e9ec0e3b0 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp @@ -226,7 +226,7 @@ - + <%-- --%> @@ -344,7 +344,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp index b41b35b96..7ee304285 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp @@ -226,7 +226,7 @@ - + <%-- --%> @@ -345,7 +345,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/l2tpLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/l2tpLogList.jsp index 807bf7e4e..524638047 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/l2tpLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/l2tpLogList.jsp @@ -201,7 +201,7 @@ - + <%-- --%> @@ -324,7 +324,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mailList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mailList.jsp index 5bf5a8a23..5230578b6 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mailList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mailList.jsp @@ -280,7 +280,7 @@ - + <%-- --%> @@ -414,7 +414,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp index b45b50b92..5cce8f958 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp @@ -207,7 +207,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -366,7 +366,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp index 580422444..b1afb0003 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp @@ -204,7 +204,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -361,7 +361,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmFileDigestList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmFileDigestList.jsp index bd595b385..0c30f19ee 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmFileDigestList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmFileDigestList.jsp @@ -256,7 +256,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -414,7 +414,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp index 8064cab45..544450245 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp @@ -203,7 +203,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -363,7 +363,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp index bff10d1bb..3957750c4 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp @@ -202,7 +202,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -360,7 +360,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp index 3d6241e1e..ff2e68cf8 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp @@ -204,7 +204,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -358,7 +358,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp index 996d2a88c..7d93d8e9e 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp @@ -256,7 +256,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -414,7 +414,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp index 1d2408069..beeba3985 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp @@ -316,7 +316,7 @@ - + <%-- --%> @@ -469,7 +469,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp index 9cceeae17..99a09c952 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp @@ -245,7 +245,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -404,7 +404,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp index 9e3fd5adc..83d5eca56 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp @@ -245,7 +245,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -401,7 +401,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp index 9b3f7859c..b4809cd38 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp @@ -255,7 +255,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -412,7 +412,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp index 33c3b9d0c..bc7a76a9a 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp @@ -245,7 +245,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -403,7 +403,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp index f048d9f3e..73feb9a13 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp @@ -256,7 +256,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -415,7 +415,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp index cbe7dc4ab..023a39091 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp @@ -261,7 +261,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -410,7 +410,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmVoipAccountList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmVoipAccountList.jsp index 4a906fbfc..17624938c 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmVoipAccountList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmVoipAccountList.jsp @@ -211,7 +211,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -354,7 +354,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp index 74fe6e0be..d88d601b1 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp @@ -267,7 +267,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -418,7 +418,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp index 876bece24..5872d07b8 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp @@ -251,7 +251,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -372,7 +372,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} 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 b3c20796d..bf2db70e2 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp @@ -334,7 +334,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp index ca795e7b7..daa766dae 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp @@ -254,7 +254,7 @@ - + <%-- --%> @@ -371,7 +371,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/pptpLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/pptpLogList.jsp index 4a8d96b63..80c11ead8 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/pptpLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/pptpLogList.jsp @@ -198,7 +198,7 @@ - + <%-- --%> @@ -317,7 +317,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp index d3364395f..48b67760a 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/radiusLogList.jsp @@ -245,7 +245,7 @@ - + <%-- --%> @@ -369,7 +369,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp index 034028d18..2ff265de6 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp @@ -205,7 +205,7 @@ $(document).ready(function(){ - + <%-- --%> @@ -325,7 +325,7 @@ $(document).ready(function(){ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp index ed2af9ea0..2afe9a28d 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp @@ -268,7 +268,7 @@ - + <%-- --%> @@ -386,7 +386,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} diff --git a/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp b/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp index 8d94795ef..2a85014ae 100644 --- a/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp @@ -265,7 +265,7 @@ - + <%-- --%> @@ -400,7 +400,7 @@ ${log.dAsn} ${log.sSubscribeId} ${log.dSubscribeId} - ${log.userRegion} + <%-- ${log.userRegion} --%> ${log.sceneFile} From b134b39b87db72d056017ce4498f108b0affbfaf Mon Sep 17 00:00:00 2001 From: lihaochen Date: Mon, 24 Dec 2018 15:57:49 +0800 Subject: [PATCH 049/147] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8=20?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A1=8C=E4=B8=BA=E7=BB=9F=E8=AE=A1=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/domain/dashboard/NtcRadiusReport.java | 58 +-- .../TrafficStatisticsReportController.java | 377 +++++++++++++++--- .../views/dashboard/trafficUserBehavior.jsp | 29 ++ 3 files changed, 379 insertions(+), 85 deletions(-) diff --git a/src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java b/src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java index 0cd839f36..cb836f0b7 100644 --- a/src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java +++ b/src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java @@ -1,27 +1,29 @@ package com.nis.domain.dashboard; -import java.io.Serializable; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; import com.wordnik.swagger.annotations.ApiModelProperty; -public class NtcRadiusReport implements Serializable{ - - private static final long serialVersionUID = 7635016645942704971L; - @JsonInclude(value = Include.NON_NULL) - @ApiModelProperty(value = "接入IP", required = true) +public class NtcRadiusReport { + + // @JsonInclude(value = Include.NON_NULL) + // @ApiModelProperty(value = "接入IP", required = true) + @ExcelField(title = "ip_address_control", sort = 2) protected String nasIp; - @JsonInclude(value = Include.NON_NULL) - @ApiModelProperty(value = "用户名", required = true) + // @JsonInclude(value = Include.NON_NULL) + // @ApiModelProperty(value = "用户名", required = true) + @ExcelField(title = "account", sort = 1) protected String account; - @JsonInclude(value = Include.NON_NULL) - @ApiModelProperty(value = "次数", required = true) + // @JsonInclude(value = Include.NON_NULL) + // @ApiModelProperty(value = "次数", required = true) + @ExcelField(title = "visits", sort = 3) protected Long num; - @JsonInclude(value = Include.NON_NULL) - @ApiModelProperty(value = "统计时间", required = true) + // @JsonInclude(value = Include.NON_NULL) + // @ApiModelProperty(value = "统计时间", required = true) + @ExcelField(title = "stat_time", sort = 4) protected String reportTime; /** @@ -67,6 +69,16 @@ public class NtcRadiusReport implements Serializable{ return reportTime; } + @Override + public String toString() { + return "NtcRadiusReport [nasIp=" + nasIp + ", account=" + account + ", num=" + num + ", reportTime=" + + reportTime + ", searchBusinessType=" + searchBusinessType + ", searchFoundStartTime=" + + searchFoundStartTime + ", searchFoundEndTime=" + searchFoundEndTime + + ", searchReportStartTimeCluster=" + searchReportStartTimeCluster + ", searchReportEndTimeCluster=" + + searchReportEndTimeCluster + ", searchNasIp=" + searchNasIp + ", searchAccount=" + searchAccount + + ", groupType=" + groupType + "]"; + } + public void setReportTime(String reportTime) { this.reportTime = reportTime; } @@ -74,11 +86,11 @@ public class NtcRadiusReport implements Serializable{ public String getSearchBusinessType() { return searchBusinessType; } - @JsonIgnore + public void setSearchBusinessType(String searchBusinessType) { this.searchBusinessType = searchBusinessType; } - @JsonIgnore + public String getSearchFoundStartTime() { return searchFoundStartTime; } @@ -86,7 +98,7 @@ public class NtcRadiusReport implements Serializable{ public void setSearchFoundStartTime(String searchFoundStartTime) { this.searchFoundStartTime = searchFoundStartTime; } - @JsonIgnore + public String getSearchFoundEndTime() { return searchFoundEndTime; } @@ -95,16 +107,14 @@ public class NtcRadiusReport implements Serializable{ this.searchFoundEndTime = searchFoundEndTime; } - @JsonIgnore public Long getSearchReportStartTimeCluster() { return searchReportStartTimeCluster; } - public void setSearchReportStartTimeCluster( - Long searchReportStartTimeCluster) { + public void setSearchReportStartTimeCluster(Long searchReportStartTimeCluster) { this.searchReportStartTimeCluster = searchReportStartTimeCluster; } - @JsonIgnore + public Long getSearchReportEndTimeCluster() { return searchReportEndTimeCluster; } @@ -112,7 +122,7 @@ public class NtcRadiusReport implements Serializable{ public void setSearchReportEndTimeCluster(Long searchReportEndTimeCluster) { this.searchReportEndTimeCluster = searchReportEndTimeCluster; } - @JsonIgnore + public String getSearchNasIp() { return searchNasIp; } @@ -120,7 +130,7 @@ public class NtcRadiusReport implements Serializable{ public void setSearchNasIp(String searchNasIp) { this.searchNasIp = searchNasIp; } - @JsonIgnore + public String getSearchAccount() { return searchAccount; } @@ -128,11 +138,11 @@ public class NtcRadiusReport implements Serializable{ public void setSearchAccount(String searchAccount) { this.searchAccount = searchAccount; } - @JsonIgnore + public String getGroupType() { return groupType; } - + public void setGroupType(String groupType) { this.groupType = groupType; } diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsReportController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsReportController.java index 9d38654be..fcdf92466 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsReportController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsReportController.java @@ -6,13 +6,16 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Random; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; @@ -23,20 +26,30 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import com.nis.domain.Page; +import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.dashboard.NtcRadiusReport; +import com.nis.domain.log.BaseLogEntity; +import com.nis.domain.maat.LogRecvData; +import com.nis.domain.report.NtcAsnRecord; +import com.nis.domain.report.NtcIpRangeReport; import com.nis.util.Constants; import com.nis.util.DateUtils; import com.nis.util.StringUtil; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; -@Controller +import net.sf.json.JSONObject; + +@Controller @RequestMapping("${adminPath}/traffic") public class TrafficStatisticsReportController extends BaseController { - - + /** * 用户行为查询 + * * @param bean * @param model * @param request @@ -44,140 +57,382 @@ public class TrafficStatisticsReportController extends BaseController { * @return */ @RequestMapping("userBehavior") - public String list(@ModelAttribute("log") NtcRadiusReport bean,Model model, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes) { + public String list(@ModelAttribute("log") NtcRadiusReport bean, Model model, HttpServletRequest request, + HttpServletResponse response, RedirectAttributes redirectAttributes) { Map fromJsonList = new HashMap(); Map userJsonList = new HashMap(); Map ipJsonList = new HashMap(); String searchBusinessType = bean.getSearchBusinessType(); - if("2".endsWith(searchBusinessType)) { + if ("2".endsWith(searchBusinessType)) { model.addAttribute("searchBusinessType", 2);// 用户查询 } - if("3".endsWith(searchBusinessType)) { + if ("3".endsWith(searchBusinessType)) { model.addAttribute("searchBusinessType", 3);// IP查询 } - String url = Constants.DASHBOARD_URL+Constants.NTC_RADIUS_REPORT; + String url = Constants.DASHBOARD_URL + Constants.NTC_RADIUS_REPORT; String statTime = bean.getSearchFoundStartTime(); String endTime = bean.getSearchFoundEndTime(); String account = bean.getAccount(); String nasIp = bean.getNasIp(); - String destUrl = url+ "?searchBusinessType=1"; - String userUrl = url+ "?searchBusinessType=2"; - String ipUrl =url + "?searchBusinessType=3"; + String destUrl = url + "?searchBusinessType=1"; + String userUrl = url + "?searchBusinessType=2"; + String ipUrl = url + "?searchBusinessType=3"; List list = new ArrayList(); List userList = new ArrayList(); List ipList = new ArrayList(); try { - if(StringUtil.isBlank(statTime)&&StringUtil.isBlank(endTime)) { + if (StringUtil.isBlank(statTime) && StringUtil.isBlank(endTime)) { // 设置默认时间为1小时 -// statTime=DateUtils.getDate()+" 00:00:00"; // 默认今天 -// endTime=DateUtils.getDateTime(); - - Calendar cal = Calendar. getInstance (); + // statTime=DateUtils.getDate()+" 00:00:00"; // 默认今天 + // endTime=DateUtils.getDateTime(); + + Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); - endTime = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format(cal.getTime());//获取到完整的时间 - cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1); - statTime = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format(cal.getTime()); + endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cal.getTime());// 获取到完整的时间 + cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1); + statTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cal.getTime()); bean.setSearchFoundStartTime(statTime); bean.setSearchFoundEndTime(endTime); - statTime=URLEncoder.encode(statTime, "UTF-8"); - endTime=URLEncoder.encode(endTime, "UTF-8"); - String paramUrl="&searchReportStartTime="+statTime+"&searchReportEndTime="+endTime; - destUrl=destUrl+paramUrl; - userUrl=userUrl+paramUrl; - ipUrl=ipUrl+paramUrl; - }else { - statTime=URLEncoder.encode(statTime, "UTF-8"); - endTime=URLEncoder.encode(endTime, "UTF-8"); - String paramUrl="&searchReportStartTime="+statTime+"&searchReportEndTime="+endTime; - destUrl=destUrl+paramUrl; - userUrl=userUrl+paramUrl; - ipUrl=ipUrl+paramUrl; + statTime = URLEncoder.encode(statTime, "UTF-8"); + endTime = URLEncoder.encode(endTime, "UTF-8"); + String paramUrl = "&searchReportStartTime=" + statTime + "&searchReportEndTime=" + endTime; + destUrl = destUrl + paramUrl; + userUrl = userUrl + paramUrl; + ipUrl = ipUrl + paramUrl; + } else { + statTime = URLEncoder.encode(statTime, "UTF-8"); + endTime = URLEncoder.encode(endTime, "UTF-8"); + String paramUrl = "&searchReportStartTime=" + statTime + "&searchReportEndTime=" + endTime; + destUrl = destUrl + paramUrl; + userUrl = userUrl + paramUrl; + ipUrl = ipUrl + paramUrl; } model.addAttribute("nowTime", DateUtils.getDateTime()); // 用户及IP数据 String string = HttpClientUtil.get(destUrl); Gson gson = new GsonBuilder().create(); - fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); + fromJsonList = gson.fromJson(string, new TypeToken() { + }.getType()); list = (ArrayList) fromJsonList.get("data"); Map map = (Map) list.get(0); - List nasIpList=(List) map.get("nasIpList"); - List accountList=(List) map.get("accountList"); - if (!StringUtil.isEmpty(nasIpList)&&nasIpList.size()>0) { + List nasIpList = (List) map.get("nasIpList"); + List accountList = (List) map.get("accountList"); + if (!StringUtil.isEmpty(nasIpList) && nasIpList.size() > 0) { List newNasIpList = new ArrayList(); for (int i = 0; i < nasIpList.size(); i++) { newNasIpList.add(nasIpList.get(i)); - if (i+1>=10) { + if (i + 1 >= 10) { break; } } nasIpList = newNasIpList; } - if (!StringUtil.isEmpty(accountList)&&accountList.size()>0) { + if (!StringUtil.isEmpty(accountList) && accountList.size() > 0) { List newAccountList = new ArrayList(); for (int i = 0; i < accountList.size(); i++) { newAccountList.add(accountList.get(i)); - if (i+1>=10) { + if (i + 1 >= 10) { break; } } - + accountList = newAccountList; } - System.out.println("-------------------:"+nasIpList.size()+"+++"+accountList.size()+"=================="); + System.out.println( + "-------------------:" + nasIpList.size() + "+++" + accountList.size() + "=================="); model.addAttribute("nasIpList", nasIpList); model.addAttribute("accountList", accountList); - if(StringUtil.isBlank(account)&&accountList!=null&&accountList.size()>0&&!"3".equals(searchBusinessType)) { + if (StringUtil.isBlank(account) && accountList != null && accountList.size() > 0 + && !"3".equals(searchBusinessType)) { Map accountMap = (Map) accountList.get(0); - String firstAccount=""; - if(accountMap!=null&&accountMap.get("account")!=null){ - firstAccount=(String) accountMap.get("account"); - String userString = HttpClientUtil.get(userUrl+"&searchAccount="+firstAccount); + String firstAccount = ""; + if (accountMap != null && accountMap.get("account") != null) { + firstAccount = (String) accountMap.get("account"); + String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + firstAccount); // 指定用户 查询 Gson usergson = new GsonBuilder().create(); - userJsonList = usergson.fromJson(userString, new TypeToken(){}.getType()); + userJsonList = usergson.fromJson(userString, new TypeToken() { + }.getType()); userList = (ArrayList) userJsonList.get("data"); } model.addAttribute("userList", userList); model.addAttribute("searchAccount", firstAccount); } - if(StringUtil.isBlank(nasIp)&&nasIpList!=null&&nasIpList.size()>0&&!"2".equals(searchBusinessType)) { + if (StringUtil.isBlank(nasIp) && nasIpList != null && nasIpList.size() > 0 + && !"2".equals(searchBusinessType)) { Map ipMap = (Map) nasIpList.get(0); - String firstIp=""; - if(ipMap!=null&&ipMap.get("nasIp")!=null){ - firstIp=(String) ipMap.get("nasIp"); - String ipString = HttpClientUtil.get(ipUrl+"&searchNasIp="+firstIp); + String firstIp = ""; + if (ipMap != null && ipMap.get("nasIp") != null) { + firstIp = (String) ipMap.get("nasIp"); + String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + firstIp); // 指定IP查询 Gson ipgson = new GsonBuilder().create(); - ipJsonList = ipgson.fromJson(ipString, new TypeToken(){}.getType()); + ipJsonList = ipgson.fromJson(ipString, new TypeToken() { + }.getType()); ipList = (ArrayList) ipJsonList.get("data"); } model.addAttribute("ipList", ipList); model.addAttribute("searchNasIp", firstIp); - + } - if("2".endsWith(searchBusinessType)&&!StringUtil.isBlank(account)) { - - String userString = HttpClientUtil.get(userUrl+"&searchAccount="+account); + if ("2".endsWith(searchBusinessType) && !StringUtil.isBlank(account)) { + + String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + account); // 指定用户 查询 Gson usergson = new GsonBuilder().create(); - userJsonList = usergson.fromJson(userString, new TypeToken(){}.getType()); + userJsonList = usergson.fromJson(userString, new TypeToken() { + }.getType()); userList = (ArrayList) userJsonList.get("data"); model.addAttribute("userList", userList); model.addAttribute("searchAccount", account); } - if ("3".endsWith(searchBusinessType)&&!StringUtil.isBlank(nasIp)) { - String ipString = HttpClientUtil.get(ipUrl+"&searchNasIp="+nasIp); + if ("3".endsWith(searchBusinessType) && !StringUtil.isBlank(nasIp)) { + String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + nasIp); // 指定IP查询 Gson ipgson = new GsonBuilder().create(); - ipJsonList = ipgson.fromJson(ipString, new TypeToken(){}.getType()); + ipJsonList = ipgson.fromJson(ipString, new TypeToken() { + }.getType()); ipList = (ArrayList) ipJsonList.get("data"); model.addAttribute("ipList", ipList); model.addAttribute("searchNasIp", nasIp); } } catch (Exception e) { e.printStackTrace(); - addMessage(redirectAttributes,"error","request_service_failed"); + addMessage(redirectAttributes, "error", "request_service_failed"); } return "/dashboard/trafficUserBehavior"; } + + // 用户行为导出 + @RequestMapping(value = "userBehaviorExport") + public void userBehaviorExport(@ModelAttribute("log") NtcRadiusReport bean, Model model, String hColumns, + String type, HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes) { + + List exportList = new ArrayList(); + + Map fromJsonList = new HashMap(); + Map userJsonList = new HashMap(); + Map ipJsonList = new HashMap(); + String searchBusinessType = bean.getSearchBusinessType(); + if ("2".endsWith(searchBusinessType)) { + model.addAttribute("searchBusinessType", 2);// 用户查询 + } + if ("3".endsWith(searchBusinessType)) { + model.addAttribute("searchBusinessType", 3);// IP查询 + } + String url = Constants.DASHBOARD_URL + Constants.NTC_RADIUS_REPORT; + String statTime = bean.getSearchFoundStartTime(); + String endTime = bean.getSearchFoundEndTime(); + String account = bean.getAccount(); + String nasIp = bean.getNasIp(); + String destUrl = url + "?searchBusinessType=1"; + String userUrl = url + "?searchBusinessType=2"; + String ipUrl = url + "?searchBusinessType=3"; + List list = new ArrayList(); + List userList = new ArrayList(); + List ipList = new ArrayList(); + try { + if (StringUtil.isBlank(statTime) && StringUtil.isBlank(endTime)) { + // 设置默认时间为1小时 + // statTime=DateUtils.getDate()+" 00:00:00"; // 默认今天 + // endTime=DateUtils.getDateTime(); + + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date()); + endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cal.getTime());// 获取到完整的时间 + cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1); + statTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cal.getTime()); + bean.setSearchFoundStartTime(statTime); + bean.setSearchFoundEndTime(endTime); + statTime = URLEncoder.encode(statTime, "UTF-8"); + endTime = URLEncoder.encode(endTime, "UTF-8"); + String paramUrl = "&searchReportStartTime=" + statTime + "&searchReportEndTime=" + endTime; + destUrl = destUrl + paramUrl; + userUrl = userUrl + paramUrl; + ipUrl = ipUrl + paramUrl; + } else { + statTime = URLEncoder.encode(statTime, "UTF-8"); + endTime = URLEncoder.encode(endTime, "UTF-8"); + String paramUrl = "&searchReportStartTime=" + statTime + "&searchReportEndTime=" + endTime; + destUrl = destUrl + paramUrl; + userUrl = userUrl + paramUrl; + ipUrl = ipUrl + paramUrl; + } + model.addAttribute("nowTime", DateUtils.getDateTime()); + // 用户及IP数据 + String string = HttpClientUtil.get(destUrl); + Gson gson = new GsonBuilder().create(); + fromJsonList = gson.fromJson(string, new TypeToken() { + }.getType()); + list = (ArrayList) fromJsonList.get("data"); + Map map = (Map) list.get(0); + List nasIpList = (List) map.get("nasIpList"); + List accountList = (List) map.get("accountList"); + if (!StringUtil.isEmpty(nasIpList) && nasIpList.size() > 0) { + List newNasIpList = new ArrayList(); + for (int i = 0; i < nasIpList.size(); i++) { + newNasIpList.add(nasIpList.get(i)); + if (i + 1 >= 10) { + break; + } + } + nasIpList = newNasIpList; + } + if (!StringUtil.isEmpty(accountList) && accountList.size() > 0) { + List newAccountList = new ArrayList(); + for (int i = 0; i < accountList.size(); i++) { + newAccountList.add(accountList.get(i)); + if (i + 1 >= 10) { + break; + } + } + + accountList = newAccountList; + } + System.out.println( + "-------------------:" + nasIpList.size() + "+++" + accountList.size() + "=================="); + model.addAttribute("nasIpList", nasIpList); + model.addAttribute("accountList", accountList); + if (StringUtil.isBlank(account) && accountList != null && accountList.size() > 0 + && !"3".equals(searchBusinessType)) { + Map accountMap = (Map) accountList.get(0); + String firstAccount = ""; + if (accountMap != null && accountMap.get("account") != null) { + firstAccount = (String) accountMap.get("account"); + String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + firstAccount); + // 指定用户 查询 + Gson usergson = new GsonBuilder().create(); + userJsonList = usergson.fromJson(userString, new TypeToken() { + }.getType()); + userList = (ArrayList) userJsonList.get("data"); + + for (int i = 0; i < userList.size(); i++) { + JSONObject fromObject = JSONObject.fromObject(userList.get(i)); + NtcRadiusReport stu = (NtcRadiusReport) JSONObject.toBean(fromObject, NtcRadiusReport.class); + exportList.add(stu); + } + + } + model.addAttribute("userList", userList); + model.addAttribute("searchAccount", firstAccount); + } + if (StringUtil.isBlank(nasIp) && nasIpList != null && nasIpList.size() > 0 + && !"2".equals(searchBusinessType)) { + Map ipMap = (Map) nasIpList.get(0); + String firstIp = ""; + if (ipMap != null && ipMap.get("nasIp") != null) { + firstIp = (String) ipMap.get("nasIp"); + String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + firstIp); + // 指定IP查询 + Gson ipgson = new GsonBuilder().create(); + ipJsonList = ipgson.fromJson(ipString, new TypeToken() { + }.getType()); + ipList = (ArrayList) ipJsonList.get("data"); + + for (int i = 0; i < ipList.size(); i++) { + JSONObject fromObject = JSONObject.fromObject(ipList.get(i)); + NtcRadiusReport stu = (NtcRadiusReport) JSONObject.toBean(fromObject, NtcRadiusReport.class); + exportList.add(stu); + } + + } + model.addAttribute("ipList", ipList); + model.addAttribute("searchNasIp", firstIp); + + } + if ("2".endsWith(searchBusinessType) && !StringUtil.isBlank(account)) { + + String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + account); + // 指定用户 查询 + Gson usergson = new GsonBuilder().create(); + userJsonList = usergson.fromJson(userString, new TypeToken() { + }.getType()); + userList = (ArrayList) userJsonList.get("data"); + + for (int i = 0; i < userList.size(); i++) { + JSONObject fromObject = JSONObject.fromObject(userList.get(i)); + NtcRadiusReport stu = (NtcRadiusReport) JSONObject.toBean(fromObject, NtcRadiusReport.class); + exportList.add(stu); + } + + model.addAttribute("userList", userList); + model.addAttribute("searchAccount", account); + } + if ("3".endsWith(searchBusinessType) && !StringUtil.isBlank(nasIp)) { + String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + nasIp); + // 指定IP查询 + Gson ipgson = new GsonBuilder().create(); + ipJsonList = ipgson.fromJson(ipString, new TypeToken() { + }.getType()); + ipList = (ArrayList) ipJsonList.get("data"); + + for (int i = 0; i < ipList.size(); i++) { + JSONObject fromObject = JSONObject.fromObject(ipList.get(i)); + NtcRadiusReport stu = (NtcRadiusReport) JSONObject.toBean(fromObject, NtcRadiusReport.class); + exportList.add(stu); + } + + model.addAttribute("ipList", ipList); + model.addAttribute("searchNasIp", nasIp); + } + + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + titleList.add("traffic_user_behavior"); + classMap.put("traffic_user_behavior", NtcRadiusReport.class); + + Properties msgProp = getMsgProp(); + NtcRadiusReport ntcRadiusReport = new NtcRadiusReport(); + long nums = 0; + for (NtcRadiusReport entity : exportList) { + if (null != entity.getNum()) { + nums += entity.getNum(); + } + } + String report_total = msgProp.getProperty("report_total"); + ntcRadiusReport.setAccount(report_total); + ntcRadiusReport.setNum(nums); + ntcRadiusReport.setNasIp("    一  "); + ntcRadiusReport.setReportTime("    一  "); + + exportList.add(ntcRadiusReport); + + dataMap.put("traffic_user_behavior", exportList); + + String cfgIndexInfoNoExport = ""; + noExportMap.put("traffic_user_behavior", cfgIndexInfoNoExport); + String timeRange = initLogMap(bean, "traffic_user_behavior"); + noExportMap.put("timeRange", timeRange); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "traffic_user_behavior", titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "traffic_user_behavior", titleList, classMap, + dataMap, noExportMap); + } + + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, "error", "request_service_failed"); + } + + } + + public String initLogMap(NtcRadiusReport log, String title) { + Properties msgProp = getMsgProp(); + String logTime = msgProp.getProperty(title, title); + ; + if (log.getSearchFoundStartTime() != null) { + logTime += " " + msgProp.getProperty("begin_date") + ":" + log.getSearchFoundStartTime(); + } + if (log.getSearchFoundEndTime() != null) { + logTime += " " + msgProp.getProperty("end_date") + ":" + log.getSearchFoundStartTime(); + } + return logTime; + } } diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp index 23d9e50b7..e004314b1 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp @@ -233,6 +233,35 @@
+
+ +
+ + +
+ + + href="javascript:;"> + +
From f9f51b0e14e70570bc1336607ff55a52185fe96c Mon Sep 17 00:00:00 2001 From: leijun Date: Mon, 24 Dec 2018 16:05:05 +0800 Subject: [PATCH 050/147] =?UTF-8?q?=E7=BC=93=E5=AD=98=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BAexcel=E5=92=8Ccsv=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/CachePolicyUserRegion.java | 159 +++++++++++ .../proxy/CachePolicyController.java | 261 ++++++------------ .../dao/configuration/CommonPolicyDao.java | 8 +- .../web/dao/configuration/CommonPolicyDao.xml | 151 ++++++++++ .../configuration/CachePolicyService.java | 94 +++++-- .../WEB-INF/views/cfg/proxy/cache/list.jsp | 21 +- 6 files changed, 487 insertions(+), 207 deletions(-) create mode 100644 src/main/java/com/nis/domain/configuration/CachePolicyUserRegion.java diff --git a/src/main/java/com/nis/domain/configuration/CachePolicyUserRegion.java b/src/main/java/com/nis/domain/configuration/CachePolicyUserRegion.java new file mode 100644 index 000000000..d1b82e673 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/CachePolicyUserRegion.java @@ -0,0 +1,159 @@ +/** + *@Title: HttpDomainConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月5日 下午5:33:05 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import java.util.Map; + +import com.nis.util.excel.ExcelField; + +/** + * @ClassName: HttpDomainConfig.java + * @Description: TODO + * @author (dell) + * @date 2018年2月5日 下午5:33:05 + * @version V1.0 + */ +public class CachePolicyUserRegion extends BaseCfg { + + private static final long serialVersionUID = -1741829305216502322L; + + @ExcelField(title="cache_cookied_cont",dictType="CACHE_COOKIED_CONT",sort=7) + private String cache_cookied_cont; + @ExcelField(title="cache_dyn_url",dictType="CACHE_DYN_URL",sort=6) + private String cache_dyn_url; + @ExcelField(title="force_caching",dictType="FORCE_CACHING",sort=10) + private String force_caching; + @ExcelField(title="ignore_req_nocache",dictType="IGNORE_REQ_NOCACHE",sort=8) + private String ignore_req_nocache; + @ExcelField(title="ignore_res_nocache",dictType="IGNORE_RES_NOCACHE",sort=9) + private String ignore_res_nocache; + @ExcelField(title="inactive_time",sort=14) + private String inactive_time; + @ExcelField(title="max_cache_obj_size",sort=15) + private String max_cache_obj_size; + @ExcelField(title="max_cache_size",sort=13) + private String max_cache_size; + @ExcelField(title="min_use",sort=11) + private String min_use; + @ExcelField(title="no_revalidate",dictType="CACHE_NO_REVALIDATE",sort=5) + private String no_revalidate; + @ExcelField(title="pinning_time",dictType="",sort=12) + private String pinning_time; + @ExcelField(title="ignore_query_string",sort=3) + private String ignore_qs; + @ExcelField(title="include_cookie",sort=4) + private String cookie; + + private Map cache_key; + + private BaseStringCfg strCfg; + + @ExcelField(title="action",sort=2) + protected String actionCode; + + + public String getActionCode() { + return actionCode; + } + public void setActionCode(String actionCode) { + this.actionCode = actionCode; + } + public BaseStringCfg getStrCfg() { + return strCfg; + } + public void setStrCfg(BaseStringCfg strCfg) { + this.strCfg = strCfg; + } + public Map getCache_key() { + return cache_key; + } + public void setCache_key(Map cache_key) { + this.cache_key = cache_key; + } + public String getIgnore_res_nocache() { + return ignore_res_nocache; + } + public void setIgnore_res_nocache(String ignore_res_nocache) { + this.ignore_res_nocache = ignore_res_nocache; + } + public String getCache_cookied_cont() { + return cache_cookied_cont; + } + public void setCache_cookied_cont(String cache_cookied_cont) { + this.cache_cookied_cont = cache_cookied_cont; + } + public String getCache_dyn_url() { + return cache_dyn_url; + } + public void setCache_dyn_url(String cache_dyn_url) { + this.cache_dyn_url = cache_dyn_url; + } + public String getForce_caching() { + return force_caching; + } + public void setForce_caching(String force_caching) { + this.force_caching = force_caching; + } + public String getIgnore_req_nocache() { + return ignore_req_nocache; + } + public void setIgnore_req_nocache(String ignore_req_nocache) { + this.ignore_req_nocache = ignore_req_nocache; + } + public String getInactive_time() { + return inactive_time; + } + public void setInactive_time(String inactive_time) { + this.inactive_time = inactive_time; + } + public String getMax_cache_obj_size() { + return max_cache_obj_size; + } + public void setMax_cache_obj_size(String max_cache_obj_size) { + this.max_cache_obj_size = max_cache_obj_size; + } + public String getMax_cache_size() { + return max_cache_size; + } + public void setMax_cache_size(String max_cache_size) { + this.max_cache_size = max_cache_size; + } + public String getMin_use() { + return min_use; + } + public void setMin_use(String min_use) { + this.min_use = min_use; + } + public String getNo_revalidate() { + return no_revalidate; + } + public void setNo_revalidate(String no_revalidate) { + this.no_revalidate = no_revalidate; + } + public String getPinning_time() { + return pinning_time; + } + public void setPinning_time(String pinning_time) { + this.pinning_time = pinning_time; + } + public String getIgnore_qs() { + return ignore_qs; + } + public void setIgnore_qs(String ignore_qs) { + this.ignore_qs = ignore_qs; + } + public String getCookie() { + return cookie; + } + public void setCookie(String cookie) { + this.cookie = cookie; + } + + +} diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/CachePolicyController.java b/src/main/java/com/nis/web/controller/configuration/proxy/CachePolicyController.java index 36c053f0e..44206d84c 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/CachePolicyController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/CachePolicyController.java @@ -3,39 +3,27 @@ package com.nis.web.controller.configuration.proxy; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.mvc.support.RedirectAttributes; - -import com.nis.domain.FunctionRegionDict; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; -import com.nis.domain.callback.ProxyFileStrategyCfg; import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CachePolicyUserRegion; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; -import com.nis.domain.configuration.FileDigestCfg; -import com.nis.domain.configuration.HttpBodyCfg; -import com.nis.domain.configuration.HttpReqHeadCfg; -import com.nis.domain.configuration.HttpResHeadCfg; import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.IpPortCfg; -import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.util.DictUtils; @@ -43,7 +31,6 @@ import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; import com.nis.web.security.UserUtils; -import jersey.repackaged.com.google.common.collect.Lists; /** * http重定向策略 @@ -233,166 +220,90 @@ public class CachePolicyController extends BaseController{ //http配置导出 - /*@RequestMapping(value = "exportHttp") - public String exportHttp(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ - try { - //export data info - List titleList=new ArrayList(); - Map> classMap=new HashMap>(); - Map dataMap=new HashMap(); - Map noExportMap=new HashMap(); - - List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - - //导出选中记录 - if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{ - //条件导出数据大于最大导出数,只导出最大导出条数 - Page pageInfo=new Page(request, response,"a"); - if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){ - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - }else{ - pageInfo.setPageNo(1); - pageInfo.setPageSize(-1); - } - - Page page = cachePolicyService.getCachePolicyList(pageInfo, entity); - Properties prop = getMsgProp(); - for (CfgIndexInfo str : page.getList()) { - if(entity.getFunctionId()!=210 && entity.getFunctionId()!=211){ - String type="RESPONSE_CODE"; - if(entity.getFunctionId()==207){ - type="RESPONSE_CODE"; - }else if(entity.getFunctionId()==208){ - type="REDIRECT_RESPONSE_CODE"; - }else if(entity.getFunctionId()==209){ - type="CONTROL_REPLACE_ZONE"; - } - String dictlabel= DictUtils.getDictLabel(type, str.getUserRegion1()); - str.setUserRegion1(prop.getProperty(dictlabel)); - if(entity.getFunctionId()==207 || entity.getFunctionId()==208){ - if(StringUtil.isEmpty(str.getUserRegion2())){ - if(!StringUtil.isEmpty(str.getUserRegion3())){ - ProxyFileStrategyCfg file= new ProxyFileStrategyCfg(); - file.setCompileId(Integer.valueOf(str.getUserRegion3())); - List allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(file); - if(allProxyFileStrategys!=null && allProxyFileStrategys.size()>0){ - str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc()); - } - } - } - } - } - } - String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - if(entity.getFunctionId()==207){ - cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-"; - }else if(entity.getFunctionId()==208){ - cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:redirect_response_code-userregion2:redirect_url-"; - }else if(entity.getFunctionId()==209){ - cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-"; - }else if(entity.getFunctionId()==211){ - cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; - } - String httpUrlCfgNoExport=",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,"; - String httpReqHeadCfgNoExport=",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,"; - String httpResHeadCfgNoExport=",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,"; - String httpReqBodyCfgNoExport=",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,"; - String httpResBodyCfgNoExport=",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,"; - String ipPortCfgNoExport=",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 ntcSubscribeIdCfgNoExport=",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,"; - List httpUrlList = new ArrayList<>(); - List httpReqHdrList = new ArrayList<>(); - List httpResHdrList = new ArrayList<>(); - List httpReqBodyList = new ArrayList<>(); - List httpResBodyList = new ArrayList<>(); - List ipPortList = new ArrayList<>(); - List subscribeIdList = new ArrayList<>(); - for (CfgIndexInfo cfg : page.getList()) { - Map maps=cachePolicyService.exportCachePolicy(cfg); - httpUrlList.addAll(maps.get("NTC_HTTP_URL")); - httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR")); - httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR")); - httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY")); - httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY")); - ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP")); - subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID")); - } - httpUrlList=BaseStringCfg.replaceBaseKeyList(httpUrlList); - httpReqHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList); - httpResHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList); - httpReqBodyList=BaseStringCfg.replaceBaseKeyList(httpReqBodyList); - httpResBodyList=BaseStringCfg.replaceBaseKeyList(httpResBodyList); - subscribeIdList=BaseStringCfg.baseHexList(subscribeIdList); - titleList.add(entity.getMenuNameCode()); - titleList.add("NTC_HTTP_URL"); - titleList.add("NTC_HTTP_REQ_HDR"); - classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); - classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); - classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class); - noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport); - noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); - dataMap.put("NTC_HTTP_URL", httpUrlList); - dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList); - if(entity.getFunctionId()!=208 && entity.getFunctionId()!=211){ - titleList.add("NTC_HTTP_RES_BODY"); - classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class); - noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport); - dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList); - }else if(entity.getFunctionId()!=211){ - titleList.add("NTC_HTTP_RES_HDR"); - titleList.add("NTC_HTTP_REQ_BODY"); - classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class); - classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class); - noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport); - noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport); - dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList); - dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList); - } - titleList.add("NTC_UNIVERSAL_IP"); - titleList.add("NTC_SUBSCRIBE_ID"); - classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class); - classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport); - noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); - dataMap.put("NTC_UNIVERSAL_IP", ipPortList); - dataMap.put("NTC_SUBSCRIBE_ID",subscribeIdList); - - } - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); - } catch (Exception e) { - logger.error("http export failed",e); - addMessage(redirectAttributes, "export_failed"); + @RequestMapping(value = "exportCache") + public void exportdomain(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")CachePolicyUserRegion entity,String ids,RedirectAttributes redirectAttributes){ + try { + //export data info + List titleList=new ArrayList(); + Map> classMap=new HashMap>(); + Map dataMap=new HashMap(); + Map noExportMap = new HashMap(); + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = cachePolicyService.getCachePolicyByUserRegionList(ids); + } else { + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = cachePolicyService.getCachePolicyUserRegionList(pageInfo, entity); + ipLists = page.getList(); } - return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId(); - }*/ + + List serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId()); + Properties msgProp = getMsgProp(); + for (CachePolicyUserRegion cache : ipLists) { + for (FunctionServiceDict service : serviceList) { + if(cache.getAction().intValue()==service.getAction().intValue()){ + cache.setActionCode(msgProp.getProperty(service.getActionCode(),service.getActionCode())); + } + } + } + titleList.add(entity.getMenuNameCode()); + titleList.add("PXY_CACHE_HTTP_URL"); + titleList.add("PXY_CACHE_HTTP_COOKIE"); + classMap.put(entity.getMenuNameCode(), CachePolicyUserRegion.class); + classMap.put("PXY_CACHE_HTTP_URL", HttpUrlCfg.class); + classMap.put("PXY_CACHE_HTTP_COOKIE", HttpUrlCfg.class); + String cfgIndexInfoNoExport=",block_type,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&action:block_type-"; + String httpUrlInfoNoExport=",block_type,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,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); + noExportMap.put("PXY_CACHE_HTTP_URL", httpUrlInfoNoExport); + noExportMap.put("PXY_CACHE_HTTP_COOKIE", httpUrlInfoNoExport); + List urlList=new ArrayList(); + List cookieList=new ArrayList(); + for (CachePolicyUserRegion cfg : ipLists) { + Map maps=cachePolicyService.getExport(Long.valueOf(cfg.getCfgId())); + urlList.addAll(maps.get("PXY_CACHE_HTTP_URL")); + cookieList.addAll(maps.get("PXY_CACHE_HTTP_COOKIE")); + } + urlList=BaseStringCfg.replaceBaseKeyList(urlList); + cookieList=BaseStringCfg.replaceBaseKeyList(cookieList); + dataMap.put(entity.getMenuNameCode(), ipLists); + dataMap.put("PXY_CACHE_HTTP_URL", urlList); + dataMap.put("PXY_CACHE_HTTP_COOKIE", cookieList); + /*}*/ + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("ip white export failed",e); + addMessage(redirectAttributes,"error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.java b/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.java index 11cdc8e03..72e786fdf 100644 --- a/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.java +++ b/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.java @@ -1,13 +1,11 @@ package com.nis.web.dao.configuration; -import java.util.Date; import java.util.List; - import org.apache.ibatis.annotations.Param; - import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CachePolicyUserRegion; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.IpPortCfg; @@ -39,4 +37,8 @@ public interface CommonPolicyDao { public void deleteHttpUrlCfg(@Param("tableName")String tableName, @Param("entity")BaseCfg baseCfg, @Param("compileIds")List compileIds); + + public List getCachePolicyUserRegionList(CachePolicyUserRegion entity); + + public List getCachePolicyByUserRegionList(@Param("ids")String ids); } diff --git a/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.xml b/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.xml index e375bb0b8..70564e398 100644 --- a/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.xml @@ -34,6 +34,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -814,4 +850,119 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/configuration/CachePolicyService.java b/src/main/java/com/nis/web/service/configuration/CachePolicyService.java index 205519007..718e32325 100644 --- a/src/main/java/com/nis/web/service/configuration/CachePolicyService.java +++ b/src/main/java/com/nis/web/service/configuration/CachePolicyService.java @@ -16,9 +16,11 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CachePolicyUserRegion; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.CommonStringCfg; import com.nis.domain.configuration.HttpBodyCfg; @@ -38,6 +40,7 @@ import com.nis.domain.maat.ToMaatResult; 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.configuration.AreaIpCfgDao; import com.nis.web.dao.configuration.CommonPolicyDao; @@ -69,26 +72,81 @@ public class CachePolicyService extends CrudService return entity; } - /*public Map exportCachePolicy(CfgIndexInfo entity){ + public Page getCachePolicyUserRegionList(Page page, CachePolicyUserRegion entity){ + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = commonPolicyDao.getCachePolicyUserRegionList(entity); + for (CachePolicyUserRegion c : list) { + JSONObject jsonObject=JSONObject.fromObject(c.getUserRegion1()); + CachePolicyUserRegion stu=(CachePolicyUserRegion)JSONObject.toBean(jsonObject, CachePolicyUserRegion.class); + c.setCache_cookied_cont(stu.getCache_cookied_cont()); + c.setCache_dyn_url(stu.getCache_dyn_url()); + c.setForce_caching(stu.getForce_caching()); + c.setIgnore_req_nocache(stu.getIgnore_req_nocache()); + c.setIgnore_res_nocache(stu.getIgnore_res_nocache()); + c.setInactive_time(stu.getInactive_time()); + c.setMax_cache_obj_size(stu.getMax_cache_obj_size()); + c.setMax_cache_size(stu.getMax_cache_size()); + c.setMin_use(stu.getMin_use()); + c.setNo_revalidate(stu.getNo_revalidate()); + c.setPinning_time(stu.getPinning_time()); + if(stu.getCache_key()!=null){ + String ignore=String.valueOf(stu.getCache_key().get("ignore_qs")); + String cookie=String.valueOf(stu.getCache_key().get("cookie")); + if(!ignore.equals("null") && ignore!=null){ + c.setIgnore_qs(ignore); + } + if(!cookie.equals("null") && cookie!=null){ + c.setCookie(cookie); + } + } + } + page.setList(list); + return page; + } + + + public List getCachePolicyByUserRegionList(String ids){ + List list = commonPolicyDao.getCachePolicyByUserRegionList(ids); + for (CachePolicyUserRegion c : list) { + JSONObject jsonObject=JSONObject.fromObject(c.getUserRegion1()); + CachePolicyUserRegion stu=(CachePolicyUserRegion)JSONObject.toBean(jsonObject, CachePolicyUserRegion.class); + c.setCache_cookied_cont(stu.getCache_cookied_cont()); + c.setCache_dyn_url(stu.getCache_dyn_url()); + c.setForce_caching(stu.getForce_caching()); + c.setIgnore_req_nocache(stu.getIgnore_req_nocache()); + c.setIgnore_res_nocache(stu.getIgnore_res_nocache()); + c.setInactive_time(stu.getInactive_time()); + c.setMax_cache_obj_size(stu.getMax_cache_obj_size()); + c.setMax_cache_size(stu.getMax_cache_size()); + c.setMin_use(stu.getMin_use()); + c.setNo_revalidate(stu.getNo_revalidate()); + c.setPinning_time(stu.getPinning_time()); + if(stu.getCache_key()!=null){ + String ignore=String.valueOf(stu.getCache_key().get("ignore_qs")); + String cookie=String.valueOf(stu.getCache_key().get("cookie")); + if(!ignore.equals("null") && ignore!=null){ + c.setIgnore_qs(ignore); + } + if(!cookie.equals("null") && cookie!=null){ + c.setCookie(cookie); + } + } + } + return list; + } + + public Map getExport(Long cfgId){ Map dataMap=new HashMap(); - List httpUrlList = commonPolicyDao.getHttpUrlList(entity); - List httpReqHdrList = commonPolicyDao.getHttpReqHdrList(entity); - List httpResHdrList = commonPolicyDao.getHttpResHdrList(entity); - List ipPortCfgList = commonPolicyDao.getIpPortList(entity); - entity.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION); - List httpReqBodyList = commonPolicyDao.getHttpReqBodyList(entity); - entity.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION); - List httpResBodyList = commonPolicyDao.getHttpResBodyList(entity); - List subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); - dataMap.put("NTC_UNIVERSAL_IP", ipPortCfgList); - dataMap.put("NTC_CACHE_URL", httpUrlList); - dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList); - dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList); - dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList); - dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList); - dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList); + CfgIndexInfo entity = commonPolicyDao.getPolicyById(cfgId); + entity.setCfgType("PXY_CACHE_HTTP_URL"); + List urlList = commonPolicyDao.getCommonStringList(entity); + entity.setCfgType("PXY_CACHE_HTTP_COOKIE"); + List cookieList = commonPolicyDao.getCommonStringList(entity); + dataMap.put("PXY_CACHE_HTTP_URL", urlList); + dataMap.put("PXY_CACHE_HTTP_COOKIE", cookieList); return dataMap; - }*/ + } public Page getCachePolicyList(Page page, CfgIndexInfo entity){ // 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL) diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp index 1a7f477be..79821e40f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp @@ -180,19 +180,18 @@ -<%-- --%> - - -<%-- --%> - - - -<%--
  • --%> -<%--
  • --%> - - +
    + + +
    From c05cc92f3b9f00d6bbbd8390482ec887a229734e Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Mon, 24 Dec 2018 19:16:14 +0800 Subject: [PATCH 051/147] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA-=E5=94=90=E6=B5=A9=20?= =?UTF-8?q?=E6=B4=BB=E8=B7=83ip=E5=AF=BC=E5=87=BA=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficAppTypeList.jsp | 6 +- .../dashboard/trafficHttpStatisticList.jsp | 6 +- .../views/dashboard/trafficIpActiveList.jsp | 79 +++++++++++++++++-- .../dashboard/trafficProtocolTypeList.jsp | 6 +- .../views/dashboard/trafficWebTypeList.jsp | 6 +- .../plugins/highcharts/js/standalone.js | 1 + 6 files changed, 84 insertions(+), 20 deletions(-) create mode 100644 src/main/webapp/static/global/plugins/highcharts/js/standalone.js diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index a62a0db11..8a31d921b 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -81,7 +81,7 @@
    -
    -->
    -
    +
    - +
    @@ -61,7 +62,7 @@
    -
    +
    +
    +
    + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp new file mode 100644 index 000000000..9bb17bae4 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp @@ -0,0 +1,200 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + <spring:message code="https_url_report"/> + + + + + +
    + +

    + +

    + +
    +
    +
    +
    + + + + + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + +
    +
    +
    + + +
    + href="javascript:;"> + + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + + + + + <%-- --%> + <%-- + --%> + <%-- + + + --%> + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + <%-- --%> + + + + +
    ${log.taskId }${log.taskName }${log.letterNum }${log.configNum }${log.monitorNum }${log.controlNum }${log.taskTime }${log.reportTime }${log.reportTime}
    +
    ${page}
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp new file mode 100644 index 000000000..e450c7cc8 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp @@ -0,0 +1,202 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + <spring:message code="https_url_report"/> + + + + + +
    + +

    + +

    + +
    +
    +
    +
    + + + + + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + +
    +
    +
    + + +
    + href="javascript:;"> + + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + +
    +
    + +
    + + + + + <%-- --%> + <%-- + --%> + <%-- + + + --%> + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + <%-- --%> + + + + +
    ${log.taskId }${log.taskName }${log.ipNum }${log.httpNum }${log.mailNum }${log.vedioNum }${log.agentNum }${log.taskTime }${log.reportTime }${log.reportTime}
    +
    ${page}
    +
    +
    +
    +
    +
    + + \ No newline at end of file From dea671d2a534e13beb9b71a753084ca591eaf78e Mon Sep 17 00:00:00 2001 From: lihaochen Date: Tue, 25 Dec 2018 18:49:29 +0800 Subject: [PATCH 064/147] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/Constants.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index d128ee70b..9713094ba 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -792,4 +792,11 @@ public final class Constants { */ public static final int MAX_LOG_EXPORT_SIZE = Configurations.getIntProperty("maxLogExportSize", 100000); + + /** + * 监测事件,封堵事件,重点保障事件查询接口URL + */ + public static final String NTC_EVENT_MONITOR_OR_BLOCK_Report =Configurations.getStringProperty("ntcEventsMonitorOrBlockReport",""); + + public static final String NTC_EVENT_KEYPROTECTION_Report =Configurations.getStringProperty("ntcEventKeyProtectionReport",""); } From bb9aa4d098553140ef00d660de645a3eb76255dc Mon Sep 17 00:00:00 2001 From: leijun Date: Tue, 25 Dec 2018 18:56:46 +0800 Subject: [PATCH 065/147] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=8A=A5=E8=A1=A8=20=E4=B8=89=E7=BA=A7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/20181225/add_sys_menu.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/main/resources/sql/20181225/add_sys_menu.sql diff --git a/src/main/resources/sql/20181225/add_sys_menu.sql b/src/main/resources/sql/20181225/add_sys_menu.sql new file mode 100644 index 000000000..955718da2 --- /dev/null +++ b/src/main/resources/sql/20181225/add_sys_menu.sql @@ -0,0 +1,5 @@ +#ʵʱ +INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1200', '780', '0,1,780,', 'event_report', '¼', '5030', '', '', '', '1', '', '1', '2018-12-25 17:28:17', '1', '2018-12-25 17:28:17', '', '1', NULL, '0', '0', NULL); +INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1199', '1200', '0,1,780,1200,', 'ntc_event_key_protection_report', 'ص㱣¼', '5030', '/eventKeyProtection/eventKeyProtectionList', '', '', '1', '', '1', '2018-12-25 14:13:08', '1', '2018-12-25 17:31:02', '', '1', NULL, '0', '0', NULL); +INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1198', '1200', '0,1,780,1200,', 'ntc_event_block_report', '¼±', '5030', '/eventBlock/eventBlockList', '', '', '1', '', '1', '2018-12-25 14:10:15', '1', '2018-12-25 17:30:35', '', '1', NULL, '0', '0', NULL); +INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1197', '1200', '0,1,780,1200,', 'ntc_event_monitor_report', '¼ⱨ', '5030', '/eventMonitor/eventMonitorList', '', '', '1', '', '1', '2018-12-25 14:06:15', '1', '2018-12-25 17:29:57', '', '1', NULL, '0', '0', NULL); From 430708b63fb9427f197e35ece77102e709507c86 Mon Sep 17 00:00:00 2001 From: lihaochen Date: Wed, 26 Dec 2018 09:53:16 +0800 Subject: [PATCH 066/147] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=8A=A5=E8=A1=A8=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E8=AE=BF=E9=97=AE=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/Constants.java | 4 +- src/main/resources/nis.properties | 240 +++++++++++----------- 2 files changed, 122 insertions(+), 122 deletions(-) diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 9713094ba..a473f80ba 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -796,7 +796,7 @@ public final class Constants { /** * 监测事件,封堵事件,重点保障事件查询接口URL */ - public static final String NTC_EVENT_MONITOR_OR_BLOCK_Report =Configurations.getStringProperty("ntcEventsMonitorOrBlockReport",""); + public static final String NTC_EVENT_MONITOR_OR_BLOCK_Report =Configurations.getStringProperty("ntcEventsMonitorOrBlock",""); - public static final String NTC_EVENT_KEYPROTECTION_Report =Configurations.getStringProperty("ntcEventKeyProtectionReport",""); + public static final String NTC_EVENT_KEYPROTECTION_Report =Configurations.getStringProperty("ntcEventKeyProtection",""); } diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 2f6f8330f..526c280c6 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -1,49 +1,49 @@ -#\u7BA1\u7406\u57FA\u7840\u8DEF\u5F84, \u9700\u540C\u6B65\u4FEE\u6539\uFF1Aweb.xml +#\u7ba1\u7406\u57fa\u7840\u8def\u5f84, \u9700\u540c\u6b65\u4fee\u6539\uff1aweb.xml adminPath=/nis -#Restful\u670D\u52A1\u9ED8\u8BA4\u8DEF\u5F84\uFFFD +#Restful\u670d\u52a1\u9ed8\u8ba4\u8def\u5f84\ufffd servicePath=/service -#\u5206\u9875\u914D\u7F6E +#\u5206\u9875\u914d\u7f6e page.pageSize=20 -#\u5206\u9875\u914D\u7F6E +#\u5206\u9875\u914d\u7f6e page.count=0 -#\u7D22\u5F15\u9875\u8DEF\u5F84 +#\u7d22\u5f15\u9875\u8def\u5f84 web.view.index=/nis/index -#\u7F13\u5B58\u8BBE\u7F6E +#\u7f13\u5b58\u8bbe\u7f6e ehcache.configFile=cache/ehcache-local.xml #ehcache.configFile=cache/ehcache-rmi.xml -#\u4F1A\u8BDD\u8D85\u65F6\uFF0C \u5355\u4F4D\uFF1A\u6BEB\u79D2\uFF0C 20m=1200000ms, 30m=1800000ms, 60m=3600000ms +#\u4f1a\u8bdd\u8d85\u65f6\uff0c \u5355\u4f4d\uff1a\u6beb\u79d2\uff0c 20m=1200000ms, 30m=1800000ms, 60m=3600000ms session.sessionTimeout=1800000 -#\u4F1A\u8BDD\u6E05\u7406\u95F4\u9694\u65F6\u95F4\uFF0C \u5355\u4F4D\uFF1A\u6BEB\u79D2\uFF0C2m=120000ms\u3002 +#\u4f1a\u8bdd\u6e05\u7406\u95f4\u9694\u65f6\u95f4\uff0c \u5355\u4f4d\uff1a\u6beb\u79d2\uff0c2m=120000ms\u3002 session.sessionTimeoutClean=120000 -#\u9759\u6001\u6587\u4EF6\u540E\u7F00 +#\u9759\u6001\u6587\u4ef6\u540e\u7f00 web.staticFile=.css,.js,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.htm,.html,.crx,.xpi,.exe,.ipa,.apk -#\u7F51\u7AD9URL\u540E\u7F00 +#\u7f51\u7ad9URL\u540e\u7f00 urlSuffix=.jsp -#\u89C6\u56FE\u6587\u4EF6\u5B58\u653E\u8DEF\u5F84 +#\u89c6\u56fe\u6587\u4ef6\u5b58\u653e\u8def\u5f84 web.view.prefix=/WEB-INF/views/ web.view.suffix=.jsp -#\u662F\u5426\u4E0D\u5141\u8BB8\u5237\u65B0\u4E3B\u9875\uFF0C\u4E0D\u5141\u8BB8\u60C5\u51B5\u4E0B\uFF0C\u5237\u65B0\u4E3B\u9875\u4F1A\u5BFC\u81F4\u91CD\u65B0\u767B\u5F55 +#\u662f\u5426\u4e0d\u5141\u8bb8\u5237\u65b0\u4e3b\u9875\uff0c\u4e0d\u5141\u8bb8\u60c5\u51b5\u4e0b\uff0c\u5237\u65b0\u4e3b\u9875\u4f1a\u5bfc\u81f4\u91cd\u65b0\u767b\u5f55 notAllowRefreshIndex=false -#\u524D\u7AEF\u57FA\u7840\u8DEF\u5F84 +#\u524d\u7aef\u57fa\u7840\u8def\u5f84 frontPath=/f -#\u662F\u5426\u8FD0\u884C\u591A\u8D26\u6237\u540C\u65F6\u767B\u5F55? +#\u662f\u5426\u8fd0\u884c\u591a\u8d26\u6237\u540c\u65f6\u767b\u5f55? user.multiAccountLogin=true -#\u7855\u6B63\u7EC4\u4EF6\u662F\u5426\u4F7F\u7528\u7F13\u5B58 +#\u7855\u6b63\u7ec4\u4ef6\u662f\u5426\u4f7f\u7528\u7f13\u5b58 supcan.useCache=false -#\u901A\u77E5\u95F4\u9694\u65F6\u95F4\u8BBE\u7F6E, \u5355\u4F4D\uFF1A\u6BEB\u79D2, 30s=30000ms, 60s=60000ms +#\u901a\u77e5\u95f4\u9694\u65f6\u95f4\u8bbe\u7f6e, \u5355\u4f4d\uff1a\u6beb\u79d2, 30s=30000ms, 60s=60000ms work.notify.remind.interval=60000 @@ -51,13 +51,13 @@ work.notify.remind.interval=60000 #===== System settings ======# #============================# -#\u4EA7\u54C1\u4FE1\u606F\u8BBE\u7F6E +#\u4ea7\u54c1\u4fe1\u606f\u8bbe\u7f6e productName=National Traffic Control System copyrightYear=2015 version=V1.0.0 -#\u4E0A\u4F20\u6587\u4EF6\u7EDD\u5BF9\u8DEF\u5F84, \u8DEF\u5F84\u4E2D\u4E0D\u5141\u8BB8\u5305\u542B\u201Cuserfiles\u201D +#\u4e0a\u4f20\u6587\u4ef6\u7edd\u5bf9\u8def\u5f84, \u8def\u5f84\u4e2d\u4e0d\u5141\u8bb8\u5305\u542b\u201cuserfiles\u201d userfiles.basedir=upload @@ -65,7 +65,7 @@ userfiles.basedir=upload #===== webservice settings ======# #============================# -#ESB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u1E69\uFFFD\uFFFD\u0373\u04BB\uFFFD\uFFFD\u05B7 +#ESB\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u1e69\ufffd\ufffd\u0373\u04bb\ufffd\ufffd\u05b7 webservice.esb.endpoint=http://10.55.0.197:7879/TongServiceProxy_doprocess/services/WebService1/ #webservice RID webservice.rid=XFBL @@ -88,47 +88,47 @@ webservice.data.dict.code.sid=s_2042_0660BD17-35E4-4482-AA3A-556F2C024902 #webservice request timeout for seconds webservice.request.timeout=30 -#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDURL +#\ufffd\ufffd\ufffd\ufffd\ufffdURL webservice.jg.service.url=http://10.55.0.155:8080/jgService -#\uFFFD\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDURL +#\ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffdURL webservice.yh.service.url=http://10.55.0.155:8080/ryService -#\uFFFD\uFFFD\uFFFD\uFFFD\u05B5\uFFFDURL +#\ufffd\ufffd\ufffd\ufffd\u05b5\ufffdURL webservice.data.dict.service.url=http://10.55.0.155:8080/sjzdService -#\uFFFD\uFFFD\uFFFD\uFFFD\u05B5\uFFFD\uFFFD\uFFFD\uFFFDURL +#\ufffd\ufffd\ufffd\ufffd\u05b5\ufffd\ufffd\ufffd\ufffdURL webservice.data.dict.bm.url=http://10.55.0.155:8080/sjzdbmService -#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDURL +#\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdURL webservice.data.code.url=http://10.55.0.155:8080/sjmbService -#webservice\uFFFD\u04FF\uFFFD\uFFFD\uFFFD\uFFFD\u00FF\u04B3\uFFFD\uFFFD\uFFFD\uFFFD +#webservice\ufffd\u04ff\ufffd\ufffd\ufffd\ufffd\u00ff\u04b3\ufffd\ufffd\ufffd\ufffd webservice.data.pagesize = 2000 -#webservice\uFFFD\uFFFD\u01F0\u012C\uFFFD\uFFFD\u04B3 +#webservice\ufffd\ufffd\u01f0\u012c\ufffd\ufffd\u04b3 webservice.data.currentpage = 1 -#webservice \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD +#webservice \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd webservice.jgmb.name=CK_T_JC_RY -#webservice \uFFFD\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD +#webservice \ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd webservice.yhmb.name=CK_T_YH_RY -#webservice\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD \u022B\uFFFD\uFFFD +#webservice\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \u022b\ufffd\ufffd webservice.method.name.ql=getData -# webservice\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD \uFFFD\uFFFD\uFFFD\uFFFD +# webservice\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd webservice.method.name.zl=getDataZL -# redis\u914D\u7F6E\u6587\u4EF6 -#redis \u5404\u4E2A\u5206\u7247\u7684 IP\u7AEF\u53E3 +# redis\u914d\u7f6e\u6587\u4ef6 +#redis \u5404\u4e2a\u5206\u7247\u7684 IP\u7aef\u53e3 redis.cluster.host_port=10.0.6.32:6379,10.0.6.32:6380,10.0.6.32:6381,10.0.6.33:6379,10.0.6.33:6380,10.0.6.33:6381 -#\u4E2D\u5FC3\u73B0\u573Aredis\u5730\u5740\u548C\u7AEF\u53E3 +#\u4e2d\u5fc3\u73b0\u573aredis\u5730\u5740\u548c\u7aef\u53e3 #redis.cluster.host_port=10.174.196.33:6379,10.174.196.33:6380,10.174.196.33:6381,10.174.196.34:6379,10.174.196.34:6380,10.174.196.34:6381,10.174.196.35:6379,10.174.196.35:6380,10.174.196.35:6381,10.174.196.36:6379,10.174.196.36:6380,10.174.196.36:6381,10.174.196.37:6379,10.174.196.37:6380,10.174.196.37:6381,10.174.196.38:6379,10.174.196.38:6380,10.174.196.38:6381,10.174.196.39:6379,10.174.196.39:6380,10.174.196.39:6381 redis.cluster.connectiontimeout=5000 redis.cluster.sotimeout=5000 redis.cluster.maxattempts=3 -#redis\u8FDE\u63A5\u6C60\u76F8\u5173\u914D\u7F6E +#redis\u8fde\u63a5\u6c60\u76f8\u5173\u914d\u7f6e redis.pool.maxtotal=500 @@ -141,31 +141,31 @@ redis.pool.testonreturn=false redis.pool.testwhileidle=true redis.pool.timebetweenevictionrunsmillis=60000 redis.pool.minevictableidletimemillis=60000 -#oracle\u6570\u636Eredis\u5B58\u50A8\u65F6\u95F4(\u79D2\u4E3A\u5355\u4F4D \u9ED8\u8BA43\u5206\u949F\u5373180s) +#oracle\u6570\u636eredis\u5b58\u50a8\u65f6\u95f4(\u79d2\u4e3a\u5355\u4f4d \u9ed8\u8ba43\u5206\u949f\u5373180s) oracleExpire=180 -#hive\u6570\u636E\u4E2D\u5FC3\u6570\u636Eredis\u5B58\u50A8\u65F6\u95F4(\u79D2\u4E3A\u5355\u4F4D \u9ED8\u8BA420\u5206\u949F\u53731200s) +#hive\u6570\u636e\u4e2d\u5fc3\u6570\u636eredis\u5b58\u50a8\u65f6\u95f4(\u79d2\u4e3a\u5355\u4f4d \u9ed8\u8ba420\u5206\u949f\u53731200s) hiveExpire=300 -#redis\u5F00\u5173 +#redis\u5f00\u5173 isOpenRedis=false -#\u662F\u5426\u5C06\u6570\u636E\u4E2D\u5FC3\u7684\u65E5\u5FD7\u52A0\u5165\u5230redis\u4E2D +#\u662f\u5426\u5c06\u6570\u636e\u4e2d\u5fc3\u7684\u65e5\u5fd7\u52a0\u5165\u5230redis\u4e2d dataCenterOpenRedis=true -#\u8DE8\u57DF\u95EE\u9898\u5141\u8BB8 \u7684url Access-Control-Allow-Origin *\u5141\u8BB8\u6240\u6709\uFF0C\u8BBE\u7F6E\u6210\u5176\u4ED6url\u53EA\u5141\u8BB8\u8BE5url.\u4E0D\u80FD\u8BBE\u7F6E\u591A\u4E2Aurl +#\u8de8\u57df\u95ee\u9898\u5141\u8bb8 \u7684url Access-Control-Allow-Origin *\u5141\u8bb8\u6240\u6709\uff0c\u8bbe\u7f6e\u6210\u5176\u4ed6url\u53ea\u5141\u8bb8\u8be5url.\u4e0d\u80fd\u8bbe\u7f6e\u591a\u4e2aurl target_url=* -#\u8DE8\u57DF\u95EE\u9898 3600\uFF1A\u8868\u660E\u57283600\u79D2\u5185\uFF0C\u4E0D\u9700\u8981\u518D\u53D1\u9001\u9884\u8BF7\u6C42\uFF0C\u53EF\u4EE5\u7F13\u5B58\u8BE5\u7ED3\u679C +#\u8de8\u57df\u95ee\u9898 3600\uff1a\u8868\u660e\u57283600\u79d2\u5185\uff0c\u4e0d\u9700\u8981\u518d\u53d1\u9001\u9884\u8bf7\u6c42\uff0c\u53ef\u4ee5\u7f13\u5b58\u8be5\u7ed3\u679c ACCESS_CONTROL_MAX_AGE=3600 ##########HTTPCLIENT POOL START################### -#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u5230\u8FDE\u63A5\u7684\u6700\u957F\u65F6\u95F4 +#\u4ece\u8fde\u63a5\u6c60\u4e2d\u83b7\u53d6\u5230\u8fde\u63a5\u7684\u6700\u957f\u65f6\u95f4 http.request.connectionRequestTimeout=500 #5000 http.request.connectTimeout=5000 -#\u6570\u636E\u4F20\u8F93\u7684\u6700\u957F\u65F6\u95F4 +#\u6570\u636e\u4f20\u8f93\u7684\u6700\u957f\u65f6\u95f4 http.request.socketTimeout=30000 -#\u63D0\u4EA4\u8BF7\u6C42\u524D\u6D4B\u8BD5\u8FDE\u63A5\u662F\u5426\u53EF\u7528 +#\u63d0\u4ea4\u8bf7\u6c42\u524d\u6d4b\u8bd5\u8fde\u63a5\u662f\u5426\u53ef\u7528 http.request.staleConnectionCheckEnabled=true -#\u8BBE\u7F6E\u8FDE\u63A5\u603B\u6570 +#\u8bbe\u7f6e\u8fde\u63a5\u603b\u6570 http.pool.maxTotal=200 -#\u8BBE\u7F6E\u6BCF\u4E2A\u5730\u5740\u7684\u5E76\u53D1\u6570 +#\u8bbe\u7f6e\u6bcf\u4e2a\u5730\u5740\u7684\u5e76\u53d1\u6570 http.pool.defaultMaxPerRoute=100 ##########HTTPCLIENT POOL END################### search.dateformat=yyyy-MM-dd HH:mm:ss @@ -176,45 +176,45 @@ search.eshostandport_C=10.0.6.115:9200 #search.eshostandport=10.174.196.135:9200 -#\u65E5\u5FD7\u662F\u5426\u4ECEhive\u4E2D\u67E5\u8BE2 +#\u65e5\u5fd7\u662f\u5426\u4ecehive\u4e2d\u67e5\u8be2 selFromHive=false -#\u662F\u5426\u83B7\u53D6\u6570\u636E\u4E2D\u5FC3\u67E5\u8BE2\u8BB0\u5F55\u7684\u603B\u6761\u6570 +#\u662f\u5426\u83b7\u53d6\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2\u8bb0\u5f55\u7684\u603b\u6761\u6570 isGetHiveCount=false -#\u6BCF\u6B21\u83B7\u53D6\u6570\u636E\u4E2D\u5FC3\u591A\u5C11\u6761\u6570\u636E,\u54B1\u4EEC\u5728\u5BF9\u83B7\u53D6\u7684\u6570\u636E\u8FDB\u884C\u5206\u9875\u5904\u7406 +#\u6bcf\u6b21\u83b7\u53d6\u6570\u636e\u4e2d\u5fc3\u591a\u5c11\u6761\u6570\u636e,\u54b1\u4eec\u5728\u5bf9\u83b7\u53d6\u7684\u6570\u636e\u8fdb\u884c\u5206\u9875\u5904\u7406 everyGetHiveDataNum=10000 -#oracle\u6570\u636E\u5E93\u6709\u95EE\u9898\u4E0D\u4ECEoracle\u67E5\u8BE2\u6570\u636E,\u6240\u6709\u65E5\u5FD7\u6570\u636E\u5747\u4ECE\u6570\u636E\u4E2D\u5FC3\u67E5\u8BE2 +#oracle\u6570\u636e\u5e93\u6709\u95ee\u9898\u4e0d\u4eceoracle\u67e5\u8be2\u6570\u636e,\u6240\u6709\u65e5\u5fd7\u6570\u636e\u5747\u4ece\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2 onlySelFromHive=false -#\u662F\u5426\u67E5\u8BE2\u795E\u901A\u6570\u636E\u5E93 +#\u662f\u5426\u67e5\u8be2\u795e\u901a\u6570\u636e\u5e93 isSelectCluster=true -#\u7528\u6237\u67E5\u8BE2\u65E5\u5FD7\u8D85\u8FC7\u591A\u5C11\u5C0F\u65F6\u53BB\u6570\u636E\u4E2D\u5FC3\u67E5\u8BE2 +#\u7528\u6237\u67e5\u8be2\u65e5\u5fd7\u8d85\u8fc7\u591a\u5c11\u5c0f\u65f6\u53bb\u6570\u636e\u4e2d\u5fc3\u67e5\u8be2 dataCenterTime=48 -#\u662F\u5426\u5F00\u542F\u57FA\u7840\u9A8C\u8BC1 +#\u662f\u5426\u5f00\u542f\u57fa\u7840\u9a8c\u8bc1 baseValidate=true -#\u662F\u5426\u5F00\u542F\u4E1A\u52A1\u9A8C\u8BC1 +#\u662f\u5426\u5f00\u542f\u4e1a\u52a1\u9a8c\u8bc1 serviceValidate=true -#\u65E5\u5FD7\u5B58\u50A8\u672C\u5730\u65F6\u95F4(\u5355\u4F4D\u5C0F\u65F6) +#\u65e5\u5fd7\u5b58\u50a8\u672c\u5730\u65f6\u95f4(\u5355\u4f4d\u5c0f\u65f6) logLocalTime=48 -#\u5B9E\u65F6\u7EDF\u8BA1\u9ED8\u8BA4\u67E5\u8BE2\u672C\u5730\u4E00\u4E2A\u5C0F\u65F6\u7684\u6570\u636E(\u5355\u4F4D\uFF1A\u5C0F\u65F6) +#\u5b9e\u65f6\u7edf\u8ba1\u9ed8\u8ba4\u67e5\u8be2\u672c\u5730\u4e00\u4e2a\u5c0f\u65f6\u7684\u6570\u636e(\u5355\u4f4d\uff1a\u5c0f\u65f6) reportLocalTime=1 -#\u795E\u901A\u6570\u636E\u5E93\u6700\u65E9\u65E5\u5FD7\u65F6\u95F4(A\u7248\u6BEB\u79D2) +#\u795e\u901a\u6570\u636e\u5e93\u6700\u65e9\u65e5\u5fd7\u65f6\u95f4(A\u7248\u6beb\u79d2) #2017-08-13 10:07:25 clusterAStartTime=1503504000725 -#\u795E\u901A\u6570\u636E\u5E93\u6700\u65E9\u7ED3\u675F\u65F6\u95F4(B\u7248\u6BEB\u79D2) +#\u795e\u901a\u6570\u636e\u5e93\u6700\u65e9\u7ed3\u675f\u65f6\u95f4(B\u7248\u6beb\u79d2) #2017-08-13 10:07:25 clusterBStartTime=1503504000725 ############################################################################################################################################ -#\u8BBE\u7F6E\u914D\u7F6E\u662F\u5426\u5165\u5E93 +#\u8bbe\u7f6e\u914d\u7f6e\u662f\u5426\u5165\u5e93 ############################################################################################################################################ isCommit=true ############################################################################################################################################ @@ -272,7 +272,7 @@ trafficAreaStat=trafficAreaStat logServiceTopn=logServiceTopn blockAndDropStat=blockAndDropStat ######################################## -#\u5927\u5C4F\u56FE\u8868\u5C55\u793A\u670D\u52A1\u63A5\u53E3 +#\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3 dashboardUrl=http://192.168.10.204:9999/galaxy-service/service/log/v1/ trafficIpActive=trafficIpActive trafficProtocol=trafficProtocol @@ -296,28 +296,28 @@ logsearch_menu_id=152 #use elasticsearch or not# isUseES=false -#httpclient \u5DE5\u5177\u8BBE\u7F6E\u8D85\u65F6\u65F6\u95F4 +#httpclient \u5de5\u5177\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4 http_socket_timeout=300000 http_connect_timeout=10000 http_connect_request_timeout=50000 http_connect_retry_times=3 -#\u6570\u636E\u4E2D\u5FC3A\u7248\u6570\u636E\u5E93\u540D\u79F0,\u7A0B\u5E8F\u4E2D\u6BCF\u6B21\u67E5\u8BE2\u65F6\u4F7F\u7528\u7684\u6570\u636E\u5E93\u540D\u79F0 use dbA +#\u6570\u636e\u4e2d\u5fc3A\u7248\u6570\u636e\u5e93\u540d\u79f0,\u7a0b\u5e8f\u4e2d\u6bcf\u6b21\u67e5\u8be2\u65f6\u4f7f\u7528\u7684\u6570\u636e\u5e93\u540d\u79f0 use dbA jdbc.hive.AName=xa_dfbhit_hive -#\u6570\u636E\u4E2D\u5FC3B\u7248\u6570\u636E\u5E93\u540D\u79F0 +#\u6570\u636e\u4e2d\u5fc3B\u7248\u6570\u636e\u5e93\u540d\u79f0 jdbc.hive.BName=xa_z2_mesalog_hive maxPageSize=100000 -#\u5BFC\u51FA\u6700\u5927\u6761\u6570 +#\u5bfc\u51fa\u6700\u5927\u6761\u6570 maxExportSize=5000 -#\u5141\u8BB8\u914D\u7F6E\u6700\u5927\u5C42\u7EA7 +#\u5141\u8bb8\u914d\u7f6e\u6700\u5927\u5c42\u7ea7 maxLevelNo=4 -#\u4E0A\u4E0B\u7EA7\u663E\u793A\u95F4\u9694\u6807\u8BC6\u7B26 +#\u4e0a\u4e0b\u7ea7\u663e\u793a\u95f4\u9694\u6807\u8bc6\u7b26 childrenMark=. -#\u4E1A\u52A1\u5B57\u5178\u5728\u8BCD\u5178\u4E2D\u7684\u6807\u8BC6 +#\u4e1a\u52a1\u5b57\u5178\u5728\u8bcd\u5178\u4e2d\u7684\u6807\u8bc6 SERVICE_DICT_ITM_TYPE=SERVICE_DICT_ITM_TYPE -#\u7CFB\u7EDF\u5B57\u5178\u5728\u8BCD\u5178\u4E2D\u7684\u6807\u8BC6 +#\u7cfb\u7edf\u5b57\u5178\u5728\u8bcd\u5178\u4e2d\u7684\u6807\u8bc6 SYS_DICT_ITM_TYPE=SYS_DICT_ITM_TYPE area_region=NTC_IP_RANGE protocol_num_region=NTC_UNIVERSAL_PROTO_TYPE @@ -345,16 +345,16 @@ ssl_ip_region=ssl_ip bgp_ip_region=bgp_ip behav_id_region=BEHAV_ID rate_limit_region=Droprate -#\u5B58\u5728\u4E0E\u8868\u8FBE\u5F0F\u7684\u5173\u952E\u5B57\u7279\u6B8A\u5206\u9694\u7B26 +#\u5b58\u5728\u4e0e\u8868\u8fbe\u5f0f\u7684\u5173\u952e\u5b57\u7279\u6b8a\u5206\u9694\u7b26 keyword_expr=***and*** -#\u65F6\u533A +#\u65f6\u533a time_zone=8 -#\u9700\u8981\u7279\u6B8A\u5904\u7406\u7684\u4E1A\u52A1\u7C7B\u578B +#\u9700\u8981\u7279\u6b8a\u5904\u7406\u7684\u4e1a\u52a1\u7c7b\u578b service_pxy_domain_intercept=513 service_ip_mulitiplex=768 service_ip_ratelimit=1057 service_domain_ratelimit=1058 -#\u7528\u6237\u81EA\u5B9A\u4E49\u57DF +#\u7528\u6237\u81ea\u5b9a\u4e49\u57df userregion_rate_limit=Droprate userregion_ir_strategy=IR_STRATEGY userregion_ir_type=IR_TYPE @@ -364,25 +364,25 @@ userregion_replace_type_key=zone userregion_replace_req_key_value=http_req_body userregion_replace_res_key_value=http_res_body userregion_replace_regex_key=regex -#\u7528\u6237\u81EA\u5B9A\u4E49\u57DF\u5360\u4F4D\u7B26 +#\u7528\u6237\u81ea\u5b9a\u4e49\u57df\u5360\u4f4d\u7b26 user_region_placeholder=0 -#\u7528\u6237\u81EA\u5B9A\u4E49\u57DF\u5206\u9694\u7B26 +#\u7528\u6237\u81ea\u5b9a\u4e49\u57df\u5206\u9694\u7b26 user_region_split=; -#IP\u76F8\u5173\u9A8C\u8BC1\u6B63\u5219 +#IP\u76f8\u5173\u9a8c\u8bc1\u6b63\u5219 ipv4_ip_subnet_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)/(3[0-2]|1[6-9]|2[0-9])$ ipv6_ip_subnet_regexp=^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))/([2-9]|[1-9][0-9]|1[0-2][0-8])$ ipv4_ip_range_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)-(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$ ipv6_ip_range_regexp=^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))-((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))$ ipv4_ip_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$ ipv6_ip_regexp=^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))$ -#\u91CD\u5B9A\u5411\u4E1A\u52A1\u81EA\u5B9A\u4E49\u57DF\u76F8\u5173\u53C2\u6570 +#\u91cd\u5b9a\u5411\u4e1a\u52a1\u81ea\u5b9a\u4e49\u57df\u76f8\u5173\u53c2\u6570 redirect_response_code_key=code redirect_url_key=url redirect_content_key=content redirect_response_code_startwith=30 replace_zone_key=zone replace_substitute_key=substitute -#\u6837\u4F8B\u6587\u4EF6\u4E0A\u4F20\u7684uri\u5173\u952E\u8BCD +#\u6837\u4f8b\u6587\u4ef6\u4e0a\u4f20\u7684uri\u5173\u952e\u8bcd sample_upload_url_keyword=/av digest_upload_url_keyword=/filetransfer cert_upload_url_keyword=/intercept/strateagy @@ -391,53 +391,53 @@ cert_upload_url_keyword=/intercept/strateagy sample_total_file_max_size=12582912 #audio File Types audio_file_type=,mp4,flv,asf,wmv,avi,mpeg,mov,dat,m4v,m4p,m4b,webm,wav,mp3, -#audio File Size 10M 10485760\uFF08single\uFF09 +#audio File Size 10M 10485760\uff08single\uff09 audio_single_file_max_size=0 -#speaker File Types \u8BF4\u8BDD\u4EBA\u8BC6\u522B\u6587\u4EF6\u7C7B\u578B +#speaker File Types \u8bf4\u8bdd\u4eba\u8bc6\u522b\u6587\u4ef6\u7c7b\u578b speaker_file_type= -#audio File Size 10M 10485760\uFF08single\uFF09 +#audio File Size 10M 10485760\uff08single\uff09 speaker_single_file_max_size=0 #video File Types video_file_type=,mp4,flv,asf,wmv,avi,mpeg,mov,dat,m4v,m4p,m4b,webm,ogv, -#video File Size 10M 10485760\uFF08single\uFF09 +#video File Size 10M 10485760\uff08single\uff09 video_single_file_max_size=0 -#face File Types \u4EBA\u8138\u8BC6\u522B +#face File Types \u4eba\u8138\u8bc6\u522b face_file_type= -#face File Size 10M 10485760\uFF08single\uFF09 +#face File Size 10M 10485760\uff08single\uff09 face_single_file_max_size=0 #picture File Types picture_file_type= -#picture File Size 10M 10485760\uFF08single\uFF09 +#picture File Size 10M 10485760\uff08single\uff09 picture_single_file_max_size=10485760 -#logo File Types \u53F0\u6807\u8BC6\u522B +#logo File Types \u53f0\u6807\u8bc6\u522b logo_file_type= -#logo File Size 10M 10485760\uFF08single\uFF09 +#logo File Size 10M 10485760\uff08single\uff09 logo_single_file_max_size=10485760 #voip File Types voip_file_type=,mp4,flv,asf,wmv,avi,mpeg,mov,dat,m4v,m4p,m4b,webm,ogv,wav,mp3, -#voip File Size 10M 10485760\uFF08single\uFF09 +#voip File Size 10M 10485760\uff08single\uff09 voip_single_file_max_size=0 #digest File Types digest_file_type= -#digest File Size 10M 10485760\uFF08single\uFF09 +#digest File Size 10M 10485760\uff08single\uff09 digest_single_file_max_size=10485760 -#digest File Size 12M 12582912\uFF08total\uFF09 +#digest File Size 12M 12582912\uff08total\uff09 digest_total_file_max_size=12582912 -#cert File Size 12M 12582912\uFF08total\uFF09 +#cert File Size 12M 12582912\uff08total\uff09 cert_total_file_max_size=12582912 #public File Types public_file_type= -#public File Size 10M 10485760\uFF08single\uFF09 +#public File Size 10M 10485760\uff08single\uff09 public_single_file_max_size=10485760 #private File Types private_file_type= -#private File Size 10M 10485760\uFF08single\uFF09 +#private File Size 10M 10485760\uff08single\uff09 private_single_file_max_size=10485760 -#YSP\u6587\u4EF6\u4FDD\u5B58\u8DEF\u5F84 +#YSP\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84 av_file_path=/home/ysp/ #av_file_path=D\:\\ysp\\ -#YSP\u6587\u4EF6\u7279\u5F81\u7C7B\u578B +#YSP\u6587\u4ef6\u7279\u5f81\u7c7b\u578b av_sample_audio_region=av_sample_audio av_sample_video_region=av_sample_video av_sample_picture_region=av_sample_picture @@ -446,7 +446,7 @@ mm_speaker_recognization_region=MM_SPEAKER_RECOGNIZATION mm_logo_detection_region=MM_LOGO_DETECTION mm_face_recognization_region=MM_FACE_RECOGNIZATION -#\u6837\u4F8B\u6587\u4EF6\u751F\u6210\u7A0B\u5E8F +#\u6837\u4f8b\u6587\u4ef6\u751f\u6210\u7a0b\u5e8f audio_sample_create_proc=/home/ceiec/av_feature_gen/audio_convert_proc video_sample_create_proc=/home/ceiec/av_feature_gen/extract_frame_feature picture_sample_create_proc=/home/ceiec/av_feature_gen/picture_convert_proc @@ -465,7 +465,7 @@ picture_sample_proc_param_is_translation=false speaker_sample_proc_param_is_translation=false logo_sample_proc_param_is_translation=false face_sample_proc_param_is_translation=false -#\u672C\u5730\u6D4B\u8BD5 +#\u672c\u5730\u6d4b\u8bd5 #audio_sample_create_proc=java -jar D\:\\sampleTest.jar #video_sample_create_proc=java -jar D\:\\sampleTest.jar #picture_sample_create_proc=java -jar D\:\\sampleTest.jar @@ -484,41 +484,41 @@ face_sample_proc_param_is_translation=false #speaker_sample_proc_param_is_translation=true #logo_sample_proc_param_is_translation=true #face_sample_proc_param_is_translation=true -#http\u81EA\u5B9A\u4E49\u57DF\u76F8\u5173\u53C2\u6570 +#http\u81ea\u5b9a\u4e49\u57df\u76f8\u5173\u53c2\u6570 http_header_user_region_key=HTTP_HEADER http_header_dict_module=HTTP_HEADER_DISTRICT -#dns\u81EA\u5B9A\u4E49\u57DF\u53C2\u6570key +#dns\u81ea\u5b9a\u4e49\u57df\u53c2\u6570key dns_strategy_user_region_key=DNS_STRATEGY -#p2p\u81EA\u5B9A\u4E49\u57DFkey +#p2p\u81ea\u5b9a\u4e49\u57dfkey p2p_ip_type_user_region_key=P2P_IP_TYPE p2p_hash_type_user_region_key=P2P_HASH_TYPE -#\u7279\u5B9A\u670D\u52A1\u7C7B\u522B +#\u7279\u5b9a\u670d\u52a1\u7c7b\u522b specific_service_cfg_type_app=social_app specific_service_cfg_type_encrypted_tunnel_behavior=encrypted_tunnel_behavior specific_service_cfg_type_basic_protocol=basic_protocol -#\u57FA\u7840\u534F\u8BAE\u81EA\u5B9A\u4E49\u57DF +#\u57fa\u7840\u534f\u8bae\u81ea\u5b9a\u4e49\u57df proto_id_region=PROTO_ID -#\u62E6\u622AIP\u81EA\u5B9A\u4E49\u57DFkey +#\u62e6\u622aIP\u81ea\u5b9a\u4e49\u57dfkey keyring_id=keyring_id droprate=Droprate bandwidth=Bandwidth intercept_domain_intensity=DOMAIN_INTENSITY -#IP\u9ED8\u8BA4\u503C +#IP\u9ed8\u8ba4\u503c ipv4_default_ip_value=0.0.0.0 ipv6_default_ip_value=\:\: ipv4_default_ip_subnet_value=0.0.0.0/16 ipv6_default_ip_subnet_value=::/128 ipv4_default_ip_range_value=0.0.0.0-1 ipv6_default_ip_range_value=::-:: -#\u7AEF\u53E3\u9ED8\u8BA4\u503C +#\u7aef\u53e3\u9ed8\u8ba4\u503c port_default=0 port_mask_default=0/65535 -#MAAT CFG \u4E00\u4E9B\u9ED8\u8BA4\u503C +#MAAT CFG \u4e00\u4e9b\u9ed8\u8ba4\u503c maat_cfg_dolog_default=2 maat_cfg_dolog_doblacklist_default=1 maat_cfg_dolog_configpercent_default=100 maat_cfg_dolog_configoption_default=1 -#app\uFF0C\u57FA\u7840\u534F\u8BAE\uFF0C\u7279\u5B9A\u670D\u52A1\u7684userregion\u5206\u9694\u7B26 +#app\uff0c\u57fa\u7840\u534f\u8bae\uff0c\u7279\u5b9a\u670d\u52a1\u7684userregion\u5206\u9694\u7b26 app_cfg_userregion_splitor=& app_id_region=APP_ID #application spec service code scope @@ -532,36 +532,36 @@ area_tag=location isp_tag=isp mmFileDigestLog=mmFileDigestLogs ntcStreamMediaLog=ntcStreamMediaLogs -#\u97F3\u89C6\u9891\u6837\u4F8B\u9650\u5236\u65F6\u957F\uFF0C\u5355\u4F4D\u79D2 +#\u97f3\u89c6\u9891\u6837\u4f8b\u9650\u5236\u65f6\u957f\uff0c\u5355\u4f4d\u79d2 av_duration_limit=120 video_to_picture_proc=/home/ceiec/av_feature_gen/save_video_frame -#\u8BC1\u4E66\u6587\u4EF6\u8DEF\u5F84 +#\u8bc1\u4e66\u6587\u4ef6\u8def\u5f84 cert_file_path=/home/cert/ -#\u8BC1\u4E66\u6821\u9A8C\u5DE5\u5177\u540D\u79F0 +#\u8bc1\u4e66\u6821\u9a8c\u5de5\u5177\u540d\u79f0 cert_validate_file=x509 -#\u8BC1\u4E66\u6821\u9A8C\u6210\u529F\u7684\u5173\u952E\u4FE1\u606F +#\u8bc1\u4e66\u6821\u9a8c\u6210\u529f\u7684\u5173\u952e\u4fe1\u606f cert_validate_success_info=Successful -#ipv4 range\u65B0\u683C\u5F0F0.0.0.1-2 +#ipv4 range\u65b0\u683c\u5f0f0.0.0.1-2 ipv4_ip_range_regexp_new=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)-(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$ ipv4_ip_subnet_regexp_original=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)/(3[0-2]|1[0-9]|2[0-9]|[0-9])$ -#\u57DF\u540D\u9A8C\u8BC1\u6B63\u5219 +#\u57df\u540d\u9a8c\u8bc1\u6b63\u5219 domain_regexp=^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$ -#IP\u590D\u7528maat json\u4E2D\u7684ip region\u5355\u6B21send \u6700\u5927\u4E2A\u6570 +#IP\u590d\u7528maat json\u4e2d\u7684ip region\u5355\u6b21send \u6700\u5927\u4e2a\u6570 maat_json_send_size=20000 -#\u5BFC\u5165\u9A8C\u8BC1\u7684\u7EBF\u7A0B\u6570\u91CF +#\u5bfc\u5165\u9a8c\u8bc1\u7684\u7ebf\u7a0b\u6570\u91cf mulity_thread_size=5 ntcRadiusReport=ntcRadiusReport ntcCollectVoipLog=ntcCollectVoipLogs ntcKeywordsUrlLog=ntcKeywordsUrlLogs save_and_del_thread_size=5 -#mysql \u5355\u4E2Asql\u5927\u5C0F\u9650\u5236,\u6839\u636Emariadb\u76F8\u5173\u53C2\u6570\u914D\u7F6E +#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 +#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 http_max_connection=1000 default_max_perroute=100 poolcm_socket_timeout=3000 app_vignore_user_region_key=VIGNORE -#policies\u83DC\u5355\u7684\u83DC\u5355ID +#policies\u83dc\u5355\u7684\u83dc\u5355ID policies_menu_id=86 userCreate=UserCreate userPasswordSet=UserPasswordSet @@ -571,7 +571,7 @@ userList=UserList ip_reuse_call_cgi_url=http://192.168.11.137:8090/command ipNumGet=IpNumGet allIpGet=AllIpGet -#\u6D41\u91CF\u7EDF\u8BA1\u5E26\u5BBD\u8BE6\u60C5 +#\u6d41\u91cf\u7edf\u8ba1\u5e26\u5bbd\u8be6\u60c5 trafficBandwidthTrans=trafficBandwidthTrans trafficProtocolList=trafficProtocolList irSnatLog=irSnatLogs @@ -591,7 +591,7 @@ trafficBandwidthTransFour=trafficBandwidthTransFour ntcCollectRadiusLog=ntcCollectRadiusLogs ntcConnRecordLog=ntcConnRecordLogs ntcConnRecordPercent=ntcConnRecordPercent -#\u5BFC\u51FA\u6700\u5927\u6761\u6570 +#\u5bfc\u51fa\u6700\u5927\u6761\u6570 maxLogExportSize=2000 pxy_crtl_subscribe_id_region=PXY_CTRL_SUBSCRIBE_ID ntc_subscribe_id_region=NTC_SUBSCRIBE_ID @@ -606,6 +606,6 @@ import_limit=10 trafficPortActiveFiveMinute=trafficPortActiveFiveMinute trendTotalReport=trendTotalReport #\u4e8b\u4ef6\u76d1\u6d4b/\u5c01\u5835 -ntcEventsMonitorOrBlockReport=ntcEventsMonitorOrBlockReport +ntcEventsMonitorOrBlock=ntcEventsMonitorOrBlock #\u91cd\u70b9\u4fdd\u969c\u4e8b\u4ef6 -ntcEventKeyProtectionReport=ntcEventKeyProtectionReport \ No newline at end of file +ntcEventKeyProtection=ntcEventKeyProtection \ No newline at end of file From 51ea4edebd91ded9f8eae3dcf1b1a2ab5d975cde Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 26 Dec 2018 10:23:14 +0800 Subject: [PATCH 067/147] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=AF=A6=E6=83=85=E7=95=8C=E9=9D=A2=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=88=B7=E6=96=B0=E4=BB=BB=E5=8A=A1=EF=BC=8C=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E8=B7=9F=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=EF=BC=8C=E7=95=8C=E9=9D=A2=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E4=B8=8B=E5=8A=A0=E4=B8=80=E6=9D=A1=E6=A8=AA?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/ntcTotalReportDetailList.jsp | 43 +++++++++---------- .../dashboard/trafficActionTransList.jsp | 7 +-- .../views/dashboard/trafficAppTypeList.jsp | 6 +-- .../views/dashboard/trafficBandwidthList.jsp | 6 +-- .../dashboard/trafficHttpStatisticList.jsp | 6 +-- .../views/dashboard/trafficIpActiveList.jsp | 1 + .../views/dashboard/trafficPortActiveList.jsp | 1 + .../dashboard/trafficProtocolTypeList.jsp | 6 +-- .../views/dashboard/trafficWebTypeList.jsp | 8 ++-- 9 files changed, 43 insertions(+), 41 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp index 73661cbb1..059341e8f 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -98,9 +98,9 @@ $("#searchForm")[0].reset(); }); - setInterval(function(){ - actionTransAjax($("#searchAction").val(),starth,new Date().Format("yyyy-MM-dd HH:mm:00")); - },500000);// 五分钟调用一次 +// setInterval(function(){ +// actionTransAjax($("#searchAction").val(),starth,new Date().Format("yyyy-MM-dd HH:mm:00")); +// },500000);// 五分钟调用一次 }); function searchList() { // loading(); @@ -113,22 +113,8 @@ } } // 局点信息 - function showActionTransChart(rs) { - var data = new Array(); - var xData = new Array(); - xData = rs.statTime; - var series = new Array(); - - var total = 0; - $(rs.sum).each(function(i,d) { - total+=d - }) + function showActionTransChart(xData,series) { - $("#total").val(JSON.stringify(total)); - series.push({ - name: 'sum', - data: rs.sum - }); var chart = Highcharts.chart('chart', { chart : { @@ -211,10 +197,25 @@ url : "${ctx}/dashboard/traffic/ajaxNtcTotalReportDetail?searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate, type : "get", dataType : "json", - cache : false, async : false, success : function(rs) { - showActionTransChart(rs); + var data = new Array(); + var xData = new Array(); + var series = new Array(); + var total = 0; + if(rs!=null){ + $(rs.sum).each(function(i,d) { + total+=d + }) + xData = rs.statTime; + data =rs.sum; + } + $("#total").val(JSON.stringify(total)); + series.push({ + name: 'sum', + data: data + }); + showActionTransChart(xData,series); closeTip(); }, error : function(data, textStatus, errorThrown) { @@ -273,8 +274,6 @@ }); }; }(Highcharts)); - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index 57d3ab0c0..fd2353a19 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -17,6 +17,7 @@

    +
    @@ -80,9 +81,9 @@ $(document).ready(function(){ $("#searchForm")[0].reset(); }); - setInterval(function(){ - actionTransAjax($("#searchAction").val(),starth,new Date().Format("yyyy-MM-dd HH:mm:00")); - },500000);// 五分钟调用一次 +// setInterval(function(){ +// actionTransAjax($("#searchAction").val(),starth,new Date().Format("yyyy-MM-dd HH:mm:00")); +// },500000);// 五分钟调用一次 }); function searchList(){ loading(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index d77aa2a73..57c35301f 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -132,9 +132,9 @@ $(document).ready(function(){ $(".Wdate").attr("value",''); $("#searchForm")[0].reset(); }); - setInterval(function(){ - ajaxAppList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); - },500000);// 五分钟调用一次 +// setInterval(function(){ +// ajaxAppList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); +// },500000);// 五分钟调用一次 }); function searchList(){ loading(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index 3163f4928..5b0d9601d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -99,9 +99,9 @@ $(document).ready(function(){ changeBandwidth($("#unitType").val(),$("#beginDate").val(),$("#endDate").val()); }); - setInterval(function(){ - changeBandwidth($("#unitType").val(),$("#beginDate").val(),new Date().Format("yyyy-MM-dd HH:mm:00")); - },500000);// 五分钟调用一次 +// setInterval(function(){ +// changeBandwidth($("#unitType").val(),$("#beginDate").val(),new Date().Format("yyyy-MM-dd HH:mm:00")); +// },500000);// 五分钟调用一次 //筛选功能初始化 $("#resetBtn").on("click",function(){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp index 2d4692feb..c003653e2 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp @@ -110,9 +110,9 @@ $(document).ready(function(){ $("#searchForm")[0].reset(); }); - setInterval(function(){ - ajaxProtocolList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); - },500000);// 五分钟调用一次 +// setInterval(function(){ +// ajaxProtocolList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); +// },500000);// 五分钟调用一次 }); function searchList(){ var start=$("#beginDate").val(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 3a60db574..70598d465 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -17,6 +17,7 @@

    +
    diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp index c6acd8e15..1b63b0750 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp @@ -15,6 +15,7 @@

    +
    diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 22038fde1..2a0a94a0d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -123,9 +123,9 @@ $(document).ready(function(){ $("#searchForm")[0].reset(); }); - setInterval(function(){ - ajaxProtocolList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); - },500000);// 五分钟调用一次 +// setInterval(function(){ +// ajaxProtocolList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); +// },500000);// 五分钟调用一次 }); function searchList(){ loading(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 8d5ad57e2..279afd571 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -186,10 +186,10 @@ }); ajaxWebTypeList(starth, endh); - setInterval(function() { - ajaxWebTypeList(starth, new Date() - .Format("yyyy-MM-dd HH:mm:00")); - }, 500000);// 五分钟调用一次 +// setInterval(function() { +// ajaxWebTypeList(starth, new Date() +// .Format("yyyy-MM-dd HH:mm:00")); +// }, 500000);// 五分钟调用一次 }); function searchList() { var start = $("#beginDate").val(); From dbe0aac130afd1966fd17a76e1d588c923e6ac5d Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 26 Dec 2018 11:49:17 +0800 Subject: [PATCH 068/147] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=BA=E5=BC=82=E6=AD=A5=E8=B0=83=E7=94=A8?= =?UTF-8?q?=EF=BC=8C=E5=88=9D=E5=A7=8B=E5=8C=96=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/ntcTotalReportDetailList.jsp | 2 +- .../dashboard/trafficActionTransList.jsp | 50 ++++++++++------- .../views/dashboard/trafficAppTypeList.jsp | 2 +- .../views/dashboard/trafficDomainTrans.jsp | 29 +++++----- .../dashboard/trafficHttpStatisticList.jsp | 2 +- .../views/dashboard/trafficIpActiveList.jsp | 54 ++++++++++--------- .../views/dashboard/trafficPortActiveList.jsp | 35 ++++++------ .../dashboard/trafficProtocolTypeList.jsp | 2 +- .../views/dashboard/trafficWebTypeList.jsp | 12 ++--- 9 files changed, 101 insertions(+), 87 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp index 059341e8f..babcb72d9 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -197,7 +197,7 @@ url : "${ctx}/dashboard/traffic/ajaxNtcTotalReportDetail?searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate, type : "get", dataType : "json", - async : false, + async : true, success : function(rs) { var data = new Array(); var xData = new Array(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index fd2353a19..4fe7ecee0 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -96,24 +96,7 @@ function searchList(){ } } // 局点信息 -function showActionTransChart(rs){ - var data=new Array(); - var xData=new Array(); - xData=rs[0].statTime; - var series=new Array(); - $(rs).each(function(i, d) { - var entrance=""; - if(d!=null&&d.entranceId==1){ - entrance="Astana"; - } - if(d!=null&&d.entranceId==2){ - entrance="Alamty"; - } - series.push({ - name: entrance, - data: d.count - }); - }) +function showActionTransChart(xData,series){ var chart = Highcharts.chart('chart', { chart:{ // type: 'area', @@ -184,10 +167,37 @@ function showActionTransChart(rs){ url: "${ctx}/dashboard/traffic/actionEntranceTrans?searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate, type : "get" , dataType:"json", - cache:false, async:true, success:function (rs) { - showActionTransChart(rs); + var xData=new Array(); + var series=new Array(); + if(rs!=null&&rs.length>0){ + xData=rs[0].statTime; + $(rs).each(function(i, d) { + var entrance=""; + if(d!=null&&d.entranceId==1){ + entrance="Astana"; + } + if(d!=null&&d.entranceId==2){ + entrance="Alamty"; + } + series.push({ + name: entrance, + data: d.count + }); + }) + }else{ + series.push({ + name: "Astana", + data: [] + }); + series.push({ + name: "Alamty", + data: [] + }); + } + + showActionTransChart(xData,series); closeTip(); }, error: function(data, textStatus, errorThrown){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 57c35301f..60d7c83de 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -154,7 +154,7 @@ function ajaxAppList(start,end){ type: 'get', dataType: "json", data:{"beginDate":start,"endDate":end,"appType":appType}, - async:false, + async:true, timeout:10000, traditional:true, success:function (data){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 2e78423b6..d908074b5 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -54,14 +54,25 @@ $(document).ready(function(){ type : "get" , dataType:"json", data:{"beginDate":beginDate,"endDate":endDate,"entranceId":entranceId,"domain":domain}, - cache:false, - async:false, + async:true, timeout:40000, success:function (rs) { $("#tbodyData").html(""); + var xData=new Array(); + var series=new Array(); if(rs!=null&&rs.length>0){ - showDomainTrans(rs); + xData=rs[0].statTime; + series.push({ + name: 'unique', + data: rs[0].count + }); + }else{ + series.push({ + name: 'unique', + data: [] + }); } + showDomainTrans(xData,series); closeTip(); }, error: function(data, textStatus, errorThrown){ @@ -73,18 +84,8 @@ $(document).ready(function(){ }); } -function showDomainTrans(rs){ +function showDomainTrans(xData,series){ var domainName= $("#domainName").val(); - var data=new Array(); - var xData=new Array(); - xData=rs[0].statTime; - var series=new Array(); -// $(rs).each(function(i, d) { - series.push({ - name: 'unique', - data: rs[0].count - }); -// }) var chart = Highcharts.chart('chart', { chart:{ // type: 'area', diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp index c003653e2..e07489c50 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp @@ -129,7 +129,7 @@ function ajaxProtocolList(start,end){ type: 'get', dataType: "json", data:{"beginDate":start,"endDate":end}, - async:false, + async:true, timeout:10000, beforeSend:function(){ loading(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 70598d465..9f76549e5 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -52,7 +52,7 @@
    -
    +
    @@ -164,22 +164,8 @@ function searchList(){ } } -function showIpActiveChart(rs){ - var data=new Array(); - var xData=new Array(); - xData=rs[0].statTime; - var series=new Array(); - var total=[]; - $(rs).each(function(i, d) { - total.push( - sum(d.linkNum) - ) - series.push({ - name: d.ipAddr, - data: d.linkNum - }); - }) - $("#total").val(JSON.stringify(total)); +function showIpActiveChart(xData,series){ + var chart = Highcharts.chart('chart', { chart:{ //type: 'area', @@ -252,14 +238,31 @@ function showIpActiveChart(rs){ type : "get", dataType:"json", data:{"beginDate":beginDate,"endDate":endDate}, - cache:false, - async:false, - timeout:40000, + async:true, + timeout:50000, success:function (rs) { - $("#tbodyData").html(""); + var total=[]; + var xData=new Array(); + var series=new Array(); if(rs!=null&&rs.length>0){ - showIpActiveChart(rs); + xData=rs[0].statTime; + $(rs).each(function(i, d) { + total.push( + sum(d.linkNum) + ) + series.push({ + name: d.ipAddr, + data: d.linkNum + }); + }) + }else{ + series.push({ + name: " ", + data: [] + }); } + $("#total").val(JSON.stringify(total)); + showIpActiveChart(xData,series); closeTip(); }, error: function(data, textStatus, errorThrown){ @@ -272,17 +275,16 @@ function showIpActiveChart(rs){ } //活跃IP一小时统计 function ipActiveOneHourList(beginDate,endDate){ + $("#tbodyData").html(""); loading(); $.ajax({ url: '${ctx}/dashboard/ajaxIpActiveList', type : "get" , dataType:"json", data:{"beginDate":beginDate,"endDate":endDate}, - cache:false, - async:false, - timeout:40000, + async:true, + timeout:50000, success:function (data) { - $("#tbodyData").html(""); if(data!=null&&data.length>0){ var totalc2sByte= 0; var totals2cByte= 0; diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp index 1b63b0750..fcd06f4a4 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp @@ -104,18 +104,8 @@ function searchList(){ } } -function showPortActiveChart(rs){ - var data=new Array(); - var xData=new Array(); - xData=rs[0].statTime; - var series=new Array(); - var legend=new Array(); - $(rs).each(function(i, d) { - series.push({ - name: d.port, - data: d.sum - }); - }) +function showPortActiveChart(xData,series){ + var chart = Highcharts.chart('chart', { chart:{ // type: 'area', @@ -183,19 +173,32 @@ function showPortActiveChart(rs){ //活跃IP一小时间隔五分钟统计 function portActiveMinuteList(beginDate,endDate){ loading(); + $("#tbodyData").html(""); $.ajax({ url: '${ctx}/dashboard/portActiveChart', type : "get" , dataType:"json", data:{"beginDate":beginDate,"endDate":endDate}, - cache:false, - async:false, + async:true, timeout:40000, success:function (rs) { - $("#tbodyData").html(""); + var xData=new Array(); + var series=new Array(); if(rs!=null&&rs.length>0){ - showPortActiveChart(rs); + xData=rs[0].statTime; + $(rs).each(function(i, d) { + series.push({ + name: d.port, + data: d.sum + }); + }) + }else{ + series.push({ + name: " ", + data: [] + }); } + showPortActiveChart(xData,series); closeTip(); }, error: function(data, textStatus, errorThrown){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 2a0a94a0d..f85aed5b8 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -145,7 +145,7 @@ function ajaxProtocolList(start,end){ type: 'get', dataType: "json", data:{"beginDate":start,"endDate":end,"protoType":protoType}, - async:false, + async:true, timeout:40000, traditional:true, beforeSend:function(){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 279afd571..8596102fa 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -214,16 +214,14 @@ "domain" : domain, "entranceId" : entranceId }, - async : false, + async : true, timeout : 40000, traditional:true, success : function(data) { - if (data != null && data.length > 0 - && data[0].error != null) { - top.$.jBox - .tip( - "", - ""); + if (data != null && data.length > 0 && data[0].error != null) { + top.$.jBox.tip( + "", + ""); return; } webTypeChart(data) From b32952362184f56fc0eca8c420798dc8c9591931 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Wed, 26 Dec 2018 13:58:04 +0800 Subject: [PATCH 069/147] =?UTF-8?q?home.*=E4=B8=BA=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=96=B0=E5=A2=9E=E5=88=97=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E6=9B=B4=E6=96=B0=EF=BC=9B=20login.?= =?UTF-8?q?jsp=5Fnew=E4=B8=BA=E5=8A=A8=E6=80=81=E7=99=BB=E9=99=86=E4=B9=9F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E4=BB=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/home.jsp.bak | 2 +- src/main/webapp/WEB-INF/views/home.jsp.new | 9 +++++---- src/main/webapp/WEB-INF/views/login.jsp_new | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/home.jsp.bak b/src/main/webapp/WEB-INF/views/home.jsp.bak index 8d0336c8b..2a4c6448f 100644 --- a/src/main/webapp/WEB-INF/views/home.jsp.bak +++ b/src/main/webapp/WEB-INF/views/home.jsp.bak @@ -342,7 +342,7 @@ background:#3d3d3d;
    - +
    - +
    - + + +<%@include file="/WEB-INF/include/excel/importModal.jsp" %> \ No newline at end of file From 52f88155e2f106f3d658c320e2fdf716ea21dee8 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Wed, 26 Dec 2018 14:31:38 +0800 Subject: [PATCH 071/147] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=20=E7=9B=B8=E5=85=B3=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E8=A1=A8=E4=BF=AE=E6=94=B9sql.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/20181226/update_function_dicts.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/resources/sql/20181226/update_function_dicts.sql diff --git a/src/main/resources/sql/20181226/update_function_dicts.sql b/src/main/resources/sql/20181226/update_function_dicts.sql new file mode 100644 index 000000000..deef084a0 --- /dev/null +++ b/src/main/resources/sql/20181226/update_function_dicts.sql @@ -0,0 +1,8 @@ +-- 代理 控制策略导入字典表修改 +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 210 AND dict_id != 184; +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 207 AND dict_id != 181; +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 208 AND dict_id != 182; +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 209 AND dict_id != 183; +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 211 AND dict_id != 185; + +UPDATE function_service_dict SET is_import = 1 WHERE function_id IN(210,207,208,209,211); \ No newline at end of file From b2eb6afad9b2a2f6bd5a1ee049ce4aa825607248 Mon Sep 17 00:00:00 2001 From: leijun Date: Wed, 26 Dec 2018 14:47:23 +0800 Subject: [PATCH 072/147] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0csv=E5=92=8Cexcel=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/domain/basics/PolicyGroupInfo.java | 4 + .../nis/domain/basics/ServiceDictInfo.java | 30 +++- .../domain/specific/SpecificServiceCfg.java | 7 + .../controller/basics/AsnIpController.java | 60 +++++--- .../basics/PolicyGroupController.java | 65 +++++++++ .../basics/ServiceDictInfoController.java | 135 ++++++++++++++++-- .../SpecificServiceCfgController.java | 122 ++++++++++++++++ .../com/nis/web/dao/basics/AsnIpCfgDao.java | 1 + .../com/nis/web/dao/basics/AsnIpCfgDao.xml | 23 ++- .../web/dao/basics/PolicyGroupInfoDao.java | 3 + .../nis/web/dao/basics/PolicyGroupInfoDao.xml | 16 +++ .../web/dao/basics/ServiceDictInfoDao.java | 4 + .../nis/web/dao/basics/ServiceDictInfoDao.xml | 11 +- .../dao/specific/SpecificServiceCfgDao.java | 2 + .../dao/specific/SpecificServiceCfgDao.xml | 9 ++ .../web/service/basics/AsnIpCfgService.java | 7 + .../basics/PolicyGroupInfoService.java | 7 + .../basics/ServiceDictInfoService.java | 23 ++- .../specific/SpecificServiceCfgService.java | 6 + .../WEB-INF/views/basics/asnIpCfgList.jsp | 36 +++-- .../WEB-INF/views/basics/policyGroupList.jsp | 40 ++++-- .../WEB-INF/views/basics/serviceDictList.jsp | 62 +++----- .../views/specific/specificServiceCfgList.jsp | 32 +++-- 23 files changed, 590 insertions(+), 115 deletions(-) diff --git a/src/main/java/com/nis/domain/basics/PolicyGroupInfo.java b/src/main/java/com/nis/domain/basics/PolicyGroupInfo.java index 5d4ec3c1b..2a372b989 100644 --- a/src/main/java/com/nis/domain/basics/PolicyGroupInfo.java +++ b/src/main/java/com/nis/domain/basics/PolicyGroupInfo.java @@ -5,6 +5,7 @@ import java.util.Date; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.util.excel.ExcelField; /** * @ClassName: PolicyGroupInfo.java @@ -18,9 +19,12 @@ public class PolicyGroupInfo extends BaseCfg implements Seriali private static final long serialVersionUID = 7931466570918016654L; private Integer groupId; + @ExcelField(title="group_name",sort=1) private String groupName; + @ExcelField(title="group_type",dictType="GROUP_TYPE",sort=2) private Integer groupType; private Integer serviceGroupId; + @ExcelField(title="desc",sort=4) private String description; private Long asnNo; diff --git a/src/main/java/com/nis/domain/basics/ServiceDictInfo.java b/src/main/java/com/nis/domain/basics/ServiceDictInfo.java index 2d2dc7611..3d2e43ed8 100644 --- a/src/main/java/com/nis/domain/basics/ServiceDictInfo.java +++ b/src/main/java/com/nis/domain/basics/ServiceDictInfo.java @@ -11,6 +11,7 @@ import com.nis.domain.SysMenu; import com.nis.domain.SysUser; import com.nis.util.Configurations; import com.nis.util.StringUtil; +import com.nis.util.excel.ExcelField; /** * 业务辅助表-业务字典信息表 * @author zsl @@ -21,16 +22,24 @@ public class ServiceDictInfo extends BaseEntity{ private static final long serialVersionUID = 4680466118906894338L; private Integer serviceDictId; //service_dict_id 字典ID int N 主键,自增 + @ExcelField(title="item_type",dictType="SERVICE_DICT_ITM_TYPE",sort=3) private Integer itemType; //item_type 数据类型 int N 1:分类 2:性质 3:标签 - private String itemCode; //item_code编码 varchar(64) N + private String itemCode; //item_code编码 varchar(64) N + @ExcelField(title="config_content",sort=1) private String itemValue; //item_value 编码对应值 varchar2(64) N + @ExcelField(title="desc",sort=2) private String itemDesc; //item_desc 描述信息 varcahr2(128) Y private ServiceDictInfo parent; //parent_id 父ID number(9) N 无父属性,默认填0 + @ExcelField(title="is_leaf",dictType="INT_YES_NO",sort=4) private Integer isLeaf; //is_leaf 是否叶子节点 int N 0-否 1-是;只有一级填0; private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效 + private SysUser serviceDictCreator; //creator_id 创建人员 int N 取自sys_user.id + @ExcelField(title="create_time",sort=6) private Date createTime; //create_time 配置时间 date N + private SysUser serviceDictEditor; //editor_id 修改人员 int Y 取自sys_user.id + @ExcelField(title="edit_time",sort=8) private Date editTime; //edit_time 修改时间 date Y private Integer levelNo; //层级 private List childrenList = new ArrayList();//子列表 @@ -41,6 +50,11 @@ public class ServiceDictInfo extends BaseEntity{ private Date editEndDate; // 修改结束日期 private String showSequence; //显示序号 + @ExcelField(title="creator",sort=5) + private String creatorName; + @ExcelField(title="editor",sort=7) + private String editorName; + private String pNames;//父节点名称 /** @@ -49,6 +63,20 @@ public class ServiceDictInfo extends BaseEntity{ */ private List conditionType; + + + public String getCreatorName() { + return creatorName; + } + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + public String getEditorName() { + return editorName; + } + public void setEditorName(String editorName) { + this.editorName = editorName; + } @JsonIgnore public String getpNames() { return pNames; diff --git a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java index d930b4496..80bdfa40b 100644 --- a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java +++ b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java @@ -6,6 +6,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.BaseEntity; import com.nis.util.Configurations; +import com.nis.util.excel.ExcelField; /** * 系统特定服务信息表-记录特定服务信息(specific_service_cfg) @@ -17,19 +18,25 @@ public class SpecificServiceCfg extends BaseEntity{ private static final long serialVersionUID = -1133644323636425766L; private Integer specServiceId; //spec_service_id 协议ID int N 主键,初始化 + @ExcelField(title="app_code",sort=2) private Integer specServiceCode; //协议编码 int N 暂定,以后可扩展 1000:微信 , 1001:QQ + @ExcelField(title="app_name",sort=3) private String specServiceName; //spec_service_name 协议名称 varchar(64) N + @ExcelField(title="app_desc",sort=4) private String specServiceDesc; //spec_service_desc 协议描述 varchar2(64) N private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效 + @ExcelField(title="operate_time",sort=6) private Date opTime; //op_time 操作时间 date N private SpecificServiceCfg parent; //parent_id 父节点id int N 0表示一级节点 private Integer isLeaf; //is_leaf 是否是叶子节点 int N 0否,1是,只有一级填0 private Integer groupId; //group_id maat端配置分组id int N 缺省0,表示未与maat分组同步 + @ExcelField(title="cfg_type",dictType="SPECIFIC_SERVICE_CFG_TYPE",sort=5) private Integer cfgType;//配置类型,1,app;2,加密隧道;3,基础协议 private Integer parentType;//父配置类型 private Date beginDate; // 开始日期 private Date endDate; // 结束日期 private String showSequence; //显示序号 + @ExcelField(title="business_type",sort=1) private String businessType; private Integer addFlag;//app界面添加标记 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 3736613d4..9f2aa1202 100644 --- a/src/main/java/com/nis/web/controller/basics/AsnIpController.java +++ b/src/main/java/com/nis/web/controller/basics/AsnIpController.java @@ -1,4 +1,4 @@ -package com.nis.web.controller.basics; + package com.nis.web.controller.basics; import java.util.ArrayList; import java.util.HashMap; @@ -7,7 +7,6 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - import org.apache.commons.lang.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; @@ -18,20 +17,18 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; - import com.nis.domain.FunctionRegionDict; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.basics.AsnIpCfg; import com.nis.domain.basics.PolicyGroupInfo; import com.nis.domain.configuration.CfgIndexInfo; -import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.specific.ConfigGroupInfo; -import com.nis.domain.specific.SpecificServiceCfg; import com.nis.exceptions.MaatConvertException; import com.nis.util.AsnCacheUtils; import com.nis.util.Constants; import com.nis.util.DictUtils; +import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; @Controller @RequestMapping(value = "${adminPath}/basics/asn") @@ -186,33 +183,50 @@ public class AsnIpController extends BaseController{ Map> classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); + List list = new ArrayList(); + if (!StringUtil.isEmpty(ids)) { + list = asnIpCfgService.findByPage(ids); + } else { Page pageInfo=new Page(request, response,"r"); pageInfo.setPageNo(1); pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); Page page = asnIpCfgService.findPage(pageInfo, entity); - for (AsnIpCfg asnIp : page.getList()) { + list=page.getList(); + } + for (AsnIpCfg asnIp : list) { asnIp.setIsIssued(String.valueOf(asnIp.getIsValid())); } titleList.add(entity.getMenuNameCode()); classMap.put(entity.getMenuNameCode(), AsnIpCfg.class); - String ipPortInfoNoExport=",do_log,action,valid_identifier,is_audit" + String cfgIndexInfoNoExport=",block_type,do_log,action,valid_identifier,is_audit" + ",auditor,audit_time,letter,whether_area_block,classification,attribute,label" - +",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,"; - noExportMap.put(entity.getMenuNameCode(),ipPortInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); - /*}*/ - this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + +",userregion2,userregion3,userregion4,userregion5,ir_type,group_name,&userregion1:asn_no-"; + // 时间过滤 + if (entity.getSearch_create_time_start() == null ) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), list); + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } } catch (Exception e) { logger.error("asnIp export failed",e); addMessage(redirectAttributes,"error","export_failed"); diff --git a/src/main/java/com/nis/web/controller/basics/PolicyGroupController.java b/src/main/java/com/nis/web/controller/basics/PolicyGroupController.java index 41c4c4300..8cef98d7b 100644 --- a/src/main/java/com/nis/web/controller/basics/PolicyGroupController.java +++ b/src/main/java/com/nis/web/controller/basics/PolicyGroupController.java @@ -1,11 +1,17 @@ package com.nis.web.controller.basics; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; @@ -14,6 +20,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; import com.nis.domain.basics.PolicyGroupInfo; +import com.nis.util.Constants; import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; /** @@ -133,4 +140,62 @@ public class PolicyGroupController extends BaseController { return true; } + + //Group配置导出 + @RequestMapping(value = "exportGroup") + public void exportGroup(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")PolicyGroupInfo entity,String ids,RedirectAttributes redirectAttributes){ + try { + //export data info + entity.setMenuNameCode("policy_group_manage"); + List titleList=new ArrayList(); + Map> classMap=new HashMap>(); + Map dataMap=new HashMap(); + Map noExportMap=new HashMap(); + List list = new ArrayList(); + if (!StringUtil.isEmpty(ids)) { + list = policyGroupInfoService.findPolicyByGroupInfoList(ids); + } else { + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = policyGroupInfoService.findPolicyGroupInfoList(pageInfo,entity); + list=page.getList(); + } + + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), PolicyGroupInfo.class); + String cfgIndexInfoNoExport=",config_describe,cfg_id,block_type,do_log,action,valid_identifier,is_audit" + + ",auditor,audit_time,letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,"; + // 时间过滤 + if (entity.getSearch_create_time_start() == null ) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), list); + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("Group export failed",e); + addMessage(redirectAttributes,"error","export_failed"); + } + //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + } diff --git a/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java b/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java index 02d5965c1..70118cee7 100644 --- a/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java +++ b/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java @@ -1,40 +1,37 @@ package com.nis.web.controller.basics; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.apache.zookeeper.ZooDefs.Ids; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; - import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.nis.domain.Page; +import com.nis.domain.SysUser; import com.nis.domain.basics.ServiceDictInfo; -import com.nis.domain.configuration.RequestInfo; -import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigDictUtils; import com.nis.util.Configurations; +import com.nis.util.Constants; +import com.nis.util.DateUtils; import com.nis.util.StringUtil; import com.nis.util.StringUtils; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/basics/serviceDictInfo") @@ -474,4 +471,126 @@ public class ServiceDictInfoController extends BaseController { } + // dict配置导出 + @RequestMapping(value = "exportDict") + public void exportDict(String itType, ServiceDictInfo serviceDictInfo,Model model, HttpServletRequest request, HttpServletResponse response, + String ids, RedirectAttributes redirectAttributes,String exType,String hColumns) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + List list = Lists.newArrayList(); + List intArr = ConfigDictUtils.dealTypeCondition(Configurations.getStringProperty("SERVICE_DICT_ITM_TYPE", ""), itType); + //处理数据 + if (!StringUtil.isEmpty(ids)) { + list = serviceDictInfoService.findByDictInfo(ids,intArr); + } else { + + Page pageCondition = new Page(request, response); + pageCondition.setPageNo(1); + pageCondition.setPageSize(Constants.MAX_EXPORT_SIZE); + //查询符合条件总数 + List allList = serviceDictInfoService.findAllServiceDictInfo(serviceDictInfo,intArr,pageCondition.getOrderBy()); + //查出顶层分页数据 + Page page = serviceDictInfoService.findTopDictList(pageCondition, serviceDictInfo,intArr); + // 删除顶层数据、取出id + List intList = Lists.newArrayList(); + for(ServiceDictInfo tempSe : page.getList()) { + if (tempSe != null) { + intList.add(tempSe.getServiceDictId()); + } + } + for (int i = allList.size() - 1; i >= 0; i--) { + ServiceDictInfo se = allList.get(i); + if(se!=null&&intList.contains(se.getServiceDictId())||(se!=null&&se.getParent().getServiceDictId()==0)){ + allList.remove(se); + } + } + allList.addAll(page.getList()); + ServiceDictInfo.sortList(list,allList,0,true); + } + + for(ServiceDictInfo tempSe : list) { + if(tempSe.getServiceDictCreator()!=null){ + if(tempSe.getServiceDictCreator().getId()!=null){ + SysUser creator=UserUtils.get(tempSe.getServiceDictCreator().getId().toString()); + tempSe.setCreatorName(creator.getName()); + } + } + if(tempSe.getServiceDictEditor()!=null){ + if(tempSe.getServiceDictEditor().getId()!=null){ + SysUser creator=UserUtils.get(tempSe.getServiceDictEditor().getId().toString()); + tempSe.setEditorName(creator.getName()); + } + } + } + String dictName=getDicName(intArr); + titleList.add(dictName); + classMap.put(dictName, ServiceDictInfo.class); + String cfgIndexInfoNoExport = ""; + if("5".equals(itType)){ + cfgIndexInfoNoExport=",item_type,is_leaf,&config_content:vpn_ip-"; + } + if(serviceDictInfo.getBeginDate()==null){ + cfgIndexInfoNoExport=",create_time,"+cfgIndexInfoNoExport; + } + if(serviceDictInfo.getEditBeginDate()==null){ + cfgIndexInfoNoExport=",edit_time,"+cfgIndexInfoNoExport; + } + + if (!StringUtil.isEmpty(hColumns)) { + cfgIndexInfoNoExport = "," +hColumns+ ","+cfgIndexInfoNoExport; + } + noExportMap.put(dictName, cfgIndexInfoNoExport); + dataMap.put(dictName, list); + String timeRange = initDictMap(serviceDictInfo,dictName); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(exType)) { + this._exportCsv(model, request, response, redirectAttributes, dictName, titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, dictName, titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("dict white export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + + public String initDictMap(ServiceDictInfo cfg,String dictName){ + Properties msgProp = getMsgProp(); + String titleTime=dictName; + if(cfg.getBeginDate()!=null){ + titleTime+=" "+msgProp.getProperty("create_time")+":"+DateUtils.formatDateTime(cfg.getBeginDate()); + if(cfg.getEndDate()!=null){ + titleTime+="—"+DateUtils.formatDateTime(cfg.getEndDate()); + }else{ + titleTime+="—"+DateUtils.getDateTime(); + } + } + if(cfg.getEditBeginDate()!=null){ + titleTime+=" "+msgProp.getProperty("edit_time")+":"+DateUtils.formatDateTime(cfg.getEditBeginDate()); + if(cfg.getEditEndDate()!=null){ + titleTime+="—"+DateUtils.formatDateTime(cfg.getEditEndDate()); + }else{ + titleTime+="—"+DateUtils.getDateTime(); + } + } + return titleTime; + } + + + public String getDicName(List intArr){ + String dicName=""; + Properties msgProp = getMsgProp(); + List dict=ConfigDictUtils.getItemTypeByNo("SERVICE_DICT_ITM_TYPE",intArr); + if(dict.size()>0){ + dicName=msgProp.getProperty(dict.get(0),dict.get(0)); + } + return dicName; + } + } diff --git a/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java b/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java index 6f4fba9b0..e3fca435d 100644 --- a/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java +++ b/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java @@ -1,7 +1,9 @@ package com.nis.web.controller.specific; +import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; @@ -23,12 +25,19 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.nis.domain.Page; import com.nis.domain.SysDataDictionaryItem; +import com.nis.domain.SysUser; +import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.specific.SpecificServiceCfg; import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigDictUtils; +import com.nis.util.Configurations; import com.nis.util.Constants; +import com.nis.util.DateUtils; import com.nis.util.DictUtils; +import com.nis.util.StringUtil; import com.nis.util.StringUtils; import com.nis.web.controller.BaseController; +import com.nis.web.dao.dashboard.codedic.CodeResult; import com.nis.web.security.UserUtils; @Controller @@ -490,4 +499,117 @@ public class SpecificServiceCfgController extends BaseController { return false; } + // Specific配置导出 + @RequestMapping(value = "exportSpec") + public void exportDict(String itType, SpecificServiceCfg specificServiceCfg, Model model, HttpServletRequest request, + HttpServletResponse response, String ids, RedirectAttributes redirectAttributes, String exType, + String hColumns) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + //-------------------------------------------- + List list = Lists.newArrayList(); + //处理数据 + if (!StringUtil.isEmpty(ids)) { + list = specificServiceCfgService.findBySpecificServiceCfg(ids); + } else { + if(specificServiceCfg.getCfgType()==null){ + specificServiceCfg.setCfgType(1); + } + Page pageCondition = new Page(request, response); + pageCondition.setPageNo(1); + pageCondition.setPageSize(Constants.MAX_EXPORT_SIZE); + List allList = specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg,pageCondition.getOrderBy()); + Page page = specificServiceCfgService.findTopPage(pageCondition, specificServiceCfg); + // 删除顶层数据、取出id + List intList = Lists.newArrayList(); + for (int i = allList.size() - 1; i >= 0; i--) { + SpecificServiceCfg ss = allList.get(i); + if ((ss != null && intList.contains(ss.getSpecServiceId())) || (ss != null && ss.getParent().getSpecServiceId() == 0)) { + allList.remove(ss); + } + } + allList.addAll(page.getList()); + SpecificServiceCfg.sortList(list, allList, 0, true); + SpecificServiceCfg.addChildrenSeq(list, 0); + } + List app=DictUtils.getDictList("APP_BUSINESS_TYPE"); + List tunnel=DictUtils.getDictList("TUNNEL_BEHAV_BUSINESS_TYPE"); + List basic=DictUtils.getDictList("BASIC_PROTOCOL_BUSINESS_TYPE"); + Properties msgProp = getMsgProp(); + for (SpecificServiceCfg spec : list) { + if (!StringUtils.isEmpty(spec.getBusinessType())) { + if (spec.getCfgType() == 1) { + spec.setBusinessType(getName(spec.getBusinessType(),app,msgProp)); + } else if (spec.getCfgType() == 2) { + spec.setBusinessType(getName(spec.getBusinessType(),tunnel,msgProp)); + } else if (spec.getCfgType() == 3) { + spec.setBusinessType(getName(spec.getBusinessType(),basic,msgProp)); + } + } + } + String dictName = "specific_service_cfg"; + titleList.add(dictName); + classMap.put(dictName, SpecificServiceCfg.class); + String cfgIndexInfoNoExport = ""; + if (specificServiceCfg.getCfgType() != null) { + if (specificServiceCfg.getCfgType() == 2) { + cfgIndexInfoNoExport = ",&app_code:tunnel_code-app_name:tunnel_name-app_desc:tunnel_desc-"; + } else if (specificServiceCfg.getCfgType() == 3) { + cfgIndexInfoNoExport = ",&app_code:protocol_code-app_name:protocol_name-app_desc:protocol_desc-"; + } + } + if (specificServiceCfg.getBeginDate() == null) { + cfgIndexInfoNoExport = ",operate_time," + cfgIndexInfoNoExport; + } + + if (!StringUtil.isEmpty(hColumns)) { + cfgIndexInfoNoExport = "," + hColumns + "," + cfgIndexInfoNoExport; + } + noExportMap.put(dictName, cfgIndexInfoNoExport); + dataMap.put(dictName, list); + String timeRange = initDictMap(specificServiceCfg, dictName,msgProp); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(exType)) { + this._exportCsv(model, request, response, redirectAttributes, dictName, titleList, classMap, dataMap, + noExportMap); + } else { + this._export(model, request, response, redirectAttributes, dictName, titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("dict white export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + + } + + public String getName(String id,List list,Properties msgProp){ + String name=id; + for (int i = 0; i < list.size(); i++) { + if(id.equals(list.get(i).getItemCode())){ + name=msgProp.getProperty(list.get(i).getItemValue(),list.get(i).getItemValue()); + break; + } + } + return name; + } + + + public String initDictMap(SpecificServiceCfg cfg, String dictName,Properties msgProp) { + String titleTime =msgProp.getProperty(dictName,dictName) ; + if (cfg.getBeginDate() != null) { + titleTime += " " + msgProp.getProperty("operate_time") + ":" + DateUtils.formatDateTime(cfg.getBeginDate()); + if (cfg.getEndDate() != null) { + titleTime += "—" + DateUtils.formatDateTime(cfg.getEndDate()); + } else { + titleTime += "—" + DateUtils.getDateTime(); + } + } + return titleTime; + } + } diff --git a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.java b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.java index 8830e6f96..ea319f613 100644 --- a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.java +++ b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.java @@ -12,6 +12,7 @@ import com.nis.web.dao.MyBatisDao; public interface AsnIpCfgDao extends CrudDao{ public List findPage(AsnIpCfg cfg); //public void updateValid(@Param("isValid")Integer isValid,@Param("ids")String ids); + public List findByPage(@Param("ids")String ids); public void delete(@Param("ids")String ids); public void updateIssued(AsnIpCfg cfg); public List getByIds(@Param("ids")String ids); 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 6f00e58b4..a410a0451 100644 --- a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml @@ -60,7 +60,7 @@ select - ,s.name as creator_name,e.name as editor_name,u.name as auditor_name + ,s.name as creator_name,e.name as editor_name,u.name as auditor_name,d.group_name as asnIpGroupName from asn_ip_cfg r @@ -68,6 +68,7 @@ left join sys_user s on r.creator_id=s.id left join sys_user e on r.editor_id=e.id left join sys_user u on r.auditor_id=u.id + left join policy_group_info d on r.asn_ip_group = d.service_group_id AND ${page.where} @@ -471,4 +472,24 @@ #{asnIp.userRegion5,jdbcType=VARCHAR}) + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.java b/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.java index efeb90a0a..26cb0e9ec 100644 --- a/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.java +++ b/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.java @@ -2,6 +2,7 @@ package com.nis.web.dao.basics; import java.util.List; +import org.apache.ibatis.annotations.Param; import com.nis.domain.basics.PolicyGroupInfo; import com.nis.web.dao.CrudDao; @@ -23,4 +24,6 @@ public interface PolicyGroupInfoDao extends CrudDao { Integer getGroupIdByGroupName(String groupName); PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo); + + List findPolicyByGroupInfoList(@Param("ids")String ids); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.xml b/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.xml index 145a2306d..54db24a59 100644 --- a/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.xml +++ b/src/main/java/com/nis/web/dao/basics/PolicyGroupInfoDao.xml @@ -250,4 +250,20 @@ + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java index 924e2278e..6cd6dcc8d 100644 --- a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java +++ b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java @@ -27,6 +27,10 @@ public interface ServiceDictInfoDao extends CrudDao { * @return */ List findAllServiceDictInfo(@Param("serviceDictInfo")ServiceDictInfo serviceDictInfo,@Param("orderBy")String orderBy); + + List findByDictInfo(@Param("ids")String ids,@Param("itemType")String itemType); + + /** * 查出所有有效数据父级(!=0) */ diff --git a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml index 12cf5d6c0..1ca9a94c2 100644 --- a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml +++ b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml @@ -207,7 +207,16 @@ - + diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java index 47a47e210..13974d1f4 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java @@ -49,4 +49,6 @@ public interface SpecificServiceCfgDao extends CrudDao { SpecificServiceCfg getRepeat(@Param("specServiceCode")Integer code, @Param("cfgType")Integer cfgType,@Param("parentId")Integer parentId); Integer getMaxServiceCode(@Param("maxCode")Integer code, @Param("cfgType")Integer cfgType,@Param("addFlag")Integer addFlag); + List findBySpecificServiceCfg(@Param("ids")String ids); + } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml index 031bcc105..772c4222d 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml @@ -213,4 +213,13 @@ + + + + \ No newline at end of file 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 790fc367a..f472a960c 100644 --- a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java +++ b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java @@ -61,6 +61,13 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { page.setList(list); return page; } + + public List findByPage(String ids) { + List list=asnIpCfgDao.findByPage(ids); + return list; + } + + public AsnIpCfg get(Long id ) { return asnIpCfgDao.get(id); } diff --git a/src/main/java/com/nis/web/service/basics/PolicyGroupInfoService.java b/src/main/java/com/nis/web/service/basics/PolicyGroupInfoService.java index 6a1caf43f..579e48ab8 100644 --- a/src/main/java/com/nis/web/service/basics/PolicyGroupInfoService.java +++ b/src/main/java/com/nis/web/service/basics/PolicyGroupInfoService.java @@ -44,6 +44,13 @@ public class PolicyGroupInfoService extends BaseService{ page.setList(list); return page; } + + public List findPolicyByGroupInfoList(String ids) { + List list=policyGroupInfoDao.findPolicyByGroupInfoList(ids); + return list; + } + + public List findPolicyGroupInfos() { List list=policyGroupInfoDao.findPolicyGroupInfos(); return list; diff --git a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java index 9f2b29279..96ae961b7 100644 --- a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java +++ b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java @@ -51,15 +51,33 @@ public class ServiceDictInfoService extends BaseService{ * @return */ public List findAllServiceDictInfo(ServiceDictInfo serviceDictInfo,List itType,String orderBy){ - - serviceDictInfo.setConditionType(itType);; + serviceDictInfo.setConditionType(itType); return serviceDictInfoDao.findAllServiceDictInfo(serviceDictInfo,orderBy); } + public List findByDictInfo(String ids,List itType){ + String itemType=String.valueOf(itType.get(0)); + return serviceDictInfoDao.findByDictInfo(ids,itemType); + } + /** + * 根据条件查询所有数据 + * @param serviceDictInfo + * @param itType + * @return + */ + public Page findAllPageServiceDictInfo(Page page, ServiceDictInfo serviceDictInfo,List itType,String orderBy){ + serviceDictInfo.setPage(page); + serviceDictInfo.setConditionType(itType); + List parentList =serviceDictInfoDao.findAllServiceDictInfo(serviceDictInfo,orderBy); + page.setList(parentList); + return page; + } + + @@ -331,6 +349,5 @@ public class ServiceDictInfoService extends BaseService{ } - } diff --git a/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java index 9adf35760..06c4b4f66 100644 --- a/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java +++ b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java @@ -68,6 +68,12 @@ public class SpecificServiceCfgService extends BaseService{ public List findAllSpecificServiceCfg(SpecificServiceCfg specificServiceCfg, String orderBy) { return specificServiceCfgDao.findAllSpecificServiceCfg(specificServiceCfg,orderBy); } + + + public List findBySpecificServiceCfg(String ids) { + return specificServiceCfgDao.findBySpecificServiceCfg(ids); + } + /** * 保存或修改 * @param specificServiceCfg diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp index 26eecb7cc..98fbbb783 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp @@ -152,8 +152,20 @@ - + +
    + + +
    + + <%--

    - + <%-- @@ -136,7 +136,8 @@ - + --%> +

    - - - - - +
    @@ -220,20 +228,14 @@ value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
    -
    - -
    -
    " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
    -
    -
    @@ -242,32 +244,14 @@ value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
    -
    - - -
    - -
    - - - - - -
    - - - - -
    - @@ -275,27 +259,27 @@ <%-- --%> - + - + - + - - + + - - - + + + + <%-- --%> - + <%-- --%> <%-- --%> - - + - - <%-- --%> <%-- --%> - - + + - + <%-- --%> --%> - + @@ -177,7 +218,7 @@ - + diff --git a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp index 9bb17bae4..e7cd9968a 100644 --- a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp @@ -36,18 +36,18 @@ } }); // //筛选功能 -// filterActionInit(); + filterActionInit(); -// $("span[id^=close]").on("click",function(){ -// var closeId=$(this).attr("id"); -// var openId=$(this).attr("id").replace("close","open"); -// $("#"+closeId).hide(); -// $("#"+openId).show(); -// $("#"+closeId).parent().parent().next("tr").hide(); -// }); -// ajaxConnPercent(); -// }); + $("span[id^=close]").on("click",function(){ + var closeId=$(this).attr("id"); + var openId=$(this).attr("id").replace("close","open"); + $("#"+closeId).hide(); + $("#"+openId).show(); + $("#"+closeId).parent().parent().next("tr").hide(); + }); + ajaxConnPercent(); + }); @@ -67,46 +67,56 @@ + + +
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    + + + +<%-- --%> + +<%-- --%> + + -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    + + + +<%-- --%> + + +<%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + + + + + +<%-- --%> + + +<%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + + + +
    +
    +
    + +
    + +
    +
    +
    +
    @@ -125,28 +135,59 @@
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    + + +
    +
    + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + +
    + +
    + +
    @@ -162,7 +203,7 @@ --%> - + @@ -176,7 +217,7 @@ - + diff --git a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp index e450c7cc8..0c4e64b3c 100644 --- a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp @@ -36,17 +36,17 @@ } }); //筛选功能 -// filterActionInit(); + filterActionInit(); -// $("span[id^=close]").on("click",function(){ -// var closeId=$(this).attr("id"); -// var openId=$(this).attr("id").replace("close","open"); -// $("#"+closeId).hide(); -// $("#"+openId).show(); -// $("#"+closeId).parent().parent().next("tr").hide(); -// }); -// ajaxConnPercent(); + $("span[id^=close]").on("click",function(){ + var closeId=$(this).attr("id"); + var openId=$(this).attr("id").replace("close","open"); + $("#"+closeId).hide(); + $("#"+openId).show(); + $("#"+closeId).parent().parent().next("tr").hide(); + }); + ajaxConnPercent(); }); @@ -67,45 +67,64 @@ + + + +
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    + + + +<%-- --%> + +<%-- --%> + + + + + +<%-- --%> + +<%-- --%> + + + +
    +
    +
    -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    +
    + +
    +
    + + + + +<%-- --%> + + +<%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + + + + + +<%-- --%> + + +<%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + +
    +
    @@ -124,29 +143,60 @@
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    + +
    +
    + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    @@ -162,7 +212,7 @@ --%> - + @@ -177,7 +227,7 @@ - + From 58a90993d31ff513f06f97966440f91238c70b3f Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Wed, 26 Dec 2018 20:13:17 +0800 Subject: [PATCH 082/147] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E7=B1=BB=E9=85=8D=E7=BD=AE=E5=AF=BC=E5=85=A5=E6=97=B6?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99=E6=95=8F=E6=84=9F=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/util/excel/thread/CheckComplexStringFormatThread.java | 2 +- .../java/com/nis/util/excel/thread/CheckStringFormatThread.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java index 73234b851..d9b25ddc3 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java @@ -367,7 +367,7 @@ public class CheckComplexStringFormatThread implements Callable{ baseStringCfg.setIsHexbin(1); } else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) { baseStringCfg.setIsHexbin(2); - }else { + } else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验 errInfo.append(prop.getProperty("hex_case_insensitive")+ ";"); } } diff --git a/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java index d3c8819c8..8bfa9a4dd 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java @@ -408,7 +408,7 @@ public class CheckStringFormatThread implements Callable{ baseStringCfg.setIsHexbin(1); } else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) { baseStringCfg.setIsHexbin(2); - }else { + } else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验 errInfo.append(prop.getProperty("hex_case_insensitive")+ ";"); } } From 868cc7915eb2457b545733b8983e7a03bceeca9e Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 26 Dec 2018 20:29:54 +0800 Subject: [PATCH 083/147] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E5=AF=BC=E5=87=BA=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=90=8E=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp | 9 +++++---- .../WEB-INF/views/dashboard/trafficActionTransList.jsp | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp index 285b8f050..e788ccec9 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -117,7 +117,7 @@ } // 局点信息 function showActionTransChart(xData,series) { - + var nowDate=new Date(); var chart = Highcharts.chart('chart', { chart : { @@ -132,7 +132,7 @@ }, }, exporting : { - filename : '', + filename : ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale : 1, sourceWidth : 1280, sourceHeight : 500, @@ -240,7 +240,7 @@ (function(H) { H.Chart.prototype.downloadXLS = function() { var div = document.createElement('div'), xlsxRows = [], xlsxColumns = []; - + var nowDate=new Date(); div.style.display = 'none'; document.body.appendChild(div); rows = this.getDataRows(true); @@ -313,6 +313,7 @@ }(Highcharts)); function exportCsv(obj){ + var nowDate=new Date(); //title ["","",""] var title = obj.title; //titleForKey ["","",""] @@ -330,7 +331,7 @@ var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join("")); var downloadLink = document.createElement("a"); downloadLink.href = uri; - downloadLink.download = ""+".csv"; + downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv"; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index 1bcc56861..a55169841 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -99,13 +99,14 @@ function searchList(){ } // 局点信息 function showActionTransChart(xData,series){ + var nowDate=new Date(); var chart = Highcharts.chart('chart', { chart:{ // type: 'area', zoomType: 'x' }, exporting: { - filename:'', + filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500, @@ -284,7 +285,6 @@ function showActionTransChart(xData,series){ (function(H) { H.Chart.prototype.downloadCSV = function() { var rows = this.getDataRows(true); - var data=new Array(); var total = JSON.parse($("#total").val()); $(rows).each(function (i,d){ if(d!=null){ @@ -312,6 +312,7 @@ function showActionTransChart(xData,series){ }(Highcharts)); function exportCsv(obj){ + var nowDate=new Date(); //title ["","",""] var title = obj.title; //titleForKey ["","",""] @@ -329,10 +330,10 @@ function showActionTransChart(xData,series){ var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join("")); var downloadLink = document.createElement("a"); downloadLink.href = uri; - downloadLink.download = ""+".csv"; + downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv"; document.body.appendChild(downloadLink); downloadLink.click(); - document.body.removeChild(downloadLink); + document.body.removeChild(downloadLink); } function sum(arr) { return arr.reduce(function(prev, curr, idx, arr){ From 1df1ca470c77ea98188a26a6ce24667dc08eff29 Mon Sep 17 00:00:00 2001 From: lihaochen Date: Wed, 26 Dec 2018 20:34:54 +0800 Subject: [PATCH 084/147] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8=20?= =?UTF-8?q?=20=E4=BA=8B=E4=BB=B6=E6=8A=A5=E8=A1=A8=E6=9F=A5=E8=AF=A2=20=20?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E5=90=8D=E7=A7=B0=E6=96=B9=E6=B3=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/basics/TaskInfoService.java | 81 +++++++++++-------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/nis/web/service/basics/TaskInfoService.java b/src/main/java/com/nis/web/service/basics/TaskInfoService.java index 9442e11d8..343508e82 100644 --- a/src/main/java/com/nis/web/service/basics/TaskInfoService.java +++ b/src/main/java/com/nis/web/service/basics/TaskInfoService.java @@ -18,90 +18,101 @@ import com.nis.web.security.UserUtils; import com.nis.web.service.BaseService; @Service -@Transactional(readOnly=true) -public class TaskInfoService extends BaseService{ +@Transactional(readOnly = true) +public class TaskInfoService extends BaseService { @Autowired private TaskInfoDao taskInfoDao; - + public Page findTaskInfo(Page page, TaskInfo taskInfo) { - taskInfo.getSqlMap().put("dsf", configScopeFilter(taskInfo.getCurrentUser(),"r")); + taskInfo.getSqlMap().put("dsf", configScopeFilter(taskInfo.getCurrentUser(), "r")); // 设置分页参数 taskInfo.setPage(page); // 执行分页查询 page.setList(taskInfoDao.findTaskInfo(taskInfo)); return page; } - - @Transactional(readOnly=false,rollbackFor=DataAccessException.class) + + public List findTaskInfo(TaskInfo taskInfo) { + List list = taskInfoDao.findTaskInfo(taskInfo); + return list; + } + + @Transactional(readOnly = false, rollbackFor = DataAccessException.class) public void saveOrUpdate(TaskInfo taskInfo) { if (StringUtil.isEmpty(taskInfo.getId())) { - //设置默认参数值 - taskInfo.setIsValid(0);//无效 - taskInfo.setIsAudit(0);//未审核 - taskInfo.setCreatorId((UserUtils.getUser().getId()).intValue());//创建人员 - taskInfo.setCreateTime(new Date());//创建时间 + // 设置默认参数值 + taskInfo.setIsValid(0);// 无效 + taskInfo.setIsAudit(0);// 未审核 + taskInfo.setCreatorId((UserUtils.getUser().getId()).intValue());// 创建人员 + taskInfo.setCreateTime(new Date());// 创建时间 taskInfoDao.insert(taskInfo); - }else{ - taskInfo.setIsAudit(0);//修改后状态为未审核 - taskInfo.setEditorId((UserUtils.getUser().getId()).intValue());//修改人员 - taskInfo.setEditTime(new Date());//修改时间 + } else { + taskInfo.setIsAudit(0);// 修改后状态为未审核 + taskInfo.setEditorId((UserUtils.getUser().getId()).intValue());// 修改人员 + taskInfo.setEditTime(new Date());// 修改时间 taskInfoDao.update(taskInfo); } - + } public TaskInfo getTaskInfoByTaskName(String taskName) { - + return taskInfoDao.getTaskInfoByTaskName(taskName); } + public TaskInfo getTaskInfoById(Long id) { - + return taskInfoDao.getTaskInfoById(id); } + public List getTaskInfoByIds(String ids) { - + return taskInfoDao.getTaskInfoByIds(ids); } - @Transactional(readOnly=false,rollbackFor=DataAccessException.class) - public void taskExamine(String[] exId){ + + @Transactional(readOnly = false, rollbackFor = DataAccessException.class) + public void taskExamine(String[] exId) { TaskInfo taskInfo = new TaskInfo(); for (int i = 0; i < exId.length; i++) { taskInfo.setId(Long.valueOf(exId[i])); - taskInfo.setIsAudit(1);//审核通过 - taskInfo.setIsValid(1);//审核通过 + taskInfo.setIsAudit(1);// 审核通过 + taskInfo.setIsValid(1);// 审核通过 taskInfo.setAuditTime(new Date()); - taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员 + taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());// 审核人员 taskInfoDao.update(taskInfo); } } - @Transactional(readOnly=false,rollbackFor=DataAccessException.class) - public void taskExamineNo(String[] noId){ + + @Transactional(readOnly = false, rollbackFor = DataAccessException.class) + public void taskExamineNo(String[] noId) { TaskInfo taskInfo = new TaskInfo(); for (int i = 0; i < noId.length; i++) { taskInfo.setId(Long.valueOf(noId[i])); - taskInfo.setIsAudit(2);//审核未通过 + taskInfo.setIsAudit(2);// 审核未通过 taskInfo.setAuditTime(new Date()); - taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员 + taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());// 审核人员 taskInfoDao.update(taskInfo); } } - @Transactional(readOnly=false,rollbackFor=DataAccessException.class) - public void taskCancelExamine(String[] cancelId){ + + @Transactional(readOnly = false, rollbackFor = DataAccessException.class) + public void taskCancelExamine(String[] cancelId) { TaskInfo taskInfo = new TaskInfo(); for (int i = 0; i < cancelId.length; i++) { taskInfo.setId(Long.valueOf(cancelId[i])); - taskInfo.setIsAudit(3);//取消审核通过 + taskInfo.setIsAudit(3);// 取消审核通过 taskInfo.setIsValid(0); taskInfo.setAuditTime(new Date()); - taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员 + taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());// 审核人员 taskInfoDao.update(taskInfo); } } - @Transactional(readOnly=false,rollbackFor=DataAccessException.class) - public void delete(String[] delId){ + + @Transactional(readOnly = false, rollbackFor = DataAccessException.class) + public void delete(String[] delId) { for (int i = 0; i < delId.length; i++) { - taskInfoDao.delete(Long.valueOf(delId[i]));//删除 + taskInfoDao.delete(Long.valueOf(delId[i]));// 删除 } } } From cab074abea1d07bf9f058687919a2e58f796e811 Mon Sep 17 00:00:00 2001 From: lihaochen Date: Thu, 27 Dec 2018 10:47:30 +0800 Subject: [PATCH 085/147] =?UTF-8?q?1.=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A1=8C=E4=B8=BA=E7=BB=9F=E8=AE=A1=E3=80=81?= =?UTF-8?q?ASN=E3=80=81HttpsUrl=E6=8A=A5=E8=A1=A8=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E7=9A=84=E8=8C=83=E5=9B=B4(7=E5=A4=A9)=202.Ru=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E6=96=87=E4=BB=B6=E9=87=8D=E6=96=B0=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E4=BA=86=E4=BA=8B=E4=BB=B6=E6=8A=A5=E8=A1=A8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/messages/message_ru.properties | 16 ++++++++-------- .../views/dashboard/trafficUserBehavior.jsp | 14 ++++++++++---- .../WEB-INF/views/report/asnRecordList.jsp | 13 +++++++++---- .../WEB-INF/views/report/urlReportList.jsp | 13 +++++++++---- 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 47dd2640b..6bcc59afd 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1425,12 +1425,12 @@ ntc_event_monitor_report=\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u041c\u043e ntc_event_block_report=\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0411\u043b\u043e\u043a \u041e\u0442\u0447\u0435\u0442 ntc_event_key_protection_report=\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u041e\u0442\u0447\u0435\u0442 task_id=\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 ID -http_num=HTTP \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e -mail_num=\u043f\u043e\u0447\u0442\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e -vedio_count=\u0432\u0438\u0434\u0435\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e -agent_count=\u0418\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e -letter_num=\u043f\u0438\u0441\u044c\u043c\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e -config_num=\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e -monitor_num=\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e -control_num=\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e +http_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e HTTP +mail_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041f\u043e\u0447\u0442 +vedio_count=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0412\u0438\u0434\u0435\u043e +agent_count=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0410\u0433\u0435\u043d\u0442\u043e\u0432 +letter_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041f\u0438\u0441\u0435\u043c +config_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 +monitor_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 +control_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f contains_non_hex_char=Contains non-hexadecimal characters \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp index e004314b1..058e5d178 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp @@ -196,8 +196,11 @@
    - + +<%-- value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${nowTime}'});"/> --%> + +
    @@ -205,8 +208,11 @@
    - + +<%-- value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${nowTime}'});"/> --%> + +
    diff --git a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp index ac09d2665..a74234b59 100644 --- a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp +++ b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp @@ -82,8 +82,11 @@
    - + +<%-- value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + +
    @@ -91,8 +94,10 @@
    - + +<%-- value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> +
    diff --git a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp index 332a54643..507725f12 100644 --- a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp +++ b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp @@ -82,8 +82,11 @@
    - + +<%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + +
    @@ -91,8 +94,10 @@
    - + +<%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> +
    From 73c3b9db1fbf29e25fbb1b707d95bddb1be72d25 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 27 Dec 2018 11:20:55 +0800 Subject: [PATCH 086/147] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=9B=BE=E8=A1=A8=E4=BF=AE=E6=94=B9=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E7=A7=B0=EF=BC=8C=E5=8A=A0=E5=90=8E=E7=BC=80?= =?UTF-8?q?=E6=97=B6=E9=97=B4=EF=BC=8C=E5=AF=BC=E5=87=BAcsv=E7=9A=84?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E9=A2=98=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/ntcTotalReportDetailList.jsp | 3 +- .../dashboard/trafficActionTransList.jsp | 4 +- .../views/dashboard/trafficAppTypeList.jsp | 6 +- .../views/dashboard/trafficBandwidthList.jsp | 86 +++++++++++- .../views/dashboard/trafficDomainTrans.jsp | 109 +++++++++++++++- .../dashboard/trafficHttpStatisticList.jsp | 3 +- .../views/dashboard/trafficIpActiveList.jsp | 56 +++++++- .../views/dashboard/trafficPortActiveList.jsp | 122 +++++++++++++++++- .../dashboard/trafficProtocolTypeList.jsp | 6 +- .../views/dashboard/trafficWebTypeList.jsp | 6 +- 10 files changed, 378 insertions(+), 23 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp index e788ccec9..a559ed833 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -175,7 +175,8 @@ yAxis : { title : { text : null - } + }, + min:0 }, credits : {//是否有highcharts水印 enabled : false diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index a55169841..f6d66ed71 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -145,7 +145,8 @@ function showActionTransChart(xData,series){ yAxis: { title: { text: null - } + }, + min:0 }, credits:{//是否有highcharts水印 enabled:false @@ -286,6 +287,7 @@ function showActionTransChart(xData,series){ H.Chart.prototype.downloadCSV = function() { var rows = this.getDataRows(true); var total = JSON.parse($("#total").val()); + var data=[]; $(rows).each(function (i,d){ if(d!=null){ if(i>0){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index ef254808a..5bc8a8525 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -187,6 +187,7 @@ function ajaxAppList(start,end){ } // 导出列表 $(".export-btn").click(function(){ + var nowDate=new Date(); var dataType = $(this).attr("data-type"); getPageData(1,999999);// 设置导出页条数 var start=$("#beginDate").val(); @@ -201,7 +202,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:"", + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), bootstrap:false }); $("#myexport").click(); @@ -313,6 +314,7 @@ function pageJuan(showData) { function protocolTypeChart(rs){ //终端用户 分操作系统与浏览器 var data=new Array(); + var nowDate=new Date(); $(rs).each(function(i, d) { data.push({ name: d.appName, @@ -334,7 +336,7 @@ function protocolTypeChart(rs){ }, exporting: { allowHTML:true, - filename:"", + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index 1c1d6121e..a604f2a70 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -24,6 +24,8 @@ + +
    @@ -138,8 +140,6 @@ function changeBandwidth(unitType,beginDate,endDate){ async:true, timeout:40000, success:function (data){ - console.log(data) - console.log(1111) var xdata=null; var ipv4data=null; var ipv6data=null; @@ -149,6 +149,8 @@ function changeBandwidth(unitType,beginDate,endDate){ var ipv6data2=null; var tcpdata2=null; var udpdata2=null; + var total=[]; + var total2=[]; if(data!=null&&Object.keys(data).length>0){ if(data.ipv4Type1!=undefined&&data.ipv4Type1!=null){ xdata=data.ipv4Type1.statTime; @@ -172,6 +174,7 @@ function changeBandwidth(unitType,beginDate,endDate){ udpdata=data.trans17Type1.linkNum; } } + total.push(sum(ipv4data),sum(ipv6data),sum(tcpdata),sum(udpdata)); } var series=new Array(); series.push({ @@ -187,6 +190,7 @@ function changeBandwidth(unitType,beginDate,endDate){ name: "UDP", data: udpdata }); + $("#total").val(JSON.stringify(total)); showBandwidthChart("chart1",unitType,xdata,series,"Astana"); if(data!=null&&Object.keys(data).length>0){ @@ -212,6 +216,7 @@ function changeBandwidth(unitType,beginDate,endDate){ udpdata2=data.trans17Type2.linkNum; } } + total2.push(sum(ipv4data2),sum(ipv6data2),sum(tcpdata2),sum(udpdata2)); } var series=new Array(); series.push({ @@ -227,6 +232,7 @@ function changeBandwidth(unitType,beginDate,endDate){ name: "UDP", data: udpdata2 }); + $("#total2").val(JSON.stringify(total2)); showBandwidthChart("chart2",unitType,xdata,series,"Alamty"); closeTip(); }, @@ -241,7 +247,7 @@ function changeBandwidth(unitType,beginDate,endDate){ /* 网络带宽时间维度趋势图 */ function showBandwidthChart(id,unitType,xdata,ydata,title){ - + var nowDate=new Date(); var chart = Highcharts.chart(id, { chart:{ // type: 'area', @@ -264,7 +270,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ }, }, exporting: { - filename:'Bandwidth', + filename:''+title+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 550, @@ -290,7 +296,10 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ }, xAxis:{ type:'category', -// tickmarkPlacement: 'on', + title: { + text: 'time-'+title, + align:'high', + }, labels: { rotation: -45, //倾斜的角度 }, @@ -317,8 +326,8 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ } (function(H) { - var nowDate=new Date(); H.Chart.prototype.downloadXLS = function() { + var nowDate=new Date(); var start=$("#beginDate").val(); var end=$("#endDate").val(); var div = document.createElement('div'), @@ -384,6 +393,71 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ var modifyTime=new Date(chooseDate); $('#endDate').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds())); } +(function(H) { + H.Chart.prototype.downloadCSV = function() { + var rows = this.getDataRows(true); + var data=new Array(); + var total = []; + $(rows).each(function (i,d){ + if(d!=null){ + if(i==0){ + if(d[0].indexOf("Astana") != -1){ + total=JSON.parse($("#total").val()); + } + if(d[0].indexOf("Alamty") != -1){ + total=JSON.parse($("#total2").val()); + } + } + if(i>0){ + data.push({ + num1:d, + }) + } + } + }) + data.push({ + num1:"", + num2:total + }) + var start = $("#beginDate").val(); + var end = $("#endDate").val(); + exportCsv({ + title:["",start+"--"+end], + titleForKey:["num1","num2","num3"], + data:data + }); + }; + }(Highcharts)); + + function exportCsv(obj){ + var nowDate=new Date(); + //title ["","",""] + var title = obj.title; + //titleForKey ["","",""] + var titleForKey = obj.titleForKey; + var data = obj.data; + var str = []; + str.push(obj.title.join(",")+"\n"); + for(var i=0;i \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 020f5627d..3e53308d0 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -24,6 +24,7 @@ + @@ -39,6 +40,7 @@ <%-- --%> + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp index e07489c50..f79884963 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp @@ -169,6 +169,7 @@ $(".export-btn").click(function(){ getPageData(1,999999);// 设置导出页条数 var start=$("#beginDate").val(); var end=$("#endDate").val(); + var nowDate=new Date(); var htmlTitle=""; htmlTitle+="
    "; htmlTitle+= ""; @@ -179,7 +180,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:"service", + fileName:"service"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), bootstrap:false }); $("#myexport").click(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 8bc1272ee..03bf6680d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -167,14 +167,14 @@ function searchList(){ } function showIpActiveChart(xData,series){ - + var nowDate=new Date(); var chart = Highcharts.chart('chart', { chart:{ //type: 'area', zoomType: 'x' }, exporting: { - filename:'', + filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500, @@ -360,8 +360,8 @@ function showIpActiveChart(xData,series){ } (function(H) { - var nowDate=new Date(); H.Chart.prototype.downloadXLS = function() { + var nowDate=new Date(); var div = document.createElement('div'), xlsxRows = [], xlsxColumns = []; @@ -411,6 +411,56 @@ function showIpActiveChart(xData,series){ }); }; }(Highcharts)); + (function(H) { + H.Chart.prototype.downloadCSV = function() { + var rows = this.getDataRows(true); + var data=new Array(); + var total = total = JSON.parse($("#total").val()); + $(rows).each(function (i,d){ + if(d!=null&&i>0){ + data.push({ + num1:d, + }) + } + }) + data.push({ + num1:"", + num2:total + }) + var start = $("#beginDate").val(); + var end = $("#endDate").val(); + exportCsv({ + title:["",start+"--"+end], + titleForKey:["num1","num2"], + data:data + }); + }; + }(Highcharts)); + + function exportCsv(obj){ + var nowDate=new Date(); + //title ["","",""] + var title = obj.title; + //titleForKey ["","",""] + var titleForKey = obj.titleForKey; + var data = obj.data; + var str = []; + str.push(obj.title.join(",")+"\n"); + for(var i=0;i +
    @@ -61,6 +62,7 @@ <%-- --%> + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 35bd75e93..b326b08d0 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -181,6 +181,7 @@ function ajaxProtocolList(start,end){ } // 导出列表 $(".export-btn").click(function(){ + var nowDate=new Date(); var dataType = $(this).attr("data-type"); getPageData(1,999999);// 设置导出页条数 var start=$("#beginDate").val(); @@ -195,7 +196,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:"", + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), bootstrap:false }); $("#myexport").click(); @@ -305,6 +306,7 @@ function pageJuan(showData) { } // 比例协议统计图 function protocolTypeChart(rs){ + var nowDate=new Date(); //终端用户 分操作系统与浏览器 var data=new Array(); $(rs).each(function(i, d) { @@ -329,7 +331,7 @@ function protocolTypeChart(rs){ }, exporting: { allowHTML:true, - filename:"", + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 6e9e9c892..1e5e2fc8c 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -249,6 +249,7 @@ } // 导出列表 $(".export-btn").click(function(){ + var nowDate=new Date(); var dataType = $(this).attr("data-type"); getPageData(1,999999);// 设置导出页条数 var start=$("#beginDate").val(); @@ -263,7 +264,7 @@ headings:true, footers:true, formats:[dataType], - fileName:"", + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), bootstrap:false }); $("#myexport").click(); @@ -395,6 +396,7 @@ // 比例域名统计图 function webTypeChart(rs){ + var nowDate=new Date(); //终端用户 分操作系统与浏览器 var data=new Array(); $(rs).each(function(i, d) { @@ -418,7 +420,7 @@ function webTypeChart(rs){ }, exporting: { allowHTML:true, - filename:"", + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500, From d8614b83156e5da5a940160e08e159a179e63139 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 27 Dec 2018 14:02:34 +0800 Subject: [PATCH 087/147] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=97=A0=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=90=8E=E5=88=86=E9=A1=B5=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp | 5 +++-- .../WEB-INF/views/dashboard/trafficHttpStatisticList.jsp | 5 +++-- .../WEB-INF/views/dashboard/trafficProtocolTypeList.jsp | 7 ++++--- .../webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 5bc8a8525..b245096ed 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -208,7 +208,8 @@ $(".export-btn").click(function(){ $("#myexport").click(); $("caption").remove(); $(".tr-title").remove(); - getPageData(1,10); + getPageData(1,10); + pageJuan(10);//初始化分页 }); /** * 获取本页数据 @@ -239,7 +240,7 @@ function getPageData(currentPage,pageNumber){ function htmlData(fileDataS){ $("#tableData").html(""); - if(fileDataS == null){ + if(fileDataS == null||(fileDataS!=null&&fileDataS.length<1)){ $(".none-data").show(); $('.M-box').hide(); }else{ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp index f79884963..9bebcbf8d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp @@ -186,7 +186,8 @@ $(".export-btn").click(function(){ $("#myexport").click(); $("caption").remove(); $(".tr-title").remove(); - getPageData(1,10); + getPageData(1,10); + pageJuan(10);//初始化分页 }); /** * 获取本页数据 @@ -216,7 +217,7 @@ function getPageData(currentPage,pageNumber){ // 处理接口数据 function htmlData(fileDataS){ $("#tableData").html(""); - if(fileDataS == null){ + if(fileDataS == null||(fileDataS!=null&&fileDataS.length<1)){ $(".none-data").show(); $('.M-box').hide(); }else{ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index b326b08d0..a01b5fbcd 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -202,7 +202,8 @@ $(".export-btn").click(function(){ $("#myexport").click(); $("caption").remove(); $(".tr-title").remove(); - getPageData(1,10); + getPageData(1,10); + pageJuan(10);//初始化分页 }); /** * 获取本页数据 @@ -232,12 +233,12 @@ function getPageData(currentPage,pageNumber){ // 处理接口数据 function htmlData(fileDataS){ $("#tableData").html(""); - if(fileDataS == null){ + if(fileDataS == null||(fileDataS!=null&&fileDataS.length<1)){ $(".none-data").show(); $('.M-box').hide(); }else{ $('.none-data').hide(); - $('.M-box').show(); + $('.M-box').show(); var start=$("#beginDate").val(); var end=$("#endDate").val(); $.each(fileDataS,function (index,data){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 1e5e2fc8c..e7d1e0f37 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -270,7 +270,8 @@ $("#myexport").click(); $("caption").remove(); $(".tr-title").remove(); - getPageData(1, 10); + getPageData(1,10); + pageJuan(10);//初始化分页 }); $("#print-btn").click(function() { window.print(); From e50f8f419d6cdc9785c70f762adcd4482518516a Mon Sep 17 00:00:00 2001 From: leijun Date: Thu, 27 Dec 2018 16:12:22 +0800 Subject: [PATCH 088/147] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=AF=BC=E5=87=BAexcel=E5=90=8E=E6=96=87=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=86=85=E5=AE=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/global/plugins/tableExport-3.3.13/tableexport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js b/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js index 69ea324db..b972d1f85 100644 --- a/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js +++ b/src/main/webapp/static/global/plugins/tableExport-3.3.13/tableexport.js @@ -102,7 +102,7 @@ } } // 当文字过长有省略时取title导出 - var titleText=$(val).text(); + var titleText=$(val).text().trim(); if($(val).attr("title")!=null&&$(val).attr("title")!=""){ titleText=$(val).attr("title"); } From 1948fd6763b60ffb94efc4bbcc989713f5c1697f Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 27 Dec 2018 16:57:42 +0800 Subject: [PATCH 089/147] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=95=8C=E9=9D=A2=E6=96=87=E4=BB=B6=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=A2=9E=E5=8A=A0=E6=97=A5=E6=9C=9F=E5=90=8E=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/ntcTotalReportDetailList.jsp | 6 +- .../dashboard/trafficActionTransList.jsp | 6 +- .../views/dashboard/trafficAppTypeList.jsp | 4 +- .../views/dashboard/trafficBandwidthList.jsp | 6 +- .../views/dashboard/trafficDomainTrans.jsp | 6 +- .../dashboard/trafficHttpStatisticList.jsp | 2 +- .../views/dashboard/trafficIpActiveList.jsp | 6 +- .../views/dashboard/trafficPortActiveList.jsp | 8 +- .../dashboard/trafficProtocolTypeList.jsp | 4 +- .../views/dashboard/trafficWebTypeList.jsp | 4 +- .../webapp/static/pages/scripts/echart.js | 91 +++++++++++-------- 11 files changed, 80 insertions(+), 63 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp index a559ed833..8f2d485f6 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -132,7 +132,7 @@ }, }, exporting : { - filename : ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename : ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale : 1, sourceWidth : 1280, sourceHeight : 500, @@ -278,7 +278,7 @@ }) xlsxRows.push(a) zipcelx({ - filename : ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename : ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), sheet : { data : xlsxRows } @@ -332,7 +332,7 @@ var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join("")); var downloadLink = document.createElement("a"); downloadLink.href = uri; - downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv"; + downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds()+".csv"; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index f6d66ed71..4ea77f05f 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -106,7 +106,7 @@ function showActionTransChart(xData,series){ zoomType: 'x' }, exporting: { - filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale:1, sourceWidth: 1280, sourceHeight: 500, @@ -276,7 +276,7 @@ function showActionTransChart(xData,series){ zipcelx({ - filename: ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename: ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), sheet: { data: xlsxRows } @@ -332,7 +332,7 @@ function showActionTransChart(xData,series){ var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join("")); var downloadLink = document.createElement("a"); downloadLink.href = uri; - downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv"; + downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds()+".csv"; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index b245096ed..c88eb4edc 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -202,7 +202,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), bootstrap:false }); $("#myexport").click(); @@ -337,7 +337,7 @@ function protocolTypeChart(rs){ }, exporting: { allowHTML:true, - filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale:1, sourceWidth: 1280, sourceHeight: 500, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index a604f2a70..ad0a22575 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -270,7 +270,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ }, }, exporting: { - filename:''+title+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename:''+title+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale:1, sourceWidth: 1280, sourceHeight: 550, @@ -379,7 +379,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ zipcelx({ - filename: ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename: ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), sheet: { data: xlsxRows } @@ -448,7 +448,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join("")); var downloadLink = document.createElement("a"); downloadLink.href = uri; - downloadLink.download = ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv"; + downloadLink.download = ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds()+".csv"; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 3e53308d0..e6ac4867a 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -102,7 +102,7 @@ function showDomainTrans(xData,series){ zoomType: 'x' }, exporting: { - filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale:1, sourceWidth: 1280, sourceHeight: 500, @@ -202,7 +202,7 @@ function showDomainTrans(xData,series){ }) xlsxRows.push(a) zipcelx({ - filename : ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename : ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), sheet : { data : xlsxRows } @@ -255,7 +255,7 @@ function exportCsv(obj){ var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join("")); var downloadLink = document.createElement("a"); downloadLink.href = uri; - downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv"; + downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds()+".csv"; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp index 9bebcbf8d..654665375 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp @@ -180,7 +180,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:"service"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + fileName:"service"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), bootstrap:false }); $("#myexport").click(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 03bf6680d..44e2ffa1c 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -174,7 +174,7 @@ function showIpActiveChart(xData,series){ zoomType: 'x' }, exporting: { - filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale:1, sourceWidth: 1280, sourceHeight: 500, @@ -404,7 +404,7 @@ function showIpActiveChart(xData,series){ }) xlsxRows.push(a) zipcelx({ - filename: ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename: ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), sheet: { data: xlsxRows } @@ -456,7 +456,7 @@ function showIpActiveChart(xData,series){ var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join("")); var downloadLink = document.createElement("a"); downloadLink.href = uri; - downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv"; + downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds()+".csv"; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp index 6d24d8fdc..5ab6bb519 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp @@ -91,7 +91,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), bootstrap:false }); $("#myexport").click(); @@ -117,7 +117,7 @@ function showPortActiveChart(xData,series){ zoomType: 'x' }, exporting: { - filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale:1, sourceWidth: 1280, sourceHeight: 500, @@ -350,7 +350,7 @@ function showPortActiveChart(xData,series){ }) xlsxRows.push(a) zipcelx({ - filename: ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename: ''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), sheet: { data: xlsxRows } @@ -402,7 +402,7 @@ function showPortActiveChart(xData,series){ var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join("")); var downloadLink = document.createElement("a"); downloadLink.href = uri; - downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv"; + downloadLink.download = ""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds()+".csv"; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index a01b5fbcd..988d525f1 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -196,7 +196,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), bootstrap:false }); $("#myexport").click(); @@ -332,7 +332,7 @@ function protocolTypeChart(rs){ }, exporting: { allowHTML:true, - filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale:1, sourceWidth: 1280, sourceHeight: 500, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index e7d1e0f37..51a02f508 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -264,7 +264,7 @@ headings:true, footers:true, formats:[dataType], - fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), bootstrap:false }); $("#myexport").click(); @@ -421,7 +421,7 @@ function webTypeChart(rs){ }, exporting: { allowHTML:true, - filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(), scale:1, sourceWidth: 1280, sourceHeight: 500, diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 553d3ff02..3a9404b94 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -21,15 +21,15 @@ var inoctetsNum=d.count; unit=changeUnit(inoctetsNum); inoctetsNum=changeNum(inoctetsNum); - var pktNum=new Array(); - var byteLen=new Array(); +// var pktNum=new Array(); +// var byteLen=new Array(); //协议图-操作系统 data.push({ name: d.protoType, y: parseFloat(inoctetsNum), // drilldown: d.protoType, }); - +/* pktNum[0]="pktNum"; pktNum[1]=parseInt(d.pktNum); byteLen[0]="byteLen"; @@ -41,7 +41,7 @@ type:'pie', innerSize: '70%', data: [pktNum,byteLen], - }); + });*/ }); var chart = Highcharts.chart('chart_1', { @@ -63,7 +63,7 @@ }, exporting: { allowHTML:true, - filename:'Protocol-Type', + filename:'Protocol-Type'+addDateName(), chartOptions: { plotOptions: { series: { @@ -257,7 +257,7 @@ //}, exporting: { allowHTML:true, - filename:'Active-IP', + filename:'Active-IP'+addDateName(), chartOptions: { plotOptions: { series: { @@ -482,7 +482,7 @@ },*/ exporting: { allowHTML:true, - filename:'App', + filename:'App'+addDateName(), buttons: exportingButton('#415262') }, noData:{ @@ -634,7 +634,7 @@ function echart_2(rs){ }, exporting: { allowHTML:true, - filename:'BS', + filename:'BS'+addDateName(), chartOptions: { plotOptions: { series: { @@ -787,7 +787,7 @@ function echart_5(rs){ },*/ exporting: { allowHTML:true, - filename:'BS', + filename:'BS'+addDateName(), chartOptions: { plotOptions: { series: { @@ -899,31 +899,31 @@ function echart_4(rs){ var data=new Array(); // var drillData=new Array(); var unit="bytes"; - $(rs).each(function(i, d) { - var inoctetsNum=d.count; - unit=changeUnit(inoctetsNum); - inoctetsNum=changeNum(inoctetsNum); -// var pktNum=new Array(); -// var byteLen=new Array(); - data.push({ - name: d.websiteService, - y: parseFloat(inoctetsNum), -// drilldown: d.websiteService, + $(rs).each(function(i, d) { + var inoctetsNum=d.count; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); + // var pktNum=new Array(); + // var byteLen=new Array(); + data.push({ + name: d.websiteService, + y: parseFloat(inoctetsNum), + // drilldown: d.websiteService, + }); + + /* pktNum[0]="pktNum"; + pktNum[1]=parseInt(d.pktNum); + byteLen[0]="byteLen"; + byteLen[1]=parseInt(d.byteLen); + + drillData.push({ + name: d.websiteService, + id: d.websiteService, + type:'pie', + data: [pktNum,byteLen], + });*/ + }); - -/* pktNum[0]="pktNum"; - pktNum[1]=parseInt(d.pktNum); - byteLen[0]="byteLen"; - byteLen[1]=parseInt(d.byteLen); - - drillData.push({ - name: d.websiteService, - id: d.websiteService, - type:'pie', - data: [pktNum,byteLen], - });*/ - - }); // 创建图例 var chart = Highcharts.chart('chart_4',{ chart: { @@ -935,7 +935,7 @@ function echart_4(rs){ }, exporting: { allowHTML:true, - filename:'Website', + filename:'Website'+addDateName(), chartOptions: { plotOptions: { series: { @@ -1082,7 +1082,7 @@ function echart_6(rs){ },*/ exporting: { allowHTML:true, - filename:'Website', + filename:'Website'+addDateName(), chartOptions: { plotOptions: { series: { @@ -1181,7 +1181,7 @@ function echart_topic_domain(rs){ var data=[{ 'id': '0.0', // 'parent': '', - 'name': 'TOPIC' + 'name': 'Service' }]; var unit="bytes"; $(rs).each(function(i,d){ @@ -1228,7 +1228,7 @@ function echart_topic_domain(rs){ },*/ exporting: { allowHTML:true, - filename:'Topic', + filename:'Service'+addDateName(), chartOptions: { plotOptions: { series: { @@ -1361,3 +1361,20 @@ function exportingButton(color) { }; return button; } +// 加时间后缀名 +function addDateName(){ + var nowDate=new Date(); + var myDate = new Date(); + //获取当前年 + var year=myDate.getFullYear(); + //获取当前月 + var month=myDate.getMonth()+1; + //获取当前日 + var date=myDate.getDate(); + var h=myDate.getHours(); //获取当前小时数(0-23) + var m=myDate.getMinutes(); //获取当前分钟数(0-59) + var s=myDate.getSeconds(); + + var now=year+""+month+""+date+""+h+""+m+""+s; + return now; +} From 09705aca19f740a730625b5974505be0ff2b585a Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Thu, 27 Dec 2018 17:28:44 +0800 Subject: [PATCH 090/147] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE=E6=8F=8F=E8=BF=B0=E3=80=81?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6?= =?UTF-8?q?=EF=BC=9B=E9=83=A8=E5=88=86=E6=8A=A5=E8=A1=A8=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckComplexStringFormatThread.java | 8 +++++ .../excel/thread/CheckIpFormatThread.java | 5 +++ .../excel/thread/CheckStringFormatThread.java | 8 +++++ .../resources/messages/message_en.properties | 5 ++- .../resources/messages/message_ru.properties | 5 ++- .../messages/message_zh_CN.properties | 5 ++- src/main/webapp/WEB-INF/views/report/list.jsp | 31 +++++++++++++++++-- 7 files changed, 62 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java index d9b25ddc3..20bd6bf07 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java @@ -90,6 +90,14 @@ public class CheckComplexStringFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); ComplexkeywordCfg baseStringCfg = new ComplexkeywordCfg(); BeanUtils.copyProperties(list.get(i), baseStringCfg); + // 配置描述、关键字长度限制 + if(baseStringCfg.getCfgDesc().length() > 128) { + errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); + } + if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){ + errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";"); + } + if (regionDict.getRegionType().equals(3)) { if (regionDict.getFunctionId().equals(7)) { Long dnsStrategyId = baseStringCfg.getDnsStrategyId(); 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 8b70610c6..5d849ba57 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java @@ -103,6 +103,11 @@ public class CheckIpFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); IpPortCfg baseIpCfg = new IpPortCfg(); BeanUtils.copyProperties(list.get(i), baseIpCfg); + // 配置描述长度限制 + if(baseIpCfg.getCfgDesc().length() > 128) { + errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); + } + // 特殊字段验证 // packet ip ratelimit if (serviceDict!=null&&serviceDict.getFunctionId().intValue() == 5 && serviceDict.getAction().intValue() == 64) { diff --git a/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java index 8bfa9a4dd..df3afa7b7 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java @@ -88,6 +88,14 @@ public class CheckStringFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); BaseStringCfg baseStringCfg = new BaseStringCfg(); BeanUtils.copyProperties(list.get(i), baseStringCfg); + // 配置描述、关键字长度限制 + if(baseStringCfg.getCfgDesc().length() > 128) { + errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); + } + if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){ + errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";"); + } + if (regionDict.getRegionType().equals(2)) { if (regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())) { String userRegion1 = baseStringCfg.getUserRegion1(); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 85bcc5382..4ac9e3449 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1429,4 +1429,7 @@ letter_num=LETTER config_num=CONFIG monitor_num=MONITOR control_num=CONTROL -contains_non_hex_char=Contains non-hexadecimal characters \ No newline at end of file +contains_non_hex_char=Contains non-hexadecimal characters +max_length=Maximum Length +min_length=Minimum Length +length_error=Length Error \ 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 6bcc59afd..88876c992 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1433,4 +1433,7 @@ letter_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041f\u config_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 monitor_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 control_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f -contains_non_hex_char=Contains non-hexadecimal characters \ No newline at end of file +contains_non_hex_char=Contains non-hexadecimal characters +max_length=Maximum Length +min_length=Minimum Length +length_error=Length Error \ 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 a66fb7f33..aa202ad5f 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1429,4 +1429,7 @@ letter_num=\u6765\u51fd\u4ef6\u6570 config_num=\u914d\u7f6e\u603b\u6570 monitor_num=\u76d1\u6d4b\u6570\u91cf control_num=\u7ba1\u63a7\u6570\u91cf -contains_non_hex_char=\u5305\u542b\u975e\u5341\u516d\u8fdb\u5236\u5b57\u7b26 \ No newline at end of file +contains_non_hex_char=\u5305\u542b\u975e\u5341\u516d\u8fdb\u5236\u5b57\u7b26 +max_length=\u6700\u5927\u957F\u5EA6 +min_length=\u6700\u5C0F\u957F\u5EA6 +length_error=\u957F\u5EA6\u9519\u8BEF \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index a5c7c933e..026f57216 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -121,9 +121,36 @@ $(document).ready(function() { var action = ""; } var reportType = $("[name=reportType]").find('[value=' + "${bean.reportType}" + ']').text() + "_"; - var reportTime = "${bean.reportTime}"; - return cfgName + action + reportType + reportTime; + //var reportTime = "${bean.reportTime}"; + return cfgName + action + reportType + getStringFormatDate(); } + + function getStringFormatDate() { + var date = new Date(); + var year = date.getFullYear(); + var month = date.getMonth() + 1; + var strDate = date.getDate(); + var hours = date.getHours(); + var minutes = date.getMinutes(); + var seconds = date.getSeconds(); + if (month >= 1 && month <= 9) { + month = "0" + month; + } + if (strDate >= 0 && strDate <= 9) { + strDate = "0" + strDate; + } + if (hours >= 1 && hours <= 9) { + hours = "0" + hours; + } + if (minutes >= 1 && minutes <= 9) { + minutes = "0" + minutes; + } + if (seconds >= 1 && seconds <= 9) { + seconds = "0" + seconds; + } + var currentdate = year+""+ month+""+strDate+""+ hours+""+ minutes+""+seconds; + return currentdate; + } var reportDate=0; function changeReportType(reportType) { From f4acc8f0637f65c3d29cfaa57892a308475ebdde Mon Sep 17 00:00:00 2001 From: lihaochen Date: Thu, 27 Dec 2018 18:06:07 +0800 Subject: [PATCH 091/147] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=EF=BC=9A=201.ASN=E3=80=81HttpsUrl=E3=80=81=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E7=95=8C?= =?UTF-8?q?=E9=9D=A2,=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9D=A1=E4=BB=B6=E8=BF=9B=E8=A1=8C=E4=BA=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=8C=83=E5=9B=B4=E7=AD=96=E7=95=A5=202.=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=8A=A5=E8=A1=A8,=E5=A2=9E=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E5=90=8D=E7=A7=B0=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E5=9B=9E=E6=98=BE,=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E8=BF=9B=E8=A1=8C=E4=BA=86?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E7=AD=96=E7=95=A5=E4=BF=AE=E6=94=B9=203.?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=86=E4=BA=8B=E4=BB=B6=E7=9B=91=E6=B5=8B?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AF=BC=E5=87=BA=E5=AE=8C=E6=88=90=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E6=90=9C=E7=B4=A2=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/NtcEventBlockController.java | 2 + .../NtcEventKeyProtectionController.java | 6 +- .../report/NtcEventMonitorController.java | 2 + .../views/dashboard/trafficUserBehavior.jsp | 9 +- .../WEB-INF/views/report/asnRecordList.jsp | 10 ++- .../WEB-INF/views/report/eventBlockList.jsp | 64 +++++++------- .../views/report/eventKeyProtectionList.jsp | 66 +++++++------- .../WEB-INF/views/report/eventMonitorList.jsp | 87 +++++++++---------- .../WEB-INF/views/report/urlReportList.jsp | 8 +- 9 files changed, 138 insertions(+), 116 deletions(-) diff --git a/src/main/java/com/nis/web/controller/report/NtcEventBlockController.java b/src/main/java/com/nis/web/controller/report/NtcEventBlockController.java index 08b7856f4..6e4e2a813 100644 --- a/src/main/java/com/nis/web/controller/report/NtcEventBlockController.java +++ b/src/main/java/com/nis/web/controller/report/NtcEventBlockController.java @@ -136,6 +136,8 @@ public class NtcEventBlockController extends BaseController { Map noExportMap = new HashMap(); // --------------------------- PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); Map params = new HashMap(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); diff --git a/src/main/java/com/nis/web/controller/report/NtcEventKeyProtectionController.java b/src/main/java/com/nis/web/controller/report/NtcEventKeyProtectionController.java index 197672902..e3fe6edf7 100644 --- a/src/main/java/com/nis/web/controller/report/NtcEventKeyProtectionController.java +++ b/src/main/java/com/nis/web/controller/report/NtcEventKeyProtectionController.java @@ -94,7 +94,7 @@ public class NtcEventKeyProtectionController extends BaseController { params.put("taskIds", log.getTaskIds()); } - String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report; + String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_KEYPROTECTION_Report; // String url = // "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventKeyProtection"; String recv = HttpClientUtil.getMsg(url, params, request); @@ -135,6 +135,8 @@ public class NtcEventKeyProtectionController extends BaseController { Map noExportMap = new HashMap(); // --------------------------- PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); Map params = new HashMap(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); @@ -173,7 +175,7 @@ public class NtcEventKeyProtectionController extends BaseController { log.setSearchTaskStartTime(searchTaskStartTime); log.setSearchTaskEndTime(searchTaskEndTime); - String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report; + String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_KEYPROTECTION_Report; // String url = // "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventKeyProtection"; String recv = HttpClientUtil.getMsg(url, params, request); diff --git a/src/main/java/com/nis/web/controller/report/NtcEventMonitorController.java b/src/main/java/com/nis/web/controller/report/NtcEventMonitorController.java index b91e67e08..014d3fd04 100644 --- a/src/main/java/com/nis/web/controller/report/NtcEventMonitorController.java +++ b/src/main/java/com/nis/web/controller/report/NtcEventMonitorController.java @@ -141,6 +141,8 @@ public class NtcEventMonitorController extends BaseController { Map noExportMap = new HashMap(); // --------------------------- PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); Map params = new HashMap(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp index 058e5d178..1d2867364 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficUserBehavior.jsp @@ -158,6 +158,13 @@ return false; } + function setReportTime(){ + var chooseDate=new Date($('#searchFoundStartTime').val()); + chooseDate=chooseDate.setDate(chooseDate.getDate()+7); + var modifyTime=new Date(chooseDate); + $('#searchFoundEndTime').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds())); + } + @@ -200,7 +207,7 @@ <%-- value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${nowTime}'});"/> --%> + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:setReportTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchFoundEndTime\')}'});"/>
    diff --git a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp index a74234b59..8ba77f141 100644 --- a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp +++ b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp @@ -44,6 +44,14 @@ }; $("div#"+content+"").printArea(options); } + + function setReportTime(){ + var chooseDate=new Date($('#searchFoundStartTime').val()); + chooseDate=chooseDate.setDate(chooseDate.getDate()+7); + var modifyTime=new Date(chooseDate); + $('#searchFoundEndTime').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds())); + } + @@ -86,7 +94,7 @@ <%-- value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:setReportTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchFoundEndTime\')}'});"/>
    diff --git a/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp b/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp index 76fdd80ed..cf0804c5e 100644 --- a/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp @@ -3,11 +3,12 @@ - <spring:message code="https_url_report"/> + <spring:message code="ntc_event_block_report"/> @@ -67,44 +91,18 @@ +
    - - - -<%-- --%> - -<%-- --%> - - - - - -<%-- --%> - - -<%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> - - - - - -<%-- --%> - - -<%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> - - -
    - " class="selectpicker form-control input-medium" data-max-options="10" data-selected-text-format="count > 3" multiple data-live-search="true" data-live-search-placeholder=""> @@ -146,7 +144,7 @@
    + value="${log.searchTaskStartTime}" onclick="WdatePicker({onpicked:setTaskTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchTaskEndTime\')}'});"/>
    @@ -167,7 +165,7 @@
    + value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:setReportTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchReportEndTime\')}'});"/>
    diff --git a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp index e7cd9968a..406121c95 100644 --- a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp @@ -3,11 +3,12 @@ - <spring:message code="https_url_report"/> + <spring:message code="ntc_event_key_protection_report"/> @@ -67,45 +92,18 @@ +
    - - - -<%-- --%> - -<%-- --%> - - - - - - -<%-- --%> - - -<%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> - - - - - -<%-- --%> - - -<%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> - - -
    - " class="selectpicker form-control input-medium" data-max-options="10" data-selected-text-format="count > 3" multiple data-live-search="true" data-live-search-placeholder=""> @@ -147,7 +145,7 @@
    + value="${log.searchTaskStartTime}" onclick="WdatePicker({onpicked:setTaskTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchTaskEndTime\')}'});"/>
    @@ -168,7 +166,7 @@
    + value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:setReportTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchReportEndTime\')}'});"/>
    diff --git a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp index 0c4e64b3c..53f463082 100644 --- a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp @@ -3,11 +3,13 @@ - <spring:message code="https_url_report"/> + <spring:message code="ntc_event_monitor_report"/> @@ -67,60 +101,25 @@ - +
    - - - -<%-- --%> - -<%-- --%> - - - - - -<%-- --%> - -<%-- --%> - -
    - " class="selectpicker form-control input-medium" data-max-options="10" data-selected-text-format="count > 3" multiple data-live-search="true" data-live-search-placeholder="">
    - - - - -<%-- --%> - - -<%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> - - - - - -<%-- --%> - - -<%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> - -
    @@ -133,8 +132,8 @@
    + value="${log.searchTaskStartTime}" onclick="WdatePicker({onpicked:setTaskTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchTaskEndTime\')}'});"/>
    @@ -176,7 +175,7 @@
    + value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:setReportTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchReportEndTime\')}'});"/>
    diff --git a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp index 507725f12..f13d9d96f 100644 --- a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp +++ b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp @@ -50,6 +50,12 @@ // ajaxConnPercent(); }); + function setReportTime(){ + var chooseDate=new Date($('#searchReportStartTime').val()); + chooseDate=chooseDate.setDate(chooseDate.getDate()+7); + var modifyTime=new Date(chooseDate); + $('#searchReportEndTime').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds())); + } @@ -86,7 +92,7 @@ <%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:setReportTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchReportEndTime\')}'});"/>
    From 2be0bfc1d9cb56e86e3eab9bda9759cb138ddbcd Mon Sep 17 00:00:00 2001 From: lihaochen Date: Thu, 27 Dec 2018 18:54:37 +0800 Subject: [PATCH 092/147] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=EF=BC=9A=E5=A2=9E=E5=8A=A0=E4=BA=8B=E4=BB=B6=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=20=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=B8=8A=E6=98=BE=E7=A4=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/controller/report/NtcEventBlockController.java | 5 +++++ .../controller/report/NtcEventKeyProtectionController.java | 5 +++++ .../nis/web/controller/report/NtcEventMonitorController.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/main/java/com/nis/web/controller/report/NtcEventBlockController.java b/src/main/java/com/nis/web/controller/report/NtcEventBlockController.java index 6e4e2a813..5192b6522 100644 --- a/src/main/java/com/nis/web/controller/report/NtcEventBlockController.java +++ b/src/main/java/com/nis/web/controller/report/NtcEventBlockController.java @@ -94,6 +94,11 @@ public class NtcEventBlockController extends BaseController { params.put("taskIds", log.getTaskIds()); } + log.setSearchReportStartTime(searchReportStartTime); + log.setSearchReportEndTime(searchReportEndTime); + log.setSearchTaskStartTime(searchTaskStartTime); + log.setSearchTaskEndTime(searchTaskEndTime); + params.put("reportType", 1); String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report; diff --git a/src/main/java/com/nis/web/controller/report/NtcEventKeyProtectionController.java b/src/main/java/com/nis/web/controller/report/NtcEventKeyProtectionController.java index e3fe6edf7..3f37dfbb6 100644 --- a/src/main/java/com/nis/web/controller/report/NtcEventKeyProtectionController.java +++ b/src/main/java/com/nis/web/controller/report/NtcEventKeyProtectionController.java @@ -93,6 +93,11 @@ public class NtcEventKeyProtectionController extends BaseController { if (StringUtils.isNotBlank(log.getTaskIds())) { params.put("taskIds", log.getTaskIds()); } + + log.setSearchReportStartTime(searchReportStartTime); + log.setSearchReportEndTime(searchReportEndTime); + log.setSearchTaskStartTime(searchTaskStartTime); + log.setSearchTaskEndTime(searchTaskEndTime); String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_KEYPROTECTION_Report; // String url = diff --git a/src/main/java/com/nis/web/controller/report/NtcEventMonitorController.java b/src/main/java/com/nis/web/controller/report/NtcEventMonitorController.java index 014d3fd04..cc13a89dc 100644 --- a/src/main/java/com/nis/web/controller/report/NtcEventMonitorController.java +++ b/src/main/java/com/nis/web/controller/report/NtcEventMonitorController.java @@ -97,6 +97,11 @@ public class NtcEventMonitorController extends BaseController { if (StringUtils.isNotBlank(log.getTaskIds())) { params.put("taskIds", log.getTaskIds()); } + + log.setSearchReportStartTime(searchReportStartTime); + log.setSearchReportEndTime(searchReportEndTime); + log.setSearchTaskStartTime(searchTaskStartTime); + log.setSearchTaskEndTime(searchTaskEndTime); params.put("reportType", 2); From 1efe1a21c508d5c9641193f2b5c8ca6eed762050 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 27 Dec 2018 19:06:23 +0800 Subject: [PATCH 093/147] =?UTF-8?q?=E5=9F=9F=E5=90=8D=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=8E=BB=E6=8E=89=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp | 1 + .../webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index e6ac4867a..349c723ed 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -149,6 +149,7 @@ function showDomainTrans(xData,series){ }, plotOptions: { series: { + lineWidth:1, marker: { radius: 2, hover: { diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 51a02f508..f995e92a6 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -367,10 +367,13 @@ top: '1%', draggable:false, width: $(document).width()*0.9, - height:$(document).height()*0.9, + height:$(document).height()*0.8, showScrolling: false, /* 是否显示浏览的滚动条 */ iframeScrolling: 'no', - buttons: { 'close': true } + buttons: { 'close': true }, + loaded:function(h){ + $(".jbox-content,top.document").css("overflow-y","hidden") + } }); } /** From fdddf572f648f557c9451d4547da69356adca334 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Thu, 27 Dec 2018 20:40:47 +0600 Subject: [PATCH 094/147] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BF=84=E8=AF=AD?= =?UTF-8?q?=E7=9A=84=E7=89=B9=E6=AE=8A=E7=AC=A6=E5=8F=B7=E4=B9=B1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/messages/message_ru.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 88876c992..4cf9229bd 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1366,7 +1366,7 @@ framed_ip=Framed IP Address log_user_name=User Name av_tips=\u041a\u043e\u0433\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u043e \u0438 \u0432\u0438\u0434\u0435\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0432\u0438\u0434\u0435\u043e \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u043e\u043b\u0435\u0435 1080p.\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. asn_ip_group_delete=\uff08IP configuration under this ASN group will also be deleted.) -keyword_log_tips=\u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u043b\u043e\u0445\u0438\u043c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0435\u0434\u0443\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \ufffd\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 URL\ufffd \u0434\u043b\u044f \u043f\u043e\u0434\u0430\u0432\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430. +keyword_log_tips=\u041A\u043E\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043A\u043B\u044E\u0447\u0435\u0432\u044B\u043C\u0438 \u0441\u043B\u043E\u0432\u0430\u043C\u0438 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u043B\u043E\u0445\u0438\u043C, \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0434\u0435\u0434\u0443\u043F\u043B\u0438\u043A\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0436\u0443\u0440\u043D\u0430\u043B\u0430 \u0434\u0430\u043D\u043D\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044E \u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 URL \u0434\u043B\u044F \u043F\u043E\u0434\u0430\u0432\u0448\u0435\u0433\u043E \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430. conn_record=Connection Records bps=Gbps bps_percent=Bps Percent From c46f0f5f431faede306a0fa1a57989ca8d577620 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Thu, 27 Dec 2018 20:51:35 +0600 Subject: [PATCH 095/147] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=84=E8=AF=AD?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/messages/message_ru.properties | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 4cf9229bd..5c47926be 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1359,56 +1359,56 @@ translated_dest_ip=\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\ translated_dest_port=\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u041f\u043e\u0440\u0442 \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f show_ips=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0412\u0441\u0435 IP show_available_ips=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 IP -radius_log=Radius Identify -message_type=Code -nas_ip=NAS IP Address -framed_ip=Framed IP Address -log_user_name=User Name -av_tips=\u041a\u043e\u0433\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u043e \u0438 \u0432\u0438\u0434\u0435\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0432\u0438\u0434\u0435\u043e \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u043e\u043b\u0435\u0435 1080p.\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. -asn_ip_group_delete=\uff08IP configuration under this ASN group will also be deleted.) +radius_log=Radius \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043E\u0432\u0430\u0442\u044C +message_type=\u041A\u043E\u0434 +nas_ip=NAS IP-\u0430\u0434\u0440\u0435\u0441 +framed_ip=Framed IP-\u0430\u0434\u0440\u0435\u0441 +log_user_name=\u0418\u043C\u044F \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F +av_tips=\u0421\u0438\u0441\u0442\u0435\u043C\u0430 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u043D\u0434\u0435\u043A\u0441\u043D\u0443\u044E \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E \u0430\u0443\u0434\u0438\u043E \u0438 \u0432\u0438\u0434\u0435\u043E \u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0432 \u0445\u0432\u043E\u0441\u0442\u0435 \u0430\u0443\u0434\u0438\u043E \u0438 \u0432\u0438\u0434\u0435\u043E \u0444\u0430\u0439\u043B\u043E\u0432. \u0421\u0438\u0441\u0442\u0435\u043C\u0430 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0438\u0434\u0435\u043E \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435\u043C \u0432\u044B\u0448\u0435 1080P. +asn_ip_group_delete=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F IP \u0432 \u044D\u0442\u043E\u0439 \u0433\u0440\u0443\u043F\u043F\u0435 ASN \u0442\u0430\u043A\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043B\u0435\u043D\u0430. keyword_log_tips=\u041A\u043E\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043A\u043B\u044E\u0447\u0435\u0432\u044B\u043C\u0438 \u0441\u043B\u043E\u0432\u0430\u043C\u0438 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u043B\u043E\u0445\u0438\u043C, \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0434\u0435\u0434\u0443\u043F\u043B\u0438\u043A\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0436\u0443\u0440\u043D\u0430\u043B\u0430 \u0434\u0430\u043D\u043D\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044E \u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 URL \u0434\u043B\u044F \u043F\u043E\u0434\u0430\u0432\u0448\u0435\u0433\u043E \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430. -conn_record=Connection Records +conn_record=\u0417\u0430\u043F\u0438\u0441\u0438 \u041F\u043E\u0434\u043A\u044E\u0447\u0435\u043D\u0438\u0439 bps=Gbps bps_percent=Bps Percent pps=PPS pps_percent=pps Percent -spoofing_ip_object=Spoofing IP Pool -spoofing_ip_policy=IP Spoofing -action_spoofing=Spoofing -spoofing=spoofing +spoofing_ip_object=\u041F\u0443\u043B IP \u0421\u043F\u0443\u0444\u0438\u043D\u0433 +spoofing_ip_policy=IP \u0421\u043F\u0443\u0444\u0438\u043D\u0433 +action_spoofing=\u0421\u043F\u0443\u0444\u0438\u043D\u0433 +spoofing=\u0421\u043F\u0443\u0444\u0438\u043D\u0433 service=\u0421\u0435\u0440\u0432\u0438\u0441 s_asn=SASN d_asn=DASN -asn_conn_report=ASN Statistics -https_url_report=Http(s) URL Statistics +asn_conn_report=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 ASN +https_url_report=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 Http(s) URL url=URL sum=SUM -url_count=URL Count -ip_range_report=IN/EX Host Identity -ip_start=Start IP -ip_end=End IP +url_count=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E URL +ip_range_report=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u0425\u043E\u0441\u0442\u043E\u0432 \u0432 \u0433\u0440\u0430\u043D\u0438\u0446\u0430\u0445 \u0438 \u0437\u0430 \u0433\u0440\u0430\u043D\u0438\u0446\u0435\u0439 +ip_start=\u041D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0439 IP +ip_end=\u041A\u043E\u043D\u0435\u0447\u043D\u044B\u0439 IP ip_start_num=IP Start Num ip_end_num=IP End Num -ip_sub=IP Subnet -start_ip=Start IP -end_ip=End IP -action_detail=Action Detail -pass=\u041f\u0430\u0441 +ip_sub=IP-\u043F\u043E\u0434\u0441\u0435\u0442\u044C +start_ip=\u041D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0439 IP +end_ip=\u041A\u043E\u043D\u0435\u0447\u043D\u044B\u0439 IP +action_detail=\u0414\u0435\u0442\u0430\u043B\u044C \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F +pass=\u041F\u0430\u0441 live_link=\u0410\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0421\u0441\u044b\u043b\u043a\u0430 -area_type=Area Type -dns_group_manage=DNS Group Manage -asn_group_manage=ASN Group Manage -ip_group_manage=IP Group Manage -ip_spoofing_group_manage=IP Spoofing Group Manage -min_tcp=Min -max_tcp=Max -APP_TCP_SESSION_BYTE=Session -ip_count=Unique IP Count -counnection_count=Connection Count +area_type=\u0422\u0438\u043F \u0417\u043E\u043D\u044B +dns_group_manage=\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 DNS \u0433\u0440\u0443\u043F\u043F\u043E\u0439 +asn_group_manage=\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 ASN \u0433\u0440\u0443\u043F\u043F\u043E\u0439 +ip_group_manage=\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 IP \u0433\u0440\u0443\u043F\u043F\u043E\u0439 +ip_spoofing_group_manage=\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u041F\u0443\u043B\u043E\u043C IP \u0421\u043F\u0443\u0444\u0438\u043D\u0433 +min_tcp=\u041C\u0438\u043D. +max_tcp=\u041C\u0430\u043A\u0441. +APP_TCP_SESSION_BYTE=\u0421\u0435\u0430\u043D\u0441 +ip_count=Uniq-IP +counnection_count=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0439 asn=ASN Unique_num=Unique ip=IP -country=Country +country=\u0421\u0442\u0440\u0430\u043D\u0430 desc=Desc unique_num=Unique import_limit_is=The maximum import size is From 6b189ec76821443af26857e637eaf714e83212bc Mon Sep 17 00:00:00 2001 From: zhangwei Date: Thu, 27 Dec 2018 21:00:23 +0600 Subject: [PATCH 096/147] =?UTF-8?q?=E4=BF=AE=E6=94=B9ip=20spoofing?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=80=BB=E8=BE=91=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?spoofing=20ip=20pool=E9=85=8D=E7=BD=AE=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=9C=A8ip=20spoofing=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BAip=20pool=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8Cip=20spoofing=E7=AD=96=E7=95=A5=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=E4=B8=8E=E5=8F=96=E6=B6=88=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=90=8C=E6=97=B6=E5=AE=A1=E6=A0=B8=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=E6=88=96=E5=8F=96=E6=B6=88ip=20pool=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/PxyObjSpoofingIpPool.java | 3 + .../proxy/InterceptController.java | 21 ++- .../proxy/PxyObjSpoofingIpPoolController.java | 4 +- .../configuration/PxyObjSpoofingIpPoolDao.xml | 7 +- .../configuration/InterceptCfgService.java | 137 +++++++++++++++++- .../PxyObjSpoofingIpPoolService.java | 1 + .../views/cfg/intercept/interceptForm.jsp | 10 +- .../views/cfg/intercept/interceptList.jsp | 9 +- .../views/cfg/proxy/spoofingIpPool/form.jsp | 5 +- 9 files changed, 173 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/PxyObjSpoofingIpPool.java b/src/main/java/com/nis/domain/configuration/PxyObjSpoofingIpPool.java index 7c712c3b8..3ad6d3760 100644 --- a/src/main/java/com/nis/domain/configuration/PxyObjSpoofingIpPool.java +++ b/src/main/java/com/nis/domain/configuration/PxyObjSpoofingIpPool.java @@ -52,6 +52,9 @@ public class PxyObjSpoofingIpPool extends BaseIpCfg{ this.ipAddress = ipAddress; } public Integer getGroupId() { + if(groupId==null || groupId==0){ + groupId=cfgId.intValue(); + } return groupId; } public void setGroupId(Integer groupId) { diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java index 7ac57414d..cec2841c1 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java @@ -26,6 +26,7 @@ import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.InterceptPktBin; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.PxyObjKeyring; +import com.nis.domain.configuration.PxyObjSpoofingIpPool; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.util.DictUtils; @@ -60,9 +61,18 @@ public class InterceptController extends CommonController { certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); } model.addAttribute("certificateList", certificateList); - // IP地址仿冒策略使用策略组 - List policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6); - model.addAttribute("policyGroups", policyGroups); + /*if(cfg.getFunctionId().equals(214)){ + // IP地址仿冒策略使用策略组 + //List policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6); + List list = page.getList(); + for(CfgIndexInfo c:list){ + Long cfgId = Long.parseLong(c.getUserRegion2());//user_region2字段存储的为IP仿冒池的ID信息(策略组ID) + PxyObjSpoofingIpPool pool = pxyObjSpoofingIpPoolService.getPxyObjSpoofingIpPool(cfgId); + c.setUserRegion2(pool.getGroupName());//将IP仿冒池的策略组名重新赋给user_region2 + } + +// model.addAttribute("policyGroups", policyGroups); + }*/ return "/cfg/intercept/interceptList"; } @@ -86,8 +96,9 @@ public class InterceptController extends CommonController { model.addAttribute("_cfg", entity); // IP地址仿冒策略使用策略组 - List policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6); - model.addAttribute("policyGroups", policyGroups); +// List policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6); +// List pools = pxyObjSpoofingIpPoolService.findPxyObjSpoofingIpPools(new PxyObjSpoofingIpPool()); +// model.addAttribute("policyGroups", pools); return "/cfg/intercept/interceptForm"; } diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjSpoofingIpPoolController.java b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjSpoofingIpPoolController.java index 1587ce73e..50bba33a1 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjSpoofingIpPoolController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjSpoofingIpPoolController.java @@ -89,7 +89,7 @@ public class PxyObjSpoofingIpPoolController extends BaseController { model.addAttribute("isAdd", true); } - List groups=policyGroupInfoService.findPolicyGroupInfosByType(6); + /*List groups=policyGroupInfoService.findPolicyGroupInfosByType(6); List policyGroups = new ArrayList(); //解决目前一个分组只能有一个生效IP for(PolicyGroupInfo group:groups){ @@ -101,7 +101,7 @@ public class PxyObjSpoofingIpPoolController extends BaseController { policyGroups.add(group); } } - model.addAttribute("policyGroups", policyGroups); + model.addAttribute("policyGroups", policyGroups);*/ model.addAttribute("_cfg", cfg); return "/cfg/proxy/spoofingIpPool/form"; } diff --git a/src/main/java/com/nis/web/dao/configuration/PxyObjSpoofingIpPoolDao.xml b/src/main/java/com/nis/web/dao/configuration/PxyObjSpoofingIpPoolDao.xml index a1519f23f..399c7a143 100644 --- a/src/main/java/com/nis/web/dao/configuration/PxyObjSpoofingIpPoolDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/PxyObjSpoofingIpPoolDao.xml @@ -138,7 +138,7 @@ *
    - + + <%-- + --%>
    diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp index 8a9f10f67..b53a9cc5e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp @@ -397,7 +397,7 @@
    - + @@ -437,7 +437,7 @@ - + @@ -511,11 +511,12 @@ diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/spoofingIpPool/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/spoofingIpPool/form.jsp index 89d184c8c..9e2559c3e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/spoofingIpPool/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/spoofingIpPool/form.jsp @@ -89,11 +89,12 @@ $(function(){
    - + <%-- + --%>
    From a143f953c4c996f6c4e801da24ad4370bcb82282 Mon Sep 17 00:00:00 2001 From: chenjinsong Date: Fri, 28 Dec 2018 09:34:17 +0800 Subject: [PATCH 097/147] =?UTF-8?q?login=E9=A1=B5=EF=BC=8C=E9=BD=BF?= =?UTF-8?q?=E8=BD=AE=E5=9B=BE=E9=80=82=E9=85=8D=E7=81=AB=E7=8B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/login.jsp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/views/login.jsp b/src/main/webapp/WEB-INF/views/login.jsp index 132b8641b..3f3c57132 100644 --- a/src/main/webapp/WEB-INF/views/login.jsp +++ b/src/main/webapp/WEB-INF/views/login.jsp @@ -527,9 +527,20 @@ }; lines_Chart_chu.setOption(line_chu_option); + var url = window.location.href; + var parm = parseInt(Math.random() * 10); + if (url.lastIndexOf('?') > -1) { +   url = url + parm; + } else { +   url = url + "?" + parm; + } + $(window).resize(function(){ - window.location.reload(); + window.location.href = url; }); + /* $(window).resize(function(){ + window.location.reload(); + }); */ From 6669ea9b0e5e20ef7da40cba60b4a733122a23ff Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Fri, 28 Dec 2018 09:44:36 +0800 Subject: [PATCH 098/147] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E5=9B=BE=E6=A0=87=E7=BC=A9=E5=B0=8F?= =?UTF-8?q?=E6=94=BE=E5=88=B0=E6=A0=87=E9=A2=98=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/static/pages/css/data_text.css | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main/webapp/static/pages/css/data_text.css b/src/main/webapp/static/pages/css/data_text.css index b4dc52869..ef0fdee30 100644 --- a/src/main/webapp/static/pages/css/data_text.css +++ b/src/main/webapp/static/pages/css/data_text.css @@ -47,13 +47,14 @@ p{ .data_content .data_info .fr_fc .fl_visual{ margin-left: 2px; float: left; - height: 110px; + height: 50px; width: 28%; - font-size: 40px; + font-size: 25px; /* color: #d9ffff !important; */ /* color: linear-gradient(to right, #ffcc99, #77b5dc); */ - position: relative; - margin-top: 25px; +/* position: relative; */ + margin-top: 2px; + position: absolute; /*background: -webkit-linear-gradient(left,#d9ffff, #77b5dc);*/ /* background: -webkit-linear-gradient(left,#d9ffff,#77b5dc); */ @@ -90,7 +91,7 @@ p{ -webkit-text-fill-color: transparent; } */ .data_content .data_info .fr_fc .fl_fc{ - width: 70%; + width: 100%; height: 110px; border-width: 0 1px; margin-left: 0px; @@ -136,111 +137,110 @@ p{ } .data_content .data_info .info_2 p:nth-child(1){ color:#fff; - font-size: 18px; + font-size: 16px; text-align: center; overflow: hidden; white-space: nowrap; /* text-overflow: ellipsis; */ - margin-left: -12px; + margin-left: 28px; } .data_content .data_info .info_1 label:nth-child(1){ width:100%; color:#fff; - font-size: 18px; + font-size: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: -2px; - margin-left: -20px; } .data_content .data_info>div.info_1 p:nth-child(2){ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 2.1em; + margin-top: 2.5em; margin-left: 0px; } .data_content .data_info .info_2 .fr_fc .numberRun2{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 2.1em; + margin-top: 2.5em; margin-left: 0px; } .data_content .data_info .info_2 .fr_fc .numberRun3{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 2.1em; + margin-top: 2.5em; margin-left: 0px; } .data_content .data_info .info_2 .fr_fc .numberRun5{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 2.1em; + margin-top: 2.5em; margin-left: 0px; } .data_content .data_info .info_2 .fr_fc .numberRun6{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 2.1em; + margin-top: 2.5em; margin-left: 0px; } .data_content .data_info .info_2 .fr_fc .numberRun7{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 2.1em; + margin-top: 2.5em; margin-left: 0px; } .data_content .data_info .info_2 .fr_fc .numberRun8{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 2.1em; + margin-top: 2.5em; margin-left: 0px; } .data_content .data_info .info_2 .fr_fc .numberRun{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 2.1em; + margin-top: 2.5em; margin-left: 0px; } .data_content .data_info>div.info_1 .fl_fc .numberRun4{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 1px; + margin-top: 3px; margin-left: 0px; } .data_content .data_info>div.info_1 .fl_fc .numberRun1{ width:100%; font-weight: 600; - font-size: 16px; + font-size: 14px; /*color:#288dce;*/ color:#ffffff; - margin-top: 33px; + margin-top: 35px; margin-left: 0px; } .data_content .data_info>div.info_1 .fl_fc .numberRun4-unit{ @@ -254,7 +254,7 @@ p{ font-size: 11px; /*color:#337ab7 !important;*/ color:#ffffff !important; - margin-top: -6px; + margin-top: -3px; text-align: center; margin-left: 1.3px; } From 10e8d76426d100111e650e46e69736f752d7c7e0 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Fri, 28 Dec 2018 11:52:58 +0800 Subject: [PATCH 099/147] =?UTF-8?q?=E4=BB=A3=E7=90=86=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=B9=B6=E4=B8=8B=E5=8F=91=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9F=9F=E5=8F=82?= =?UTF-8?q?=E6=95=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/web/service/BaseService.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index 1a9e2ab7b..83a3ed2fc 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -2123,6 +2123,22 @@ public abstract class BaseService { umap.put("bps_threadshold", _cfg.getBpsThreadshold()); umap.put("pps_threadshold", _cfg.getPpsThreadshold()); maatCfg.setUserRegion(new Gson().toJson(umap)); + }else if(regionDict.getFunctionId()==200) {// IP Intercept + maatCfg.setUserRegion(Constants.USER_REGION_PLACEHOLDER); + if(_cfg.getAction().equals(Constants.MONIT_ACTION)) { + maatCfg.setUserRegion(Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"="+Constants.USER_REGION_PLACEHOLDER); + } + }else if(regionDict.getFunctionId()==207 || regionDict.getFunctionId()==208 || regionDict.getFunctionId()==209) {// HTTP(s)阻断、重定向、替换 + String userRegion = Constants.USER_REGION_PLACEHOLDER; + if(_cfg.getAction().equals(Constants.REJECT_ACTION)) {// 阻断 + userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REDIRECT_CONTENT_KEY+"="+_cfg.getUserRegion2(); + }else if(_cfg.getAction().equals(48)) {// 重定向 + userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REDIRECT_URL_KEY+"="+_cfg.getUserRegion2();; + }else if(_cfg.getAction().equals(Constants.REPLACE_ACTION)) {// 替换 + String substitute = "/"+_cfg.getUserRegion2()+"/"+_cfg.getUserRegion3(); + userRegion = Constants.REPLACE_ZONE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute; + } + maatCfg.setUserRegion(userRegion); } configCompileList.add(maatCfg); @@ -2214,6 +2230,25 @@ public abstract class BaseService { } }else if(regionDict.getDictId()==159) { maatCfg.setUserRegion(Constants.P2P_HASH_TYPE_USER_REGION_KEY+"="+_cfg.getUserRegion1()); + }else if(regionDict.getFunctionId()==201) {// Domain Intercept + String userRegion = Constants.USERREGION_DOMAIN_ID+"="+_cfg.getCompileId()+";"+Constants.USERREGION_DOMAIN_STR+"="+_cfg.getCfgKeywords(); + if(_cfg.getAction().equals(Constants.MONIT_ACTION)) {// 监测 需要发keyring_id、拦截强度 + userRegion = Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"=0"+";"+Constants.INTERCEPT_DOMAN_INTENSITY_USER_REGION_KEY+"="+_cfg.getUserRegion5()+";" + userRegion; + }else if(_cfg.getAction().equals(Constants.RATELIMIT_ACTION)) {// 限速 需要发Droprate + userRegion = Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+_cfg.getUserRegion2()+";" + userRegion; + } + maatCfg.setUserRegion(userRegion); + }else if(regionDict.getFunctionId()==207 || regionDict.getFunctionId()==208 || regionDict.getFunctionId()==209) {// HTTP(s)阻断、重定向、替换 + String userRegion = Constants.USER_REGION_PLACEHOLDER; + if(_cfg.getAction().equals(Constants.REJECT_ACTION)) {// 阻断 + userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REDIRECT_CONTENT_KEY+"="+_cfg.getUserRegion2(); + }else if(_cfg.getAction().equals(48)) {// 重定向 + userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REDIRECT_URL_KEY+"="+_cfg.getUserRegion2();; + }else if(_cfg.getAction().equals(Constants.REPLACE_ACTION)) {// 替换 + String substitute = "/"+_cfg.getUserRegion2()+"/"+_cfg.getUserRegion3(); + userRegion = Constants.REPLACE_ZONE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute; + } + maatCfg.setUserRegion(userRegion); } configCompileList.add(maatCfg); } @@ -2294,6 +2329,17 @@ public abstract class BaseService { if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){ maatCfg.setUserRegion(Constants.HTTP_HEADER_USER_REGION_KEY+"="+cfg.getDistrict()); } + }else if(regionDict.getFunctionId()==207 || regionDict.getFunctionId()==208 || regionDict.getFunctionId()==209) {// HTTP(s)阻断、重定向、替换 + String userRegion = Constants.USER_REGION_PLACEHOLDER; + if(cfg.getAction().equals(Constants.REJECT_ACTION)) {// 阻断 + userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+";"+Constants.REDIRECT_CONTENT_KEY+"="+cfg.getUserRegion2(); + }else if(cfg.getAction().equals(48)) {// 重定向 + userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+";"+Constants.REDIRECT_URL_KEY+"="+cfg.getUserRegion2();; + }else if(cfg.getAction().equals(Constants.REPLACE_ACTION)) {// 替换 + String substitute = "/"+cfg.getUserRegion2()+"/"+cfg.getUserRegion3(); + userRegion = Constants.REPLACE_ZONE_KEY+"="+cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute; + } + maatCfg.setUserRegion(userRegion); } configCompileList.add(maatCfg); } From 620810c1f15171f79d7f8541d574cf18e32193b1 Mon Sep 17 00:00:00 2001 From: wangxin Date: Fri, 28 Dec 2018 12:58:46 +0600 Subject: [PATCH 100/147] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AF=BC=E5=87=BA=E6=8F=90=E7=A4=BA=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E5=A4=9A=E5=85=B3=E9=94=AE=E5=AD=97=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/excel/ExportExcel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index ac9216b9e..50c9bdb4c 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -1042,7 +1042,7 @@ public class ExportExcel { //expr type if("key_word".equals(headerStr)){ if(!StringUtil.isEmpty(region.getConfigMultiKeywords())){ - if(region.getConfigMultiKeywords().equals(1)){//多关键字输入TODO + if(region.getConfigMultiKeywords().equals("1")){//多关键字输入TODO commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; index++; //允许输入多关键字,多个关键字用换行表示 From 1ab978fb3395110d4d831a812e3469c7140a06cf Mon Sep 17 00:00:00 2001 From: wangxin Date: Fri, 28 Dec 2018 13:58:43 +0600 Subject: [PATCH 101/147] =?UTF-8?q?=EF=BC=881=EF=BC=89=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9D=A5=E5=87=BD=EF=BC=8C=E4=B8=93=E9=A1=B9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E9=AA=8C=E8=AF=81=E6=8F=90=E7=A4=BA=E4=B8=BA?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5=20=EF=BC=882=EF=BC=89?= =?UTF-8?q?=E6=9D=A5=E5=87=BD=EF=BC=8C=E4=B8=93=E9=A1=B9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E9=AA=8C=E8=AF=81=E6=8E=92=E9=99=A4=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/web/controller/basics/TaskInfoController.java | 3 ++- .../web/controller/configuration/RequestInfoController.java | 3 ++- src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml | 2 +- src/main/java/com/nis/web/dao/configuration/TaskInfoDao.xml | 2 +- src/main/resources/messages/message_en.properties | 3 ++- src/main/resources/messages/message_ru.properties | 3 ++- src/main/resources/messages/message_zh_CN.properties | 3 ++- 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/nis/web/controller/basics/TaskInfoController.java b/src/main/java/com/nis/web/controller/basics/TaskInfoController.java index 59cfc7d21..1d2e298d9 100644 --- a/src/main/java/com/nis/web/controller/basics/TaskInfoController.java +++ b/src/main/java/com/nis/web/controller/basics/TaskInfoController.java @@ -77,7 +77,8 @@ public class TaskInfoController extends BaseController{ }else{ if (!"true".equals(checkTaskName(taskInfo.getTaskName()))){ logger.info(taskInfo.getTaskName()+"重复数据"); - addMessage("error",model,"save_failed"); + Properties props=this.getMsgProp(); + addMessage("error",model,props.getProperty("duplicate", "Duplicate")+" "+props.getProperty("task_name", "Task Name")); return form(taskInfo, model); } // 保存用户信息 diff --git a/src/main/java/com/nis/web/controller/configuration/RequestInfoController.java b/src/main/java/com/nis/web/controller/configuration/RequestInfoController.java index 4b1239c34..ae3f0ce6d 100644 --- a/src/main/java/com/nis/web/controller/configuration/RequestInfoController.java +++ b/src/main/java/com/nis/web/controller/configuration/RequestInfoController.java @@ -83,7 +83,8 @@ public class RequestInfoController extends BaseController{ }else{ if (!"true".equals(checkRequestNumber(requestInfo.getRequestNumber()))){ logger.info(requestInfo.getRequestNumber()+"重复数据"); - addMessage("error",model,"save_failed"); + Properties props=this.getMsgProp(); + addMessage("error",model,props.getProperty("duplicate", "Duplicate")+" "+props.getProperty("title", "Title")); return form(requestInfo, model); } // 保存用户信息 diff --git a/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml b/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml index 7f5f94cd3..8c0e0c100 100644 --- a/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml @@ -99,7 +99,7 @@ select from request_info - where request_number = #{requestNumber,jdbcType=VARCHAR} + where request_number = #{requestNumber,jdbcType=VARCHAR} and is_valid !=-1
    -
    ${serviceDictInfo.showSequence}${serviceDictInfo.itemCode} diff --git a/src/main/webapp/WEB-INF/views/specific/specificServiceCfgList.jsp b/src/main/webapp/WEB-INF/views/specific/specificServiceCfgList.jsp index 8f29af99c..0f272c4e1 100644 --- a/src/main/webapp/WEB-INF/views/specific/specificServiceCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/specific/specificServiceCfgList.jsp @@ -213,6 +213,17 @@ +
    + + +
    + @@ -266,16 +277,11 @@ - - - - - - +
    @@ -284,8 +290,8 @@
    + @@ -296,7 +302,7 @@ + @@ -307,7 +313,7 @@ + @@ -320,14 +326,14 @@
    ${specificServiceCfg.showSequence} From b1a80e51de82cc33ca75f19090e10db2be42f564 Mon Sep 17 00:00:00 2001 From: chenjinsong Date: Wed, 26 Dec 2018 15:32:10 +0800 Subject: [PATCH 073/147] =?UTF-8?q?=E6=89=80=E6=9C=89=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8E=A7=E4=BB=B6=E5=A2=9E=E5=8A=A0=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E9=BB=98=E8=AE=A4=E8=B5=B7=E6=AD=A2=E5=8C=BA?= =?UTF-8?q?=E9=97=B4=E4=B8=BA24=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/log/manipulation/dkBehaviorList.jsp | 32 ++++++++--------- .../webapp/WEB-INF/views/log/ntc/appList.jsp | 4 +-- .../webapp/WEB-INF/views/log/ntc/bgpList.jsp | 8 ++--- .../WEB-INF/views/log/ntc/collectVoipList.jsp | 4 +-- .../views/log/ntc/connRecordLogList.jsp | 8 ++--- .../webapp/WEB-INF/views/log/ntc/ddosList.jsp | 4 +-- .../webapp/WEB-INF/views/log/ntc/dnsList.jsp | 8 ++--- .../webapp/WEB-INF/views/log/ntc/ftpList.jsp | 4 +-- .../WEB-INF/views/log/ntc/httpKeyList.jsp | 8 ++--- .../webapp/WEB-INF/views/log/ntc/httpList.jsp | 8 ++--- .../webapp/WEB-INF/views/log/ntc/ipList.jsp | 9 ++--- .../WEB-INF/views/log/ntc/ipsecList.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/irDnatLogList.jsp | 8 ++--- .../WEB-INF/views/log/ntc/irSnatLogList.jsp | 8 ++--- .../WEB-INF/views/log/ntc/l2tpLogList.jsp | 34 +++++++++--------- .../webapp/WEB-INF/views/log/ntc/mailList.jsp | 8 ++--- .../WEB-INF/views/log/ntc/mmAvIpList.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/mmAvUrlList.jsp | 32 ++++++++--------- .../views/log/ntc/mmFileDigestList.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/mmPicIpList.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/mmPicUrlList.jsp | 36 +++++++++---------- .../views/log/ntc/mmPornAudioSampleList.jsp | 32 ++++++++--------- .../views/log/ntc/mmPornVideoSampleList.jsp | 32 ++++++++--------- .../views/log/ntc/mmSampleAudioList.jsp | 36 ++++++++----------- .../views/log/ntc/mmSampleFaceList.jsp | 32 ++++++++--------- .../views/log/ntc/mmSampleLogoList.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/mmSamplePicList.jsp | 32 ++++++++--------- .../views/log/ntc/mmSampleSpeakerList.jsp | 32 ++++++++--------- .../views/log/ntc/mmSampleVideoList.jsp | 32 ++++++++--------- .../views/log/ntc/mmSampleVoipList.jsp | 32 ++++++++--------- .../views/log/ntc/mmVoipAccountList.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/mmVoipIpList.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/ntcStreamMedia.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/openVpnList.jsp | 32 ++++++++--------- .../webapp/WEB-INF/views/log/ntc/p2pList.jsp | 8 ++--- .../WEB-INF/views/log/ntc/pptpLogList.jsp | 28 +++++++-------- .../WEB-INF/views/log/ntc/radiusLogList.jsp | 8 ++--- .../webapp/WEB-INF/views/log/ntc/sshList.jsp | 32 ++++++++--------- .../WEB-INF/views/log/ntc/sslLogList.jsp | 28 +++++++-------- .../WEB-INF/views/log/pxy/pxyHttpList.jsp | 8 ++--- .../webapp/static/global/scripts/pzLog.js | 7 ++++ 41 files changed, 445 insertions(+), 445 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp b/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp index 6de17df8c..1552c2b34 100644 --- a/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp +++ b/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp @@ -117,24 +117,24 @@ $(document).ready(function(){ -
    -
    -
    +
    +
    +
    -
    - -
    -
    -
    -
    -
    +
    + +
    +
    +
    +
    +
    -
    - -
    -
    +
    + +
    +
    diff --git a/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp index a98de291f..2a5a053eb 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp @@ -70,7 +70,7 @@ $(document).ready(function(){
    + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:setTimee,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchFoundEndTime\')}'});"/>
    @@ -79,7 +79,7 @@ $(document).ready(function(){
    + value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'searchFoundStartTime\')}',maxDate:'#F{$dp.$D(\'searchFoundStartTime\',{d:1})}'});"/> diff --git a/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp index d0a0a071a..451157281 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp @@ -108,8 +108,8 @@
    - +
    @@ -117,8 +117,8 @@
    - +
    diff --git a/src/main/webapp/WEB-INF/views/log/ntc/collectVoipList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/collectVoipList.jsp index ef3bb649b..f193d503e 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/collectVoipList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/collectVoipList.jsp @@ -58,7 +58,7 @@ $(document).ready(function(){
    + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:setTimee,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchFoundEndTime\')}'});"/>
    @@ -67,7 +67,7 @@ $(document).ready(function(){
    + value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'searchFoundStartTime\')}',maxDate:'#F{$dp.$D(\'searchFoundStartTime\',{d:1})}'});"/> diff --git a/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp index a06e7e1bc..e92b5532d 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp @@ -120,8 +120,8 @@
    - +
    @@ -129,8 +129,8 @@
    - +
    diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp index 86de617e0..dd49a716a 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp @@ -113,7 +113,7 @@ $(document).ready(function(){
    + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:setTimee,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchFoundEndTime\')}'});"/>
    @@ -122,7 +122,7 @@ $(document).ready(function(){
    + value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'searchFoundStartTime\')}',maxDate:'#F{$dp.$D(\'searchFoundStartTime\',{d:1})}'});"/> diff --git a/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp index 0f0bdf8cd..7a163f1ce 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp @@ -109,8 +109,8 @@
    - +
    @@ -118,8 +118,8 @@
    - +
    diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp index 5e42a1cc3..69450f0d9 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp @@ -111,7 +111,7 @@ $(document).ready(function(){
    + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:setTimee,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'searchFoundEndTime\')}'});"/>
    @@ -120,7 +120,7 @@ $(document).ready(function(){
    + value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'searchFoundStartTime\')}',maxDate:'#F{$dp.$D(\'searchFoundStartTime\',{d:1})}'});"/> diff --git a/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp index 71d3646f7..9920f0008 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp @@ -135,8 +135,8 @@
    - +
    @@ -144,8 +144,8 @@
    - +
    diff --git a/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp index 0d7cec69e..6a37e0f8c 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp @@ -119,8 +119,8 @@
    - +
    @@ -128,8 +128,8 @@
    - +
    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 93515f8de..15c801739 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp @@ -6,6 +6,7 @@ IP + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index 4fe7ecee0..4d967ffea 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -63,6 +63,8 @@ <%-- --%> + + + + + + <%-- --%> + + --%> + + <%-- --%> + + + + + + + - - - - - - - - From 9b9b76172fb710e9200459e7dde7f369b3b248af Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Wed, 26 Dec 2018 18:44:59 +0800 Subject: [PATCH 077/147] =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E6=B5=81=E9=87=8F=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=88=B0y=E8=BD=B4=E9=A1=B6=E7=AB=AF?= =?UTF-8?q?=EF=BC=9B=E6=95=B0=E5=AD=97=E5=8A=A0=E5=8D=95=E4=BD=8D=EF=BC=9B?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E5=8A=A0=E5=8D=95=E4=BD=8D=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dynamicpage/DynamicIndexController.java | 20 ++-- .../views/dynamicpage/dynamicIndex.jsp | 93 +++++++++++++++---- 2 files changed, 86 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java b/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java index afcda50a7..b9da34d00 100644 --- a/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java +++ b/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java @@ -43,13 +43,15 @@ public class DynamicIndexController extends BaseController { String serviceIds = request.getParameter("sid"); String baseNum = request.getParameter("baseNum"); String hourStr = request.getParameter("hour"); + String dropBaseNum = request.getParameter("dropBaseNum"); + String serviceBaseNum = request.getParameter("serviceBaseNum"); Integer hour = null; if(hourStr!=null &&!"".equals(hourStr)){ hour = Integer.parseInt(hourStr); } - Object trafficAreaStat = trafficAreaStat(hour, Integer.parseInt(baseNum)); - Object dropStat = dropStat(hour, Integer.parseInt(baseNum)); - Object logStat = logStat(hour, serviceIds, Integer.parseInt(baseNum)); + Object trafficAreaStat = trafficAreaStat(hour, Long.valueOf(baseNum)); + Object dropStat = dropStat(hour, Long.valueOf(dropBaseNum)); + Object logStat = logStat(hour, serviceIds, Long.valueOf(serviceBaseNum)); Gson gson = new GsonBuilder().create(); String trafficJson = gson.toJson(trafficAreaStat); String dropJson = gson.toJson(dropStat); @@ -94,7 +96,7 @@ public class DynamicIndexController extends BaseController { * @param hour 取hour小时内的流量数据,默认24小时 * @return */ - public Object trafficAreaStat(Integer hour, Integer baseNum) { + public Object trafficAreaStat(Integer hour, long baseNum) { List results = new ArrayList<>(); if (hour == null || hour <= 0) { @@ -131,7 +133,11 @@ public class DynamicIndexController extends BaseController { } List point = new ArrayList<>();//每个点 [时间戳, 数值] point.add(DateUtils.parseDate(entity.getReportTime()).getTime()); - point.add(entity.getSum()); + /*if(0> points = t.get(entity.getArea());//所有点 points.add(point); @@ -171,7 +177,7 @@ public class DynamicIndexController extends BaseController { * @param hour 取hour小时内的丢弃数据,默认24小时 * @return */ - public Object dropStat(Integer hour, Integer baseNum) { + public Object dropStat(Integer hour, long baseNum) { List results = new ArrayList<>(); if (hour == null || hour <= 0) { @@ -235,7 +241,7 @@ public class DynamicIndexController extends BaseController { * @param hour 取hour小时内的日志数据,默认24小时 * @return */ - public Object logStat(Integer hour, String serviceIds, Integer baseNum) { + public Object logStat(Integer hour, String serviceIds, long baseNum) { String[] _idsArr = serviceIds.split(","); Long[] idsArr = new Long[5]; for (int i = 0; i < 5; i++) { diff --git a/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp b/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp index 701270085..fd48f8735 100644 --- a/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp @@ -265,6 +265,17 @@ top: 5%; left: -41%; } + #dataNumsStr{ + font-size:18px; + color:#ffffff; + position: relative; + top: 2.2%; + left: 43%; + font-size: 24px; + } + /* #dataNumsStr span{ + margin-left:-45px;font-size:23px;font-family:arial;font-weight:bold; + } */ /* 杂质动态 */ .zzdt{ position: absolute; @@ -344,8 +355,8 @@
    -
    -
    +
    +
    @@ -859,6 +870,7 @@ }, grid:{ left: 53, + top: '35%', }, xAxis: { type: 'time', @@ -875,7 +887,7 @@ color: '#fff', fontSize: 12, formatter: function(value) { - return echarts.format.formatTime('hh:mm:ss', new Date(value)); + return echarts.format.formatTime('hh:mm', new Date(value)); } }, splitLine: { @@ -885,6 +897,10 @@ }, yAxis: [{ type: 'value', + name: 'Bps', + nameTextStyle:{ + color:'#ffffff', + }, min: 0, axisLine: { lineStyle: { @@ -898,13 +914,19 @@ fontSize: 12, formatter: function (value, index) { if (value > 1024 && value <= 1048576) { - return value/1024 + " KBps"; + return Math.round(value/1024) + " K";//Bps } if (value > 1048576 && value <= 1073741824) { - return value/1048576 + " MBps"; + return Math.round(value/1048576) + " M";//Bps } - if (value > 1073741824) { - return value/1073741824 + " GBps"; + if (value > 1073741824 && value <= 1099511627776) { + return Math.round(value/1073741824) + " G";//Bps + } + if (value > 1099511627776 && value <= 1125899906842624) { + return Math.round(value/1099511627776) + " T";//Bps + } + if (value > 1125899906842624) { + return Math.round(value/1125899906842624) + " P";//Bps } return value; } @@ -1044,16 +1066,19 @@ }, axisLabel: { formatter: function(value) { - if (value > 1000 && value <= 1000000) { - return value/1000 + " K"; - } - if (value > 10000000 && value <= 1000000000) { - return value/1000000 + " M"; - } - if (value > 100000000) { - return value/1000000000 + " B"; - } - return value; + if (value > 1000 && value <= 1000000) { + return Math.round(value/1000) + " K"; + } + if (value > 1000000 && value <= 1000000000) { + return Math.round(value/1000000) + " M"; + } + if (value > 1000000000 && value <= 1000000000000) { + return Math.round(value/1000000000) + " T"; + } + if (value > 1000000000000) { + return Math.round(value/1000000000000) + " P"; + } + return value; }, }, splitNumber: 4, @@ -1189,7 +1214,7 @@ $.ajax({ type:'get', dataType: 'json', - url:'${pageContext.request.contextPath}/nis/dynamicpage/indexLog?hour=24&sid=' + top.indexLogServiceId + "&baseNum=" + top.baseNum, + url:'${pageContext.request.contextPath}/nis/dynamicpage/indexLog?hour=24&sid=' + top.indexLogServiceId + "&baseNum=" + top.serviceBaseNum, success:function(res){//处理返回结果 logData = res; _logData = logData.shift(); @@ -1219,11 +1244,39 @@ /* 数字特效 */ function animalNum(dropNum){ - $("#dataNums").empty(); - //var dropNum = rand(100,99999);; + var unitStr = ""; + if (dropNum > 1000 && dropNum <= 1000000) { + //dropNum = Math.round(dropNum/1000);//K取整 + (dropNum/1000).toFixed(1); + unitStr = "K"; + } + if (dropNum > 1000000 && dropNum <= 1000000000) { + //dropNum = Math.round(dropNum/1000000);//M + (dropNum/1000000).toFixed(1); + unitStr = "M"; + } + if (dropNum > 1000000000 && dropNum <= 1000000000000) { + //dropNum = Math.round(dropNum/1000000000);//G + (dropNum/1000000000).toFixed(1); + unitStr = "G"; + } + if (dropNum > 1000000000000 && dropNum <= 1000000000000000) { + //dropNum = Math.round(dropNum/1000000000000);//T + (dropNum/1000000000000).toFixed(1); + unitStr = "T"; + } + if (dropNum > 1000000000000000) { + //dropNum = Math.round(dropNum/1000000000000000);//P + (dropNum/1000000000000000).toFixed(1); + unitStr = "P"; + } + //dropNum = rand(1000,99999); + //dropNum= dropNum+"M"; + $("#dataNums").empty(); $("#dataNums").rollNum({ deVal:dropNum }); + $("#dataNumsStr").html(""+unitStr+"");//alert(unitStr); }; function rand(min,max) { From c3131b47eeacf8f795e42994107809f248a4c9b7 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Wed, 26 Dec 2018 18:52:29 +0800 Subject: [PATCH 078/147] =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E6=B5=81=E9=87=8F=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=88=B0y=E8=BD=B4=E9=A1=B6=E7=AB=AF?= =?UTF-8?q?=EF=BC=9B=E6=95=B0=E5=AD=97=E5=8A=A0=E5=8D=95=E4=BD=8D=EF=BC=9B?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E5=8A=A0=E5=8D=95=E4=BD=8D=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dynamicpage/DynamicIndexController.java | 3 +-- .../views/dynamicpage/dynamicIndex.jsp | 25 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java b/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java index b9da34d00..678c320d2 100644 --- a/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java +++ b/src/main/java/com/nis/web/controller/dynamicpage/DynamicIndexController.java @@ -101,8 +101,7 @@ public class DynamicIndexController extends BaseController { if (hour == null || hour <= 0) { hour = 2; - } - + } Date now = new Date(); Date start = new Date(now.getTime()-(hour*60*60*1000)-(5*60*1000)); now = new Date(now.getTime()-5*60*1000); diff --git a/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp b/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp index fd48f8735..4540d763f 100644 --- a/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dynamicpage/dynamicIndex.jsp @@ -10,7 +10,6 @@ - + +
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    + + + +<%-- --%> + +<%-- --%> + + + + + +<%-- --%> + + +<%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + + + + + +<%-- --%> + + +<%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + + + +
    +
    +
    -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    +
    + +
    +
    +
    +
    @@ -124,29 +134,60 @@
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    + +
    +
    + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    @@ -162,7 +203,7 @@
    ${log.taskId }${log.taskIds } ${log.taskName } ${log.ipNum } ${log.httpNum }
    ${log.taskId }${log.taskIds } ${log.taskName } ${log.letterNum } ${log.configNum }
    ${log.taskId }${log.taskIds } ${log.taskName } ${log.ipNum } ${log.httpNum }
    "+""+" - + ${indexCfg.userRegion2 } + <%-- ${policyGroup.groupName } - + --%>
    '; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + for (var i = 0; i < menu.length; i++) { + if (menu[i].functionId == 8) { + userTableStr += ''; + } else if(menu[i].functionId == 35){ + userTableStr += ''; + }else { + userTableStr += ''; + } + } + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + for(var j=0;j index @@ -206,6 +276,10 @@
  • +
    + +
    @@ -251,6 +325,7 @@
    ${page}
    +
    @@ -269,6 +344,10 @@
  • +
    + +
    HTTP '+menu[i].code+'MAIL '+menu[i].code+''+menu[i].code+'
    diff --git a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp index 8ba77f141..862b67008 100644 --- a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp +++ b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp @@ -2,6 +2,7 @@ <%@ include file="/WEB-INF/include/taglib.jsp"%> + <spring:message code="asn_conn_report"/> @@ -51,7 +52,59 @@ var modifyTime=new Date(chooseDate); $('#searchFoundEndTime').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds())); } - + //打印列表 + function doPrint() { + $.ajax({ + type:'post', + async:false, + cache:false, + url:'${ctx}/report/asnPrint',// + data:{ + "searchAsnType":$('[name="searchAsnType"]').val(), + "asn":$('[name="asn"]').val(), + "searchFoundStartTime":$('[name="searchFoundStartTime"]').val(), + "searchFoundEndTime":$('[name="searchFoundEndTime"]').val() + }, + dataType:"json", + success:function(data){ + if(data !=null){ + var userTableStr=''; + userTableStr +='
    '; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + for(var j=0;j @@ -129,6 +182,9 @@
  • +
    + +
    href="javascript:;"> @@ -170,6 +226,7 @@
    ${page}
    +
    diff --git a/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp b/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp index cf0804c5e..93999d011 100644 --- a/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventBlockList.jsp @@ -2,6 +2,7 @@ <%@ include file="/WEB-INF/include/taglib.jsp"%> + <spring:message code="ntc_event_block_report"/> @@ -73,6 +74,75 @@ $('.selectpicker').selectpicker('render'); } }; + + //打印列表 + function doPrint() { + $.ajax({ + type:'post', + async:false, + cache:false, + url:'${ctx}/eventBlock/eventBlockPrint',// + data:{ + "taskIds":$("#taskIdArray").val(), + "searchTaskStartTime":$('[name="searchTaskStartTime"]').val(), + "searchTaskEndTime":$('[name="searchTaskEndTime"]').val(), + "searchReportStartTime":$('[name="searchReportStartTime"]').val(), + "searchReportEndTime":$('[name="searchReportEndTime"]').val() + }, + dataType:"json", + success:function(data){ + if(data !=null){ + var userTableStr=''; + userTableStr +=''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + for(var j=0;j @@ -126,6 +196,9 @@
  • +
    + +
    href="javascript:;"> @@ -232,6 +305,7 @@
    ${page}
    + diff --git a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp index 406121c95..f19e09e39 100644 --- a/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventKeyProtectionList.jsp @@ -2,6 +2,7 @@ <%@ include file="/WEB-INF/include/taglib.jsp"%> + <spring:message code="ntc_event_key_protection_report"/> @@ -74,6 +75,72 @@ $('.selectpicker').selectpicker('render'); } }; + + //打印列表 + function doPrint() { + $.ajax({ + type:'post', + async:false, + cache:false, + url:'${ctx}/eventKeyProtection/eventKeyProtectionPrint',// + data:{ + "taskIds":$("#taskIdArray").val(), + "searchTaskStartTime":$('[name="searchTaskStartTime"]').val(), + "searchTaskEndTime":$('[name="searchTaskEndTime"]').val(), + "searchReportStartTime":$('[name="searchReportStartTime"]').val(), + "searchReportEndTime":$('[name="searchReportEndTime"]').val() + }, + dataType:"json", + success:function(data){ + if(data !=null){ + var userTableStr=''; + userTableStr +=''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + for(var j=0;j @@ -127,6 +194,9 @@
  • +
    + +
    href="javascript:;"> @@ -230,6 +300,7 @@
    ${page}
    + diff --git a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp index 53f463082..1ee1c7a49 100644 --- a/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp +++ b/src/main/webapp/WEB-INF/views/report/eventMonitorList.jsp @@ -2,6 +2,7 @@ <%@ include file="/WEB-INF/include/taglib.jsp"%> + <spring:message code="ntc_event_monitor_report"/> @@ -83,6 +84,74 @@ } }; + //打印列表 + function doPrint() { + $.ajax({ + type:'post', + async:false, + cache:false, + url:'${ctx}/eventMonitor/eventMonitorPrint',// + data:{ + "taskIds":$("#taskIdArray").val(), + "searchTaskStartTime":$('[name="searchTaskStartTime"]').val(), + "searchTaskEndTime":$('[name="searchTaskEndTime"]').val(), + "searchReportStartTime":$('[name="searchReportStartTime"]').val(), + "searchReportEndTime":$('[name="searchReportEndTime"]').val() + }, + dataType:"json", + success:function(data){ + if(data !=null){ + var userTableStr=''; + userTableStr +=''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + for(var j=0;j @@ -136,6 +205,9 @@
  • +
    + +
    href="javascript:;"> @@ -242,6 +314,7 @@
    ${page}
    + diff --git a/src/main/webapp/WEB-INF/views/report/ipRangeReportList.jsp b/src/main/webapp/WEB-INF/views/report/ipRangeReportList.jsp index afc40ee4f..ce1ca3429 100644 --- a/src/main/webapp/WEB-INF/views/report/ipRangeReportList.jsp +++ b/src/main/webapp/WEB-INF/views/report/ipRangeReportList.jsp @@ -2,6 +2,7 @@ <%@ include file="/WEB-INF/include/taglib.jsp"%> + <spring:message code="ip_range_report"/> @@ -34,7 +35,67 @@ // }); // ajaxConnPercent(); }); - + //打印列表 + function doPrint() { + $.ajax({ + type:'post', + async:false, + cache:false, + url:'${ctx}/report/ipRangePrint',// + data:{ + "seType":$('[name="searchAreaType1"]').val(), + "searchAreaType":$('[name="searchAreaType"]').val(), + "searchCountry":$('[name="searchCountry"]').val(), + "searchIp":$('[name="searchIp"]').val() + }, + dataType:"json", + success:function(data){ + if(data !=null){ + var userTableStr=''; + userTableStr +=''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + for(var j=0;j @@ -52,7 +113,7 @@ - +
    @@ -106,7 +167,9 @@
  • - +
    + +
    href="javascript:;"> @@ -151,6 +214,7 @@
    '; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += ''; + userTableStr += '
    ${page}
    + diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index 026f57216..3a7d17c53 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -5,6 +5,7 @@ + <spring:message code="${bean.cfgName}"></spring:message> <%@ include file="/WEB-INF/include/form/pageGroup.jsp"%> @@ -142,7 +155,7 @@ body {
    -

    " +

    " class="tooltips" data-flag="false" data-html="true" data-placement="top">

    0

    diff --git a/src/main/webapp/static/pages/css/data_text.css b/src/main/webapp/static/pages/css/data_text.css index ef0fdee30..7d9448d8f 100644 --- a/src/main/webapp/static/pages/css/data_text.css +++ b/src/main/webapp/static/pages/css/data_text.css @@ -141,17 +141,18 @@ p{ text-align: center; overflow: hidden; white-space: nowrap; -/* text-overflow: ellipsis; */ - margin-left: 28px; + text-overflow: ellipsis; + margin-left: 33px; } .data_content .data_info .info_1 label:nth-child(1){ - width:100%; + width:77%; color:#fff; font-size: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: -2px; + margin-left: 30px; } .data_content .data_info>div.info_1 p:nth-child(2){ width:100%; From 7d888aeb1b8e9f52dd66036aaef964564245a555 Mon Sep 17 00:00:00 2001 From: tanghao Date: Sat, 29 Dec 2018 18:32:41 +0800 Subject: [PATCH 120/147] =?UTF-8?q?merged=20=E5=90=88=E5=B9=B6=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/TrafficStatisticsInfoController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java index 9075b7b30..441a33967 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -67,7 +67,6 @@ public class TrafficStatisticsInfoController extends BaseController { HashMap m = new HashMap(); List list = new ArrayList(); try { - Random r = new Random(); Double rejectNum=0d; Double dropConnNum=0d; Double monitorNum=0d; @@ -261,7 +260,7 @@ public class TrafficStatisticsInfoController extends BaseController { */ @RequestMapping(value="bandwidthTransThree") @ResponseBody - public Map bandwidthTransThree(String beginDate,String endDate){ + public Map bandwidthTransThree(String beginDate,String endDate,String searchQuotaType){ Map fromJsonList = new HashMap(); Map map = new HashMap(); //String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_TWO; @@ -269,7 +268,7 @@ public class TrafficStatisticsInfoController extends BaseController { //String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_FOUR; try { url=urlAddDate(url,beginDate,endDate); - + url=url+"&searchQuotaType="+searchQuotaType; String string = HttpClientUtil.get(url); Gson gson = new GsonBuilder().create(); fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); From 95185070c61872b212695c2ad6eb3529648a64f9 Mon Sep 17 00:00:00 2001 From: tanghao Date: Sat, 29 Dec 2018 18:39:38 +0800 Subject: [PATCH 121/147] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2=E7=BA=BF=E6=9D=A1=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=B8=BA=E9=9D=A2=E7=A7=AF=E5=9B=BE=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=85=B6=E5=AE=83=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficBandwidthList.jsp | 185 +++++++++++------- 1 file changed, 113 insertions(+), 72 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index ad0a22575..fa077fb73 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -6,7 +6,6 @@ - @@ -80,7 +79,7 @@
    - + @@ -135,7 +134,7 @@ function changeBandwidth(unitType,beginDate,endDate){ $.ajax({ url:"${ctx}/dashboard/traffic/bandwidthTransThree", type:"get", - data:{"beginDate":beginDate,"endDate":endDate}, + data:{"beginDate":beginDate,"endDate":endDate,"searchQuotaType":unitType}, dataType:"json", async:true, timeout:40000, @@ -152,85 +151,82 @@ function changeBandwidth(unitType,beginDate,endDate){ var total=[]; var total2=[]; if(data!=null&&Object.keys(data).length>0){ - if(data.ipv4Type1!=undefined&&data.ipv4Type1!=null){ - xdata=data.ipv4Type1.statTime; - if(unitType=="Gbps"){ - ipv4data=data.ipv4Type1.gbps; - ipv6data=data.ipv6Type1.gbps; - tcpdata=data.trans6Type1.gbps; - udpdata=data.trans17Type1.gbps; - } - if(unitType=="pps"){ - ipv4data=data.ipv4Type1.pps; - ipv6data=data.ipv6Type1.pps; - tcpdata=data.trans6Type1.pps; - udpdata=data.trans17Type1.pps; - - } - if(unitType=="linkNumber"){ - ipv4data=data.ipv4Type1.linkNum; - ipv6data=data.ipv6Type1.linkNum; - tcpdata=data.trans6Type1.linkNum; - udpdata=data.trans17Type1.linkNum; - } - } - total.push(sum(ipv4data),sum(ipv6data),sum(tcpdata),sum(udpdata)); + ipv4data=data.ipv4Type1.result; + ipv6data=data.ipv6Type1.result; + tcpdata=data.trans6Type1.result; + udpdata=data.trans17Type1.result; + total.push(data.ipv4Type1.sum,data.ipv6Type1.sum,data.trans6Type1.sum,data.trans17Type1.sum); } var series=new Array(); series.push({ + // type:'area', name: "IPv4", - data: ipv4data + data: ipv4data, + marker: { + enabled: false + } },{ + // type:'area', name: "IPv6", - data: ipv6data + data: ipv6data, + marker: { + enabled: false + } },{ + // type:'area', name: "TCP", - data: tcpdata + data: tcpdata, + marker: { + enabled: false + } },{ + // type:'area', name: "UDP", - data: udpdata + data: udpdata, + marker: { + enabled: false + } }); $("#total").val(JSON.stringify(total)); showBandwidthChart("chart1",unitType,xdata,series,"Astana"); if(data!=null&&Object.keys(data).length>0){ - if(data.ipv4Type2!=undefined&&data.ipv4Type2!=null){ - xdata=data.ipv4Type2.statTime; - if(unitType=="Gbps"){ - ipv4data2=data.ipv4Type2.gbps; - ipv6data2=data.ipv6Type2.gbps; - tcpdata2=data.trans6Type2.gbps; - udpdata2=data.trans17Type2.gbps; - } - if(unitType=="pps"){ - ipv4data2=data.ipv4Type2.pps; - ipv6data2=data.ipv6Type2.pps; - tcpdata2=data.trans6Type2.pps; - udpdata2=data.trans17Type2.pps; - - } - if(unitType=="linkNumber"){ - ipv4data2=data.ipv4Type2.linkNum; - ipv6data2=data.ipv6Type2.linkNum; - tcpdata2=data.trans6Type2.linkNum; - udpdata2=data.trans17Type2.linkNum; - } - } - total2.push(sum(ipv4data2),sum(ipv6data2),sum(tcpdata2),sum(udpdata2)); + ipv4data2=data.ipv4Type2.result; + ipv6data2=data.ipv6Type2.result; + tcpdata2=data.trans6Type2.result; + udpdata2=data.trans17Type2.result; + total2.push(data.ipv4Type2.sum,data.ipv6Type2.sum,data.trans6Type2.sum,data.trans17Type2.sum); } + var series=new Array(); series.push({ + // type:'area', name: "IPv4", - data: ipv4data2 + data: ipv4data2, + marker: { + enabled: false + } },{ + // type:'area', name: "IPv6", - data: ipv6data2 + data: ipv6data2, + marker: { + enabled: false + } },{ + // type:'area', name: "TCP", - data: tcpdata2 + data: tcpdata2, + marker: { + enabled: false + } },{ + // type:'area', name: "UDP", - data: udpdata2 + data: udpdata2, + marker: { + enabled: false + } }); $("#total2").val(JSON.stringify(total2)); showBandwidthChart("chart2",unitType,xdata,series,"Alamty"); @@ -250,7 +246,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ var nowDate=new Date(); var chart = Highcharts.chart(id, { chart:{ -// type: 'area', + type: 'area', zoomType: 'x' }, title: { @@ -262,6 +258,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ x: 5 } }, + colors: ['#25a2ff','#0594ff','#0086e9','#026fc0'], noData:{ style: {//设置字体颜色 color: '#413333', @@ -295,20 +292,64 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ enabled:true }, xAxis:{ - type:'category', - title: { + /* type:'datetime', + + labels: { + rotation: -45, //倾斜的角度 + }, */ + title: { text: 'time-'+title, align:'high', }, - labels: { - rotation: -45, //倾斜的角度 - }, - categories: xdata, - }, - + type: 'datetime', + dateTimeLabelFormats: { + second: '%H:%M:%S', + minute: '%H:%M', + hour: '%H:%M', + day: '%m-%d', + week: '%m-%d', + month: '%Y-%m', + year: '%Y' + } + }, + tooltip: { + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } + }, credits:{//是否有highcharts水印 enabled:false - }, + },plotOptions: { + /* area: { + marker: { + radius: 2 + }, + lineWidth: 1, + states: { + hover: { + lineWidth: 1 + } + }, + threshold: null + }, */ + series: { + label: { + style: { + fontWeight: 'bold', + color:'#012765' + }, + boxesToAvoid: [] + }, + pointStart: 2010 + } + }, /* plotOptions: { area: { stacking: 'normal', @@ -320,10 +361,9 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ } } }, */ - series: ydata, - + series:ydata }); - + Highcharts.setOptions({ global: { useUTC: false } }); } (function(H) { H.Chart.prototype.downloadXLS = function() { @@ -415,6 +455,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ } } }) + console.log(total) data.push({ num1:"", num2:total @@ -453,11 +494,11 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ downloadLink.click(); document.body.removeChild(downloadLink); } - function sum(arr) { +/* function sum(arr) { return arr.reduce(function(prev, curr, idx, arr){ return prev + curr; }); - } + } */ \ No newline at end of file From ca4fa21fc723241515fa08dc940a02974b276708 Mon Sep 17 00:00:00 2001 From: tanghao Date: Sat, 29 Dec 2018 19:07:28 +0800 Subject: [PATCH 122/147] update --- .../webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index fa077fb73..d261762a9 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -82,7 +82,7 @@ - +<%-- --%> From dbb4493df916d09659683da71ef9d498f9509f96 Mon Sep 17 00:00:00 2001 From: tanghao Date: Sat, 29 Dec 2018 19:47:49 +0800 Subject: [PATCH 123/147] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E5=9B=BE=E9=9D=A2=E7=A7=AF=E5=9B=BE=E9=A2=9C=E8=89=B2=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E7=BA=BF=E6=9D=A1=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficBandwidthList.jsp | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index d261762a9..e9a795d6b 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -162,6 +162,8 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "IPv4", data: ipv4data, + lineColor:'#aecdff', + lineWidth:1, marker: { enabled: false } @@ -169,6 +171,8 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "IPv6", data: ipv6data, + lineColor:'#9ac0fe', + lineWidth:1, marker: { enabled: false } @@ -176,6 +180,8 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "TCP", data: tcpdata, + lineColor:'#85b4fe', + lineWidth:1, marker: { enabled: false } @@ -183,6 +189,8 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "UDP", data: udpdata, + lineColor:'#71a7fe', + lineWidth:1, marker: { enabled: false } @@ -203,6 +211,8 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "IPv4", data: ipv4data2, + lineColor:'#aecdff', + lineWidth:1, marker: { enabled: false } @@ -210,6 +220,8 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "IPv6", data: ipv6data2, + lineColor:'#9ac0fe', + lineWidth:1, marker: { enabled: false } @@ -217,6 +229,8 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "TCP", data: tcpdata2, + lineColor:'#85b4fe', + lineWidth:1, marker: { enabled: false } @@ -224,6 +238,8 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "UDP", data: udpdata2, + lineColor:'#71a7fe', + lineWidth:1, marker: { enabled: false } @@ -258,7 +274,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ x: 5 } }, - colors: ['#25a2ff','#0594ff','#0086e9','#026fc0'], + colors: ['#d6e6ff','#c2d9ff','#aecdff','#9ac0fe'], noData:{ style: {//设置字体颜色 color: '#413333', @@ -328,7 +344,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ enabled:false },plotOptions: { /* area: { - marker: { + /* marker: { radius: 2 }, lineWidth: 1, @@ -337,7 +353,8 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ lineWidth: 1 } }, - threshold: null + threshold: null + lineColor:'#8216db' }, */ series: { label: { From 2b82aa1fd40584de779f5251a648e0d931e6c05f Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sat, 29 Dec 2018 17:55:35 +0600 Subject: [PATCH 124/147] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ip=20payload=E6=97=A5?= =?UTF-8?q?=E5=BF=97=EF=BC=8C=E4=B8=8Eip=20spoofing=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=9B=B8=E5=90=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../log/ntc/OpenVpnLogController.java | 29 ++++++++++++++++--- .../resources/messages/message_en.properties | 2 +- .../resources/messages/message_ru.properties | 8 ++--- .../messages/message_zh_CN.properties | 4 +-- .../resources/sql/20181229/add_sys_menu.sql | 8 +++++ src/main/webapp/WEB-INF/tags/sys/delRow.tag | 4 +-- .../views/cfg/intercept/interceptList.jsp | 2 +- .../WEB-INF/views/log/ntc/openVpnList.jsp | 24 ++++++++++++--- 8 files changed, 63 insertions(+), 18 deletions(-) create mode 100644 src/main/resources/sql/20181229/add_sys_menu.sql diff --git a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java index a8f33f21a..3f0d4d2ad 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java @@ -25,6 +25,7 @@ import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.SysUser; +import com.nis.domain.log.DkBehaviorLog; import com.nis.domain.log.MmVoipLog; import com.nis.domain.log.NtcCollectRadiusLog; import com.nis.domain.log.NtcOpenVpnLog; @@ -32,6 +33,7 @@ import com.nis.domain.log.NtcOpenVpnLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; +import com.nis.util.StringUtil; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; import com.nis.web.security.UserUtils; @@ -56,14 +58,20 @@ public class OpenVpnLogController extends BaseController{ PageLog page = new PageLog(request, response); Map params=new HashMap<>(); + + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + if(StringUtil.isEmpty(entry.getAction())){ + for(int i=0;i serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); - model.addAttribute("serviceList", serviceList); - String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_OPENVPN_LOG; //url = Constants.LOG_BASE_URL+Constants.NTC_IP_LOG; @@ -104,6 +112,15 @@ public class OpenVpnLogController extends BaseController{ Map noExportMap=new HashMap(); //--------------------------- PageLog page = new PageLog(request, response); + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + if(StringUtil.isEmpty(log.getAction())){ + for(int i=0;i params = new HashMap(); @@ -121,6 +138,10 @@ public class OpenVpnLogController extends BaseController{ Page data = fromJson.getData(); list= data.getList(); } + for (NtcOpenVpnLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } } titleList.add("spoofing_ip_policy"); classMap.put("spoofing_ip_policy", NtcOpenVpnLog.class); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 92f369ada..b0b58fa79 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1355,7 +1355,7 @@ translated_dest_ip=Translated destination address translated_dest_port=Translated destination port show_ips=View all IP show_available_ips=View available IP -radius_log=Radius Identify +radius_log=Radius Log message_type=Code nas_ip=NAS IP Address framed_ip=Framed IP Address diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index cb611cd04..4d23d483d 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1359,14 +1359,14 @@ translated_dest_ip=\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\ translated_dest_port=\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u041f\u043e\u0440\u0442 \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f show_ips=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0412\u0441\u0435 IP show_available_ips=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 IP -radius_log=Radius \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c +radius_log=\u0416\u0443\u0440\u043D\u0430\u043B Radius message_type=\u041a\u043e\u0434 nas_ip=NAS IP-\u0430\u0434\u0440\u0435\u0441 framed_ip=Framed IP-\u0430\u0434\u0440\u0435\u0441 log_user_name=\u0418\u043c\u044f \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f av_tips=\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0430\u0443\u0434\u0438\u043e \u0438 \u0432\u0438\u0434\u0435\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0445\u0432\u043e\u0441\u0442\u0435 \u0430\u0443\u0434\u0438\u043e \u0438 \u0432\u0438\u0434\u0435\u043e \u0444\u0430\u0439\u043b\u043e\u0432. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0438\u0434\u0435\u043e \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0432\u044b\u0448\u0435 1080P. asn_ip_group_delete=\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f IP \u0432 \u044d\u0442\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 ASN \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0430. -keyword_log_tips=\u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u043b\u043e\u0445\u0438\u043c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0435\u0434\u0443\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u7395u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 URL\ufffd \u0434\u043b\u044f \u043f\u043e\u0434\u0430\u0432\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430. +keyword_log_tips=\u041A\u043E\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043A\u043B\u044E\u0447\u0435\u0432\u044B\u043C\u0438 \u0441\u043B\u043E\u0432\u0430\u043C\u0438 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u043B\u043E\u0445\u0438\u043C, \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043E\u0447\u0438\u0441\u0442\u043A\u0438 \u0436\u0443\u0440\u043D\u0430\u043B\u0430 \u0434\u0430\u043D\u043D\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043F\u043E\u0434\u0430\u0432\u0448\u0438\u0439 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442 \u043D\u0430 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044E ''\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 URL''. conn_record=\u0417\u0430\u043f\u0438\u0441\u0438 \u041f\u043e\u0434\u043a\u044e\u0447\u0435\u043d\u0438\u0439 bps=Gbps bps_percent=Bps Percent @@ -1416,7 +1416,7 @@ upload_limit_is=The limitation of file uplaod is count=Count do_blacklist=Blacklist Option l3_header_error=Only four attribute values are allowed to be entered at most -IP_HEADER=IP Header +IP_HEADER=IP Headerx ICMP_HEADER=ICMP Header offset_expression=Offset Expression cfg_custom=\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0421\u0442\u043e\u043b\u0431\u0446\u044b @@ -1439,4 +1439,4 @@ min_length=Minimum Length length_error=Length Error duplicate=Duplicate print=Print -traffic_connect_log=\u041B\u043E\u0433 \u0422\u0440\u0430\u0444\u0438\u043A\u0430 \ No newline at end of file +traffic_connect_log=\u0416\u0443\u0440\u043D\u0430\u043B \u0422\u0440\u0430\u0444\u0438\u043A\u0430 \ 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 b91733406..cc06f9266 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1355,7 +1355,7 @@ show_ips=\u67e5\u770b\u6240\u6709IP show_available_ips=\u67e5\u770b\u53ef\u7528IP website_keyword_monit=\u5173\u952e\u5b57\u76d1\u6d4b website_keyword_reject=\u5173\u952e\u5b57\u963b\u65ad -radius_log=Radius \u534f\u8bae +radius_log=Radius \u65E5\u5FD7 message_type=Code nas_ip=NAS IP Address framed_ip=Framed IP Address @@ -1435,4 +1435,4 @@ min_length=\u6700\u5c0f\u957f\u5ea6 length_error=\u957f\u5ea6\u9519\u8bef duplicate=\u91cd\u590d\u7684 print=\u6253\u5370 -traffic_connect_log=\u9646\u826F\u65E5\u5FD7 \ No newline at end of file +traffic_connect_log=\u6D41\u91CF\u65E5\u5FD7 \ No newline at end of file diff --git a/src/main/resources/sql/20181229/add_sys_menu.sql b/src/main/resources/sql/20181229/add_sys_menu.sql new file mode 100644 index 000000000..52957f68f --- /dev/null +++ b/src/main/resources/sql/20181229/add_sys_menu.sql @@ -0,0 +1,8 @@ +-- 新增ip payload日志菜单,以及ip spoofing,ip payload实时统计菜单 +INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('940', '0,1,152,940,', 'ip_payload', 'IP Payload', '64', '/log/ntc/ntcOpenvpnLogs/list', '', '', '1', '', '1', '2018-12-29 14:59:51', '1', '2018-12-29 14:59:51', '', '1', NULL, '0', '0', '212'); +INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ( '943', '0,1,780,943,', 'ip_payload', 'IP Payload', '60', '/report/list?cfgName=ip_payload&reportType=1', '', '', '1', '', '1', '2018-12-29 15:05:12', '1', '2018-12-29 15:05:12', '', '1', NULL, '0', '0', '212'); +INSERT INTO `sys_menu` ( `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ( '943', '0,1,780,943,', 'spoofing_ip_policy', 'IP Spoofing', '90', '/report/list?cfgName=spoofing_ip_policy&reportType=1', '', '', '1', '', '1', '2018-12-29 15:06:02', '1', '2018-12-29 16:02:03', '', '1', NULL, '0', '0', '214'); +-- 新增流量日志菜单,并修改通联关系域radius日志为流量日志下的子菜单 +INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1217', '152', '0,1,152,', 'traffic_connect_log', 'Traffic Connect Log', '190', '', '', '', '1', '', '1', '2018-12-29 14:06:08', '1', '2018-12-29 14:06:08', '', '1', NULL, '0', '0', NULL); +UPDATE `sys_menu` SET `id`='1179', `parent_id`='1217', `parent_ids`='0,1,152,1217,', `code`='radius_log', `name`='RADIUS协议日志', `sort`='80', `href`='/log/ntc/radiusLogs', `target`='', `icon`='', `is_show`='1', `permission`='', `create_by`='1', `create_date`='2018-12-12 15:14:37', `update_by`='1', `update_date`='2018-12-29 14:06:33', `remarks`='', `del_flag`='1', `menu_bg`=NULL, `quick_action`='0', `is_top`='0', `function_id`='0' WHERE (`id`='1179'); +UPDATE `sys_menu` SET `id`='1181', `parent_id`='1217', `parent_ids`='0,1,152,1217,', `code`='conn_record', `name`='通联关系', `sort`='110', `href`='/log/ntc/connRecordLogs', `target`='', `icon`='', `is_show`='1', `permission`='', `create_by`='1', `create_date`='2018-12-15 15:47:32', `update_by`='1', `update_date`='2018-12-29 14:06:55', `remarks`='', `del_flag`='1', `menu_bg`=NULL, `quick_action`='0', `is_top`='0', `function_id`=NULL WHERE (`id`='1181'); diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index 0794ba3f4..0592efb96 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -114,8 +114,8 @@ function update(url){ top.$.jBox.tip("", ""); return; }else if(cked.val()==3){ - /* top.$.jBox.tip("", ""); - return; */ + top.$.jBox.tip("", ""); + return; } //处理asnIp,asn组下发过的ip配置不允许修改 if(cked.attr("serviceGroupId")&&cked.attr("isValid")){ diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp index 7c1528f54..6dd662f40 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp @@ -441,7 +441,7 @@ - + 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 3062ac9ac..b82bd83a0 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp @@ -58,7 +58,15 @@ $(document).ready(function(){ varStatus="satus"> - + + + + + + + + + @@ -227,9 +235,17 @@ $(document).ready(function(){ ${log.action } - - ${dict.itemValue} - + + + + + + + ${dict.itemValue} + + + + From 34f024f8a6b8a8904b72309c060801d0b8bdc04f Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Sat, 29 Dec 2018 20:06:55 +0800 Subject: [PATCH 125/147] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=BB=9A=E5=8A=A8=E6=9D=A1=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/dashboard/dashBoardIndex.jsp | 4 ++-- src/main/webapp/static/pages/css/data_text.css | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp index 27097df00..430d229ad 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp @@ -69,7 +69,7 @@ body {
    -
    +
    @@ -83,7 +83,7 @@ body { 0 bps
    -
    +
    diff --git a/src/main/webapp/static/pages/css/data_text.css b/src/main/webapp/static/pages/css/data_text.css index 7d9448d8f..5be0b935d 100644 --- a/src/main/webapp/static/pages/css/data_text.css +++ b/src/main/webapp/static/pages/css/data_text.css @@ -27,7 +27,7 @@ p{ display: inline-block; } .data_content .data_info .info_2{ - width: 75%; + width: 76%; height: 110px; } @@ -47,9 +47,9 @@ p{ .data_content .data_info .fr_fc .fl_visual{ margin-left: 2px; float: left; - height: 50px; + /* height: 50px; */ width: 28%; - font-size: 25px; + font-size: 30px; /* color: #d9ffff !important; */ /* color: linear-gradient(to right, #ffcc99, #77b5dc); */ /* position: relative; */ @@ -103,7 +103,7 @@ p{ } .data_content .data_info .info_1{ - width: 25%; + width: 24%; height: 110px; } .data_content .data_info .info_2 .fr_fc:first-child{ @@ -142,17 +142,17 @@ p{ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - margin-left: 33px; + margin-left: 42px; } .data_content .data_info .info_1 label:nth-child(1){ - width:77%; + width:74%; color:#fff; font-size: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: -2px; - margin-left: 30px; + margin-left: 39px; } .data_content .data_info>div.info_1 p:nth-child(2){ width:100%; @@ -257,7 +257,8 @@ p{ color:#ffffff !important; margin-top: -3px; text-align: center; - margin-left: 1.3px; + margin-left: 6.3px; + width: 100% } /* .data_info{ float: right; From 86a1c598a9596d4b6d0280b38882cb46614c1239 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Sat, 29 Dec 2018 20:15:34 +0800 Subject: [PATCH 126/147] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/static/pages/css/data_text.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/static/pages/css/data_text.css b/src/main/webapp/static/pages/css/data_text.css index 5be0b935d..cf6f0a2de 100644 --- a/src/main/webapp/static/pages/css/data_text.css +++ b/src/main/webapp/static/pages/css/data_text.css @@ -142,7 +142,7 @@ p{ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - margin-left: 42px; + margin-left: 44px; } .data_content .data_info .info_1 label:nth-child(1){ width:74%; From 3f2a2af35f87dfcd508157c438a8d71b9d8bb9f2 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sat, 29 Dec 2018 18:46:23 +0600 Subject: [PATCH 127/147] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=BA=A6=E9=80=89=E9=A1=B9=E7=9A=84=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/cfg/complexCfgForm.jsp | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp index 9dfcf6a13..6294938c4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp @@ -26,27 +26,6 @@

    - - - -
    @@ -127,7 +106,25 @@
    - + + + +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp index e2dd6506e..b66cdfb08 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgList.jsp @@ -108,6 +108,7 @@ +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgList.jsp index d501c5fb0..fb0ae8e15 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgList.jsp @@ -136,6 +136,7 @@ +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgList.jsp index 015d77e63..0c9d50acc 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgList.jsp @@ -109,6 +109,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgList.jsp index 20d13390b..3c0baf1d5 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgList.jsp @@ -111,6 +111,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgList.jsp index d4cc85f7a..2c784e642 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgList.jsp @@ -170,6 +170,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp index 19c6da4d5..e36d740c3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp @@ -155,6 +155,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgList.jsp index 0c6273703..a67a9ba8b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgList.jsp @@ -91,6 +91,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgList.jsp index b8407622b..af3715357 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgList.jsp @@ -81,6 +81,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgList.jsp index 55813aa1b..0f71bc7a9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgList.jsp @@ -89,6 +89,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/appCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/appCfgList.jsp index a1414cc97..9fc1fc77e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/appCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/appCfgList.jsp @@ -100,6 +100,7 @@ +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgList.jsp index af2010bde..2e9dd7119 100644 --- a/src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgList.jsp @@ -120,6 +120,7 @@ +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpList.jsp index 800fe3940..f5c11ef7c 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpList.jsp @@ -137,7 +137,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp index 1e828be7c..2bd49ceb2 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp @@ -167,6 +167,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/av/fileSampleList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/fileSampleList.jsp index 541d00564..3e601a586 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/fileSampleList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/fileSampleList.jsp @@ -94,6 +94,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpList.jsp index 842597f93..937451867 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpList.jsp @@ -137,7 +137,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp index a3cde41b0..fb29aa1e6 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp @@ -136,7 +136,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp index d1dfb8600..de9b7d484 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp @@ -158,6 +158,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp index a68b65736..4a8afa2ce 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp @@ -158,6 +158,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/complexCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/complexCfgList.jsp index d5966e12f..e24e422f9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/complexCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/complexCfgList.jsp @@ -91,6 +91,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp index 04fc5e59c..309d2d8aa 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp @@ -117,7 +117,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp index fc1c30c12..76718c95a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp @@ -116,7 +116,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp index 3e8b4dc39..3fe6b8035 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp @@ -155,6 +155,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestList.jsp index b062e4ba4..13d5b63ac 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestList.jsp @@ -165,6 +165,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp index e24fc57a9..ab48b12bf 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp @@ -140,6 +140,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp index d85e22714..e9ee7b755 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp @@ -154,6 +154,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp index 6dd662f40..ac5b21f0b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp @@ -163,6 +163,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/list.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/list.jsp index 690f1fc45..c08b5a5df 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/list.jsp @@ -81,7 +81,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertList.jsp index 2255e9075..5211ee980 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertList.jsp @@ -160,7 +160,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/ipCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipCfgList.jsp index 9072da1f5..d054465a7 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipCfgList.jsp @@ -88,6 +88,7 @@ +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp index 9de81fa45..cd0b8264d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp @@ -151,6 +151,7 @@ +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp index 447b457b7..48c6a01b8 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp @@ -153,6 +153,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp index 9ca2c4cdf..39ba6fb7b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp @@ -101,7 +101,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/list.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/list.jsp index a6713b69c..799672907 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/list.jsp @@ -84,7 +84,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist.jsp index a5af9f12c..a574dfb70 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist.jsp @@ -102,7 +102,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp index d0290870e..10f034c5b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp @@ -198,7 +198,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList.jsp index 0c05f1ea2..facbf44a1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList.jsp @@ -86,6 +86,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList2.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList2.jsp index 8a4f7dd8f..52911f557 100644 --- a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList2.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/dnatPolicyList2.jsp @@ -91,6 +91,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList.jsp index de62cab5e..6ea0f1d5b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList.jsp @@ -86,6 +86,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp index e649d5ccc..d2d3b9fee 100644 --- a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp @@ -112,6 +112,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp index 02a770fec..4c9683a85 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp @@ -154,6 +154,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp index c94599f72..ad753e432 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp @@ -123,6 +123,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp index 79821e40f..a7b70a08a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp @@ -137,6 +137,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp index d03b53a7c..1c0bcded5 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp @@ -347,6 +347,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp index 61301572b..316f86dda 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp @@ -73,7 +73,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceList.jsp index 4bed7fb79..1c5c5ceb5 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceList.jsp @@ -74,7 +74,7 @@ - <%-- --%> + diff --git a/src/main/webapp/WEB-INF/views/cfg/stringCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/stringCfgList.jsp index ecc6ea515..d74da82e9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/stringCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/stringCfgList.jsp @@ -90,6 +90,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp index 3bf6899de..269495bb2 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp @@ -152,6 +152,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp index 532032942..5496e3900 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp @@ -303,6 +303,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp index 43bf6ca58..79413ecfe 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp @@ -151,6 +151,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp index 1378338ff..19d64b3a5 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp @@ -134,6 +134,7 @@ + diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp index ab3a87981..0a045c490 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp @@ -149,6 +149,7 @@ + From 6b433c4e5a0d80b308e1f48c435235b5adea1d9b Mon Sep 17 00:00:00 2001 From: tanghao Date: Sun, 30 Dec 2018 13:30:15 +0800 Subject: [PATCH 129/147] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=83=8C=E6=99=AF=E7=BA=BF=E6=9D=A1=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficBandwidthList.jsp | 83 ++++++++++--------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index e9a795d6b..5bd6459ee 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -162,7 +162,7 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "IPv4", data: ipv4data, - lineColor:'#aecdff', + lineColor:'#a9d4cf', lineWidth:1, marker: { enabled: false @@ -171,7 +171,7 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "IPv6", data: ipv6data, - lineColor:'#9ac0fe', + lineColor:'#eecf8d', lineWidth:1, marker: { enabled: false @@ -180,7 +180,7 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "TCP", data: tcpdata, - lineColor:'#85b4fe', + lineColor:'#f1aa76', lineWidth:1, marker: { enabled: false @@ -189,7 +189,7 @@ function changeBandwidth(unitType,beginDate,endDate){ // type:'area', name: "UDP", data: udpdata, - lineColor:'#71a7fe', + lineColor:'#88b876', lineWidth:1, marker: { enabled: false @@ -208,42 +208,42 @@ function changeBandwidth(unitType,beginDate,endDate){ var series=new Array(); series.push({ - // type:'area', - name: "IPv4", - data: ipv4data2, - lineColor:'#aecdff', - lineWidth:1, - marker: { - enabled: false - } - },{ - // type:'area', - name: "IPv6", - data: ipv6data2, - lineColor:'#9ac0fe', - lineWidth:1, - marker: { - enabled: false - } - },{ - // type:'area', - name: "TCP", - data: tcpdata2, - lineColor:'#85b4fe', - lineWidth:1, - marker: { - enabled: false - } - },{ - // type:'area', - name: "UDP", - data: udpdata2, - lineColor:'#71a7fe', - lineWidth:1, - marker: { - enabled: false - } - }); + // type:'area', + name: "IPv4", + data: ipv4data2, + lineColor:'#a9d4cf', + lineWidth:1, + marker: { + enabled: false + } + },{ + // type:'area', + name: "IPv6", + data: ipv6data2, + lineColor:'#eecf8d', + lineWidth:1, + marker: { + enabled: false + } + },{ + // type:'area', + name: "TCP", + data: tcpdata2, + lineColor:'#f1aa76', + lineWidth:1, + marker: { + enabled: false + } + },{ + // type:'area', + name: "UDP", + data: udpdata2, + lineColor:'#88b876', + lineWidth:1, + marker: { + enabled: false + } + }); $("#total2").val(JSON.stringify(total2)); showBandwidthChart("chart2",unitType,xdata,series,"Alamty"); closeTip(); @@ -274,7 +274,8 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ x: 5 } }, - colors: ['#d6e6ff','#c2d9ff','#aecdff','#9ac0fe'], + //colors: ['#d6e6ff','#c2d9ff','#aecdff','#9ac0fe'], + colors:['#e5e3cd','#f1e5cd','#f3ebdf','#f3f7f1'], noData:{ style: {//设置字体颜色 color: '#413333', From aa7e1dcef9d776fe70481f4697367c7b42c37357 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sun, 30 Dec 2018 12:11:20 +0600 Subject: [PATCH 130/147] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=B8=9A=E5=8A=A1=EF=BC=9B=202.=E4=BF=AE?= =?UTF-8?q?=E6=94=B9ip=20payload=E6=97=A5=E5=BF=97=E8=A1=A8=E5=A4=B4?= =?UTF-8?q?=E4=B8=8E=E4=BB=A3=E7=90=86=E6=97=A5=E5=BF=97=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=97=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConfigSynchronizationDao.java | 2 + .../ConfigSynchronizationDao.xml | 16 ++++++++ .../ConfigSynchronizationService.java | 4 ++ src/main/resources/service/service_config.xml | 41 ++++++++++++++----- .../WEB-INF/views/log/ntc/openVpnList.jsp | 8 +++- .../WEB-INF/views/log/pxy/pxyHttpList.jsp | 26 ++++++------ 6 files changed, 73 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.java b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.java index 6654b272d..d86651de7 100644 --- a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.java +++ b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.java @@ -35,6 +35,7 @@ import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.PxyObjKeyring; +import com.nis.domain.configuration.PxyObjSpoofingIpPool; import com.nis.domain.configuration.PxyObjTrustedCaCert; import com.nis.domain.configuration.PxyObjTrustedCaCrl; import com.nis.domain.configuration.WebsiteDomainTopic; @@ -88,6 +89,7 @@ public interface ConfigSynchronizationDao { public List getDnsIpCfgList(BaseCfg entity); public List getIpPortListByService(BaseCfg entity); public List getIpDropList(@Param("tableName")String tableName,@Param("compileIds")List compileIds); + List getSpoofingIpPoolList(BaseCfg entity); public List getAppPolicyList(BaseCfg entity); public List getAppFeatureIndexList(BaseCfg entity); diff --git a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml index d18cf1531..8325e5c9c 100644 --- a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml @@ -877,6 +877,13 @@ a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port ,a.protocol,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.compile_id + + a.CFG_ID, a.CFG_DESC,a.CFG_REGION_CODE, a.IP_TYPE, a.IP_ADDRESS, + a.DIRECTION,a.PROTOCOL,a.IS_VALID,a.IS_AUDIT,a.location,a.port, + a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME, + a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY, + a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.FUNCTION_ID,a.GROUP_ID,a.user_region + - + - + + + + + + + + + + - + - + + @@ -255,29 +266,34 @@ + + + + + @@ -285,18 +301,21 @@ + + + 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 b82bd83a0..8829dda91 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp @@ -31,7 +31,13 @@ $(document).ready(function(){

    - + + + + + + +

    diff --git a/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp b/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp index f0ff3b606..7cc411d01 100644 --- a/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp @@ -227,6 +227,7 @@ URL         + @@ -237,11 +238,11 @@ - - + <%-- + --%> <%-- --%> - + @@ -254,11 +255,11 @@ - - + <%-- + --%> - + <%-- --%> @@ -308,6 +309,7 @@ http://${log.url} --%> + ${log.website } ${log.reqLine } ${log.resLine } @@ -318,9 +320,9 @@ ${log.contentLen } ${log.contentType } ${log.setCookie } - ${log.reqHeader } - ${log.respHeader } - ${log.website } + <%-- ${log.reqHeader } + ${log.respHeader } --%> + ${fns:abbr(log.capIp, 42)} @@ -381,8 +383,8 @@ - ${log.innerSmac } - ${log.innerDmac } + <%-- ${log.innerSmac } + ${log.innerDmac } --%> ${log.streamDir } @@ -393,7 +395,7 @@ - ${log.addrList } + <%-- ${log.addrList } --%> ${log.serverLocate} ${log.clientLocate} ${log.sAsn} From 15b1926e17e30c80a8d7c91eb6f7545bce658dd5 Mon Sep 17 00:00:00 2001 From: leijun Date: Sun, 30 Dec 2018 16:40:19 +0800 Subject: [PATCH 131/147] =?UTF-8?q?app=20Http=E3=80=81app=20DNS=E3=80=81ap?= =?UTF-8?q?p=20ssl=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/controller/BaseController.java | 53 +++++++++++++++--- .../java/com/nis/web/service/BaseService.java | 56 +++++++++++++++++-- .../sql/20181229/update_region_import.sql | 12 ++++ .../views/cfg/app/appMultiFeatureCfgList.jsp | 3 +- 4 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 src/main/resources/sql/20181229/update_region_import.sql diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index f9449c6ad..97840a1bd 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1231,12 +1231,14 @@ public class BaseController { BlockingQueue dnsResStrategies=null; List cfgIndexInfos = new ArrayList(); List appPolicyCfgs = new ArrayList(); + List appFeatureIndexs= new ArrayList(); List> asnNoMaps=Lists.newArrayList(); Map newAsnNoMap=Maps.newConcurrentMap(); Map OldAsnNoMap=Maps.newConcurrentMap(); asnNoMaps.add(newAsnNoMap); asnNoMaps.add(OldAsnNoMap); FunctionRegionDict appRegion = null; + FunctionRegionDict appFeatureRegion = null; if(serviceDict!=null) { String regionCode = serviceDict.getRegionCode(); for (String code : regionCode.split(",")) { @@ -1248,6 +1250,12 @@ public class BaseController { appRegion = d; break; } + + if (d != null && d.getFunctionId() != null + && (d.getFunctionId().intValue()==565 || d.getFunctionId().intValue()==564 || d.getFunctionId().intValue()==566 || d.getFunctionId().intValue()==563)) { + appFeatureRegion = d; + break; + } } } @@ -1375,6 +1383,7 @@ public class BaseController { String specServiceId = request.getParameter("appId"); String behaviorId = request.getParameter("behaviorId"); String asnIpGroup = request.getParameter("asnGroupId"); + String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend"); SpecificServiceCfg specificServiceCfg = null; if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33 || serviceDict.getServiceId().intValue() == 145 @@ -1385,6 +1394,9 @@ public class BaseController { || serviceDict.getServiceId().intValue() == 1028// app ip || serviceDict.getServiceId().intValue() == 1024//app http || serviceDict.getServiceId().intValue() == 1026//app domain + || serviceDict.getServiceId().intValue() == 1027//app dns + || serviceDict.getServiceId().intValue() == 1029//app ssl + || serviceDict.getServiceId().intValue() == 1025//app PAYLOAD )) { if (StringUtils.isNotBlank(specServiceId)) { specificServiceCfg = specificServiceCfgService @@ -1530,7 +1542,7 @@ public class BaseController { asnIpCfgs.add(_cfg); ind++; } - ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, asnIpCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1")); + ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, asnIpCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); cfgIndexInfos.clear(); appPolicyCfgs.clear(); _ipPortCfgs.clear(); @@ -1651,15 +1663,29 @@ public class BaseController { if(regionDict.getFunctionId().intValue()!=600 &®ionDict.getFunctionId().intValue()!=301 &®ionDict.getFunctionId().intValue()!=401 - &®ionDict.getFunctionId().intValue()!=405) { + &®ionDict.getFunctionId().intValue()!=405 + &®ionDict.getFunctionId().intValue()!=565 + &®ionDict.getFunctionId().intValue()!=566 + &®ionDict.getFunctionId().intValue()!=563) { CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"}); cfgIndexInfos.add(cfgIndexInfo); } + if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 || regionDict.getFunctionId().intValue()==563){ + AppFeatureIndex appfeature = new AppFeatureIndex(); + if(appFeatureRegion!=null){ + appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode())); + appfeature.setCfgRegionValue(regionDict.getConfigRegionValue()); + appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType())); + } + BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"}); + appFeatureIndexs.add(appfeature); + } + } ind++; } - ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _ipPortCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1")); + ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _ipPortCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); cfgIndexInfos.clear(); appPolicyCfgs.clear(); _ipPortCfgs.clear(); @@ -1784,7 +1810,7 @@ public class BaseController { } ind++; } - ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _stringCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1")); + ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _stringCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); cfgIndexInfos.clear(); appPolicyCfgs.clear(); _stringCfgs.clear(); @@ -1874,16 +1900,27 @@ public class BaseController { appPolicyCfgs.add(appPolicyCfg); } } else { - if(!regionDict.getFunctionId().equals(402)) { + if(!regionDict.getFunctionId().equals(402) && !regionDict.getFunctionId().equals(565) + && !regionDict.getFunctionId().equals(566) && !regionDict.getFunctionId().equals(564)) { CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"}); cfgIndexInfos.add(cfgIndexInfo); } - + if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 + || regionDict.getFunctionId().intValue()==564){ + AppFeatureIndex appfeature = new AppFeatureIndex(); + BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"}); + if(appFeatureRegion!=null){ + appfeature.setCfgRegionCode1(String.valueOf(appFeatureRegion.getConfigRegionCode())); + appfeature.setCfgRegionValue(appFeatureRegion.getConfigRegionValue()); + appfeature.setCfgRegionType(String.valueOf(appFeatureRegion.getRegionType())); + } + appFeatureIndexs.add(appfeature); + } } ind++; } - ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1")); + ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); cfgIndexInfos.clear(); appPolicyCfgs.clear(); _complexkeywordCfgs.clear(); @@ -1923,7 +1960,7 @@ public class BaseController { cfg.setCompileId(compileIds.get(ind)); ind++; } - ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _dnsResStrategies, cfgIndexInfos, appPolicyCfgs,isSend.equals("1")); + ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _dnsResStrategies, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); _dnsResStrategies.clear(); cfgIndexInfos.clear(); appPolicyCfgs.clear(); diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index 83a3ed2fc..77fe7a122 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -46,7 +46,9 @@ import com.nis.domain.callback.InlineIp; import com.nis.domain.callback.NtcDnsResStrategy; import com.nis.domain.callback.ProxyObjKeyring; import com.nis.domain.callback.ProxyObjTrustedCa; +import com.nis.domain.configuration.AppComplexFeatureCfg; import com.nis.domain.configuration.AppDomainCfg; +import com.nis.domain.configuration.AppFeatureIndex; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; @@ -87,6 +89,7 @@ import com.nis.util.StringUtil; import com.nis.util.StringUtils; import com.nis.web.dao.basics.AsnIpCfgDao; import com.nis.web.dao.configuration.AppCfgDao; +import com.nis.web.dao.configuration.AppMultiFeatureCfgDao; import com.nis.web.dao.configuration.DdosCfgDao; import com.nis.web.dao.configuration.DnsIpCfgDao; import com.nis.web.dao.configuration.DnsResStrategyDao; @@ -1595,7 +1598,9 @@ public abstract class BaseService { public void saveAndSend(FunctionRegionDict regionDict,FunctionServiceDict serviceDict, SpecificServiceCfg specificServiceCfg, List list,List cfgIndexInfos, - List appPolicyCfgs,boolean send){ + List appPolicyCfgs, + List appFeatureCfgs, + boolean send){ if(list!=null&&list.size()>0) { String type=null; if (list.get(0) instanceof BaseIpCfg) { @@ -1615,6 +1620,10 @@ public abstract class BaseService { if (appPolicyCfgs != null && appPolicyCfgs.size() > 0) { this.savePolicyList(appPolicyCfgs); } + if (appFeatureCfgs != null && appFeatureCfgs.size() > 0) { + this.saveAppFeatureList(appFeatureCfgs); + } + if("BaseIpCfg".equals(type)) { List listPage = (List) list; if (specificServiceCfg!=null&®ionDict.getFunctionId().equals(405)) { @@ -1729,7 +1738,11 @@ public abstract class BaseService { if(regionDict.getDictId().intValue()==63) { // appCfgService.saveAppHttpCfg(listPage); this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, AppHttpCfg.getTablename(),send); - }else + }else + //app Http特征 + if(regionDict.getDictId().intValue()==220 || regionDict.getDictId().intValue()==216 || regionDict.getDictId().intValue()==224){ + this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage,"app_complex_feature_cfg",send); + } // HTTP(s)请求头域 if(regionDict.getDictId().intValue()==98 || regionDict.getDictId().intValue()==80 || regionDict.getDictId().intValue()==86 || regionDict.getDictId().intValue()==92 || @@ -2058,6 +2071,31 @@ public abstract class BaseService { } } } + + + /** + * 导入配置保存App特征 + * @param appPolicyCfgs + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveAppFeatureList(List appFeatures){ + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < appFeatures.size();index++){ + AppFeatureIndex _cfg = appFeatures.get(index); + ((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppFeatureIndex(_cfg); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + } + + /** * 导入配置时数据批量入库(IP配置) * @@ -2087,7 +2125,12 @@ public abstract class BaseService { BeanUtils.copyProperties(_cfg, dnsIpCfg); //如果insert加入了select last_insert_id,会拖慢6~7倍以上的效率 ((DnsIpCfgDao) batchSqlSession.getMapper(DnsIpCfgDao.class)).insert(dnsIpCfg); - }else { + } else if(regionDict.getFunctionId().equals(565) || regionDict.getFunctionId().equals(566) || regionDict.getFunctionId().equals(563)){ + AppIpCfg app =new AppIpCfg(); + BeanUtils.copyProperties(_cfg, app); + ((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppIpRangeCfg(app); + } + else { batchSqlSession.getMapper(IpCfgDao.class).insertForBatch(_cfg); } @@ -2307,7 +2350,12 @@ public abstract class BaseService { AppHttpCfg _cfg=new AppHttpCfg(); BeanUtils.copyProperties(cfg, _cfg); ((AppCfgDao) batchSqlSession.getMapper(AppCfgDao.class)).insertAppHttpCfgBatch(_cfg); - }else { + }else if(regionDict.getDictId().intValue()==220 || regionDict.getDictId().intValue()==216 || regionDict.getDictId().intValue()==224){ + AppComplexFeatureCfg appCfg=new AppComplexFeatureCfg(); + BeanUtils.copyProperties(cfg, appCfg); + ((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppComplexFeatureCfg(appCfg); + } + else { ((StringCfgDao) batchSqlSession.getMapper(StringCfgDao.class)).saveComplexkeywordCfgBatch(cfg); } if (send) { diff --git a/src/main/resources/sql/20181229/update_region_import.sql b/src/main/resources/sql/20181229/update_region_import.sql new file mode 100644 index 000000000..805bf9244 --- /dev/null +++ b/src/main/resources/sql/20181229/update_region_import.sql @@ -0,0 +1,12 @@ +# App Httpñ״̬ +update function_region_dict set is_import='1' where dict_id='220'; +update function_region_dict set is_import='1' where dict_id='223'; +update function_service_dict set is_import='1' where dict_id='134'; +#dnsñ״̬ +update function_region_dict set is_import='1' where dict_id='216'; +update function_service_dict set is_import='1' where dict_id='133'; +#sslñ״̬ +update function_region_dict set is_import='1' where dict_id='224'; +update function_region_dict set is_import='1' where dict_id='227'; +update function_service_dict set is_import='1' where dict_id='135'; + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgList.jsp index 2c784e642..764aa57ea 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgList.jsp @@ -441,7 +441,8 @@ - + + <%@include file="/WEB-INF/include/excel/importModal.jsp" %> From 85e65a86ab7133085eeac11e46762118c3cdeab6 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sun, 30 Dec 2018 14:55:55 +0600 Subject: [PATCH 132/147] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=87=BA=E5=A2=9E=E5=8A=A0PNG=E5=92=8CPDF?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficActionTransList.jsp | 1 + .../WEB-INF/views/dashboard/trafficAppTypeList.jsp | 9 +++++++++ .../WEB-INF/views/dashboard/trafficBandwidthList.jsp | 1 + .../WEB-INF/views/dashboard/trafficDomainTrans.jsp | 1 + .../WEB-INF/views/dashboard/trafficIpActiveList.jsp | 3 ++- .../WEB-INF/views/dashboard/trafficPortActiveList.jsp | 1 + .../views/dashboard/trafficProtocolTypeList.jsp | 9 +++++++++ .../WEB-INF/views/dashboard/trafficWebTypeList.jsp | 11 +++++++++++ .../static/global/plugins/highcharts/js/exporting.js | 8 ++++---- 9 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index 4ea77f05f..c56cee2b8 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -115,6 +115,7 @@ function showActionTransChart(xData,series){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 0dcebbcfc..3aa94612a 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -356,6 +356,15 @@ function protocolTypeChart(rs){ scale:1, sourceWidth: 1280, sourceHeight: 500, + buttons: { + contextButton: { + menuItems: [ + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF' + ] + } + } }, noData:{ style: {//设置字体颜色 diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index 5bd6459ee..c2c1a9a07 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -293,6 +293,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 349c723ed..900278a3a 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -111,6 +111,7 @@ function showDomainTrans(xData,series){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index ecbf6e068..ada214487 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -194,8 +194,9 @@ function showIpActiveChart(xData,series){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel - Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3]// cvs ] } } diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp index 5ab6bb519..2b9c6f5cf 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp @@ -126,6 +126,7 @@ function showPortActiveChart(xData,series){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 7cec1ad53..e79cd81a3 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -351,6 +351,15 @@ function protocolTypeChart(rs){ scale:1, sourceWidth: 1280, sourceHeight: 500, + buttons: { + contextButton: { + menuItems: [ + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF' + ] + } + } }, noData:{ style: {//设置字体颜色 diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index cead57a20..5744ab6c1 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -443,6 +443,17 @@ function webTypeChart(rs){ scale:1, sourceWidth: 1280, sourceHeight: 500, + buttons: { + contextButton: { + menuItems: [ + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs + ] + } + } }, noData:{ style: {//设置字体颜色 diff --git a/src/main/webapp/static/global/plugins/highcharts/js/exporting.js b/src/main/webapp/static/global/plugins/highcharts/js/exporting.js index 20b9b35c3..3fd709679 100644 --- a/src/main/webapp/static/global/plugins/highcharts/js/exporting.js +++ b/src/main/webapp/static/global/plugins/highcharts/js/exporting.js @@ -7,10 +7,10 @@ License: www.highcharts.com/license */ (function(l){"object"===typeof module&&module.exports?module.exports=l:"function"===typeof define&&define.amd?define(function(){return l}):l("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(l){(function(g){var y=g.defaultOptions,z=g.doc,l=g.Chart,q=g.addEvent,I=g.removeEvent,C=g.fireEvent,t=g.createElement,D=g.discardElement,r=g.css,p=g.merge,u=g.pick,E=g.objectEach,x=g.extend,J=g.isTouchDevice,A=g.win,G=A.navigator.userAgent,F=g.SVGRenderer,H=g.Renderer.prototype.symbols,K=/Edge\/|Trident\/|MSIE /.test(G), -L=/firefox/i.test(G);x(y.lang,{printChart:"Print chart"/*,downloadPNG:"Download PNG image"*/,downloadJPEG:"Download image"/*,downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image"*/,contextButtonTitle:"Chart context menu"});y.navigation||(y.navigation={});p(!0,y.navigation,{buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}});p(!0,y.navigation,{menuStyle:{border:"1px solid #999999",background:"#ffffff", +L=/firefox/i.test(G);x(y.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});y.navigation||(y.navigation={});p(!0,y.navigation,{buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}});p(!0,y.navigation,{menuStyle:{border:"1px solid #999999",background:"#ffffff", padding:"5px 0"},menuItemStyle:{padding:"0.5em 1em",color:"#333333",background:"none",fontSize:J?"14px":"11px",transition:"background 250ms, color 250ms"},menuItemHoverStyle:{background:"#335cad",color:"#ffffff"},buttonOptions:{symbolFill:"#666666",symbolStroke:"#666666",symbolStrokeWidth:3,theme:{padding:5}}});y.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-contextbutton",menuClassName:"highcharts-contextmenu", -symbol:"menu",titleKey:"contextButtonTitle",menuItems:"printChart downloadJPEG".split(" ")}},menuItemDefinitions:{printChart:{textKey:"printChart",onclick:function(){this.print()}}/*,separator:{separator:!0},downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChart()}}*/,downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},/*downloadPDF:{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},*/ -/*downloadSVG:{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}*/}};g.post=function(b,a,d){var c=t("form",p({method:"post",action:b,enctype:"multipart/form-data"},d),{display:"none"},z.body);E(a,function(a,b){t("input",{type:"hidden",name:b,value:a},null,c)});c.submit();D(c)};x(l.prototype,{sanitizeSVG:function(b,a){if(a&&a.exporting&&a.exporting.allowHTML){var d=b.match(/<\/svg>(.*?$)/);d&&d[1]&&(d='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+a.chart.width+'" height\x3d"'+ +symbol:"menu",titleKey:"contextButtonTitle",menuItems:"printChart downloadJPEG".split(" ")}},menuItemDefinitions:{printChart:{textKey:"printChart",onclick:function(){this.print()}},separator:{separator:!0},downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChart()}},downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},downloadPDF:{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}}, +downloadSVG:{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}}};g.post=function(b,a,d){var c=t("form",p({method:"post",action:b,enctype:"multipart/form-data"},d),{display:"none"},z.body);E(a,function(a,b){t("input",{type:"hidden",name:b,value:a},null,c)});c.submit();D(c)};x(l.prototype,{sanitizeSVG:function(b,a){if(a&&a.exporting&&a.exporting.allowHTML){var d=b.match(/<\/svg>(.*?$)/);d&&d[1]&&(d='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+a.chart.width+'" height\x3d"'+ a.chart.height+'"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+d[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",b=b.replace("\x3c/svg\x3e",d+"\x3c/svg\x3e"))}b=b.replace(/zIndex="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(\S+)("|")\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/.*?$/, "\x3c/svg\x3e").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1\x3d"rgb($2)" $1-opacity\x3d"$3"').replace(/ /g,"\u00a0").replace(/­/g,"\u00ad");this.ieSanitizeSVG&&(b=this.ieSanitizeSVG(b));return b},getChartHTML:function(){this.styledMode&&this.inlineStyles();return this.container.innerHTML},getSVG:function(b){var a,d,c,w,m,h=p(this.options,b);d=t("div",null,{position:"absolute",top:"-9999em",width:this.chartWidth+"px",height:this.chartHeight+"px"},z.body);c= this.renderTo.style.width;m=this.renderTo.style.height;c=h.exporting.sourceWidth||h.chart.width||/px$/.test(c)&&parseInt(c,10)||(h.isGantt?800:600);m=h.exporting.sourceHeight||h.chart.height||/px$/.test(m)&&parseInt(m,10)||400;x(h.chart,{animation:!1,renderTo:d,forExport:!0,renderer:"SVGRenderer",width:c,height:m});h.exporting.enabled=!1;delete h.data;h.series=[];this.series.forEach(function(a){w=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});w.isInternal|| @@ -31,4 +31,4 @@ e[d.nodeName]||(n=k.getElementsByTagName("svg")[0],w=k.createElementNS(d.namespa l=d.inlineWhitelist,h=d.unstyledElements,e={},n,k,d=z.createElement("iframe");r(d,{width:"1px",height:"1px",visibility:"hidden"});z.body.appendChild(d);k=d.contentWindow.document;k.open();k.write('\x3csvg xmlns\x3d"http://www.w3.org/2000/svg"\x3e\x3c/svg\x3e');k.close();a(this.container.querySelector("svg"));n.parentNode.removeChild(n)};H.menu=function(b,a,d,c){return["M",b,a+2.5,"L",b+d,a+2.5,"M",b,a+c/2+.5,"L",b+d,a+c/2+.5,"M",b,a+c-1.5,"L",b+d,a+c-1.5]};H.menuball=function(b,a,d,c){b=[];c=c/3- 2;return b=b.concat(this.circle(d-c,a,c,c),this.circle(d-c,a+c+4,c,c),this.circle(d-c,a+2*(c+4),c,c))};l.prototype.renderExporting=function(){var b=this,a=b.options.exporting,d=a.buttons,c=b.isDirtyExporting||!b.exportSVGElements;b.buttonOffset=0;b.isDirtyExporting&&b.destroyExport();c&&!1!==a.enabled&&(b.exportEvents=[],b.exportingGroup=b.exportingGroup||b.renderer.g("exporting-group").attr({zIndex:3}).add(),E(d,function(a){b.addButton(a)}),b.isDirtyExporting=!1);q(b,"destroy",b.destroyExport)}; q(l,"init",function(){var b=this;["exporting","navigation"].forEach(function(a){b[a]={update:function(d,c){b.isDirtyExporting=!0;p(!0,b.options[a],d);u(c,!0)&&b.redraw()}}})});l.prototype.callbacks.push(function(b){b.renderExporting();q(b,"redraw",b.renderExporting)})})(l)}); -//# sourceMappingURL=exporting.js.map \ No newline at end of file +// # sourceMappingURL=exporting.js.map From fb0ef7e6a1ec648f30f640592264947bab2ddb10 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sun, 30 Dec 2018 15:15:01 +0600 Subject: [PATCH 133/147] =?UTF-8?q?=E5=A2=9E=E5=8A=A0png=E5=92=8Cpdf?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp index 8f2d485f6..20aa1ebc7 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -141,6 +141,7 @@ menuItems : [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] From 2f3a1a28e8276004c73d1f22881119cacf63097a Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Mon, 31 Dec 2018 17:15:32 +0800 Subject: [PATCH 134/147] =?UTF-8?q?=E6=B3=A8=E6=84=8F=EF=BC=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=9A=84=E9=85=8D=E7=BD=AE=E5=86=85=E5=AE=B9=E5=8F=91?= =?UTF-8?q?=E6=94=BE=E5=88=B0=E6=96=87=E4=BB=B6=E6=9C=80=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/nis.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 04e37ebf4..b9afa1648 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -268,9 +268,6 @@ pxyHttpLog=pxyHttpLogs mmSpeakerRecognizationLog=mmSpeakerRecognizationLogs mmLogoDetectionLog=mmLogoDetectionLogs mmFaceRecognizationLog=mmFaceRecognizationLogs -trafficAreaStat=trafficAreaStat -logServiceTopn=logServiceTopn -blockAndDropStat=blockAndDropStat ######################################## #\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3 dashboardUrl=http://10.0.7.14:9999/galaxy-service/service/log/v1/ @@ -609,4 +606,7 @@ trendTotalReport=trendTotalReport ntcEventsMonitorOrBlock=ntcEventsMonitorOrBlock #\u91cd\u70b9\u4fdd\u969c\u4e8b\u4ef6 ntcEventKeyProtection=ntcEventKeyProtection -dashboardUrlV2=http://10.0.7.14:9999/galaxy-service/service/log/v2/ \ No newline at end of file +dashboardUrlV2=http://10.0.7.14:9999/galaxy-service/service/log/v2/ +trafficAreaStat=trafficAreaStat +logServiceTopn=logServiceTopn +blockAndDropStat=blockAndDropStat \ No newline at end of file From c33bf081a597831c8d121baec751a35aa47f64b3 Mon Sep 17 00:00:00 2001 From: leijun Date: Wed, 2 Jan 2019 11:24:06 +0800 Subject: [PATCH 135/147] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20bgp=E3=80=81ssl=20=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=90=8E=20=E5=9B=9E=E8=B0=83list=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp | 2 +- src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp index 4c9683a85..87d6b929b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp @@ -516,7 +516,7 @@ - + <%@include file="/WEB-INF/include/excel/importModal.jsp" %> diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp index 79413ecfe..80a66efa1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp @@ -512,7 +512,7 @@ - + <%@include file="/WEB-INF/include/excel/importModal.jsp" %> From 92a0d9ab6e27a04060d84ed4ee473495cb60f465 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 2 Jan 2019 11:41:10 +0800 Subject: [PATCH 136/147] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=AF=A6=E6=83=85=E7=95=8C=E9=9D=A2=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficAppTypeList.jsp | 19 +++-- .../dashboard/trafficHttpStatisticList.jsp | 21 +++-- .../dashboard/trafficProtocolTypeList.jsp | 19 +++-- .../views/dashboard/trafficWebTypeList.jsp | 26 ++++--- .../webapp/static/pages/css/pagination.css | 77 +++++++++++++------ 5 files changed, 113 insertions(+), 49 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 3aa94612a..2e4a1b06e 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -109,7 +109,7 @@ -
    +
    / ,
      
    @@ -141,6 +141,7 @@ $(document).ready(function(){ // setInterval(function(){ // ajaxAppList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); // },500000);// 五分钟调用一次 + $('.pageView').hide(); }); function searchList(){ loading(); @@ -175,10 +176,10 @@ function ajaxAppList(start,end){ closeTip(); if(data!= null&&data.length<1){ $(".none-data").show(); - $('.M-box').hide(); + $('.pageView').hide(); }else{ $('.none-data').hide(); - $('.M-box').show(); + $('.pageView').show(); } }, error: function(data, textStatus, errorThrown){ @@ -257,10 +258,10 @@ function htmlData(fileDataS){ $("#tableData").html(""); if(fileDataS == null||(fileDataS!=null&&fileDataS.length<1)){ $(".none-data").show(); - $('.M-box').hide(); + $('.pageView').hide(); }else{ $('.none-data').hide(); - $('.M-box').show(); + $('.pageView').show(); $.each(fileDataS,function (index,data){ if(data!=null){ @@ -315,6 +316,7 @@ function pageJuan(showData) { if(showData > totalData){ showData = totalData; } + var current=1; $('.M-box').pagination({ totalData: totalData, showData: showData, @@ -322,8 +324,15 @@ function pageJuan(showData) { callback: function (index) { //改变显示开始和结束数据编号 getPageData(index.getCurrent(),showData); + current=index.getCurrent(); + $(".pageCurrent").val(current); } }); + if(totalData<10){ + $(".pageCurrent").val(1); + } + $(".pageTotal").text(totalData); + $(".pageNum").text(Math.ceil(totalData/10)); } } // 比例协议统计图 diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp index 6b5516257..40e87c59e 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp @@ -86,7 +86,7 @@ -
    +
    / ,
      
    @@ -117,6 +117,7 @@ $(document).ready(function(){ // setInterval(function(){ // ajaxProtocolList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); // },500000);// 五分钟调用一次 + $('.pageView').hide(); }); function searchList(){ var start=$("#beginDate").val(); @@ -149,14 +150,14 @@ function ajaxProtocolList(start,end){ closeTip(); if(data!= null&&data.length<1){ $(".none-data").show(); - $('.M-box').hide(); + $('.pageView').hide(); }else if(data[0].allLink==0&&data[0].allPackets==0&&data[0].allGByte==0){ $("#tableData").html(""); $(".none-data").show(); - $('.M-box').hide(); + $('.pageView').hide(); }else{ $('.none-data').hide(); - $('.M-box').show(); + $('.pageView').show(); } }, error: function(data, textStatus, errorThrown){ @@ -234,10 +235,10 @@ function htmlData(fileDataS){ $("#tableData").html(""); if(fileDataS == null||(fileDataS!=null&&fileDataS.length<1)){ $(".none-data").show(); - $('.M-box').hide(); + $('.pageView').hide(); }else{ $('.none-data').hide(); - $('.M-box').show(); + $('.pageView').show(); var start=$("#beginDate").val(); var end=$("#endDate").val(); $.each(fileDataS,function (index,data){ @@ -278,6 +279,7 @@ function pageJuan(showData) { if(showData > totalData){ showData = totalData; } + var current=1; $('.M-box').pagination({ totalData: totalData, showData: showData, @@ -285,8 +287,15 @@ function pageJuan(showData) { callback: function (index) { //改变显示开始和结束数据编号 getPageData(index.getCurrent(),showData); + current=index.getCurrent(); + $(".pageCurrent").val(current); } }); + if(totalData<10){ + $(".pageCurrent").val(1); + } + $(".pageTotal").text(totalData); + $(".pageNum").text(Math.ceil(totalData/10)); } } diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index e79cd81a3..b9dfa4692 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -99,7 +99,7 @@ -
    +
    / ,
      
    @@ -132,6 +132,7 @@ $(document).ready(function(){ // setInterval(function(){ // ajaxProtocolList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); // },500000);// 五分钟调用一次 + $('.pageView').hide(); }); function searchList(){ loading(); @@ -249,11 +250,11 @@ function getPageData(currentPage,pageNumber){ function htmlData(fileDataS){ $("#tableData").html(""); if(fileDataS == null||(fileDataS!=null&&fileDataS.length<1)){ - $(".none-data").show(); - $('.M-box').hide(); + $(".none-data").show(); + $('.pageView').hide(); }else{ - $('.none-data').hide(); - $('.M-box').show(); + $('.none-data').hide(); + $('.pageView').show(); var start=$("#beginDate").val(); var end=$("#endDate").val(); $.each(fileDataS,function (index,data){ @@ -309,6 +310,7 @@ function pageJuan(showData) { if(showData > totalData){ showData = totalData; } + var current=1; $('.M-box').pagination({ totalData: totalData, showData: showData, @@ -316,8 +318,15 @@ function pageJuan(showData) { callback: function (index) { //改变显示开始和结束数据编号 getPageData(index.getCurrent(),showData); + current=index.getCurrent(); + $(".pageCurrent").val(current); } }); + if(totalData<10){ + $(".pageCurrent").val(1); + } + $(".pageTotal").text(totalData); + $(".pageNum").text(Math.ceil(totalData/10)); } } // 比例协议统计图 diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 5744ab6c1..2c3e08c2d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -152,13 +152,8 @@ -
    -
    -
    -
    -    - -
    +
    / ,
    +
      
    @@ -196,6 +191,7 @@ // ajaxWebTypeList(starth, new Date() // .Format("yyyy-MM-dd HH:mm:00")); // }, 500000);// 五分钟调用一次 + $('.pageView').hide(); }); function searchList() { var start = $("#beginDate").val(); @@ -237,10 +233,10 @@ closeTip(); if (data != null && data.length < 1) { $(".none-data").show(); - $('.M-box').hide(); + $('.pageView').hide(); } else { $('.none-data').hide(); - $('.M-box').show(); + $('.pageView').show(); } }, error : function(data, textStatus, errorThrown) { @@ -321,10 +317,10 @@ $("#tableData").html(""); if (fileDataS == null || fileData == '') { $(".none-data").show(); - $('.M-box').hide(); + $('.pageView').hide(); } else { $('.none-data').hide(); - $('.M-box').show(); + $('.pageView').show(); var start=$("#beginDate").val(); var end=$("#endDate").val(); var totalunique=0; @@ -401,6 +397,7 @@ if (showData > totalData) { showData = totalData; } + var current=1; $('.M-box').pagination({ totalData : totalData, showData : showData, @@ -408,8 +405,15 @@ callback : function(index) { //改变显示开始和结束数据编号 getPageData(index.getCurrent(), showData); + current=index.getCurrent(); + $(".pageCurrent").val(current); } }); + if(totalData<10){ + $(".pageCurrent").val(1); + } + $(".pageTotal").text(totalData); + $(".pageNum").text(Math.ceil(totalData/10)); } } // 比例域名统计图 diff --git a/src/main/webapp/static/pages/css/pagination.css b/src/main/webapp/static/pages/css/pagination.css index bb078001f..b5b899f17 100644 --- a/src/main/webapp/static/pages/css/pagination.css +++ b/src/main/webapp/static/pages/css/pagination.css @@ -5,6 +5,9 @@ width:960px; height:100%; } +.M-box{ + margin-bottom: 10px; +} .M-box,.M-box1,.M-box2,.M-box3{ position: relative; text-align: center; @@ -20,49 +23,79 @@ } .M-box span,.M-box1 span,.M-box2 span,.M-box3 span{ float: left; - margin:0 5px; - width: 38px; - height: 38px; - line-height: 38px; - color: #bdbdbd; - font-size: 14px; + line-height: 33px; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #999999; + border-left-width: 0; } .M-box .active,.M-box1 .active,.M-box2 .active,.M-box3 .active{ float: left; - margin:0 5px; - width: 38px; - height: 38px; - line-height: 38px; - background: #3598dc; - color: #fff; + width: 30px; + height: 33px; + line-height: 33px; + background: #f5f5f5; + color: #999999; font-size: 14px; - border: 1px solid #3598dc; + border: 1px solid #DDDDDD; } .M-box a,.M-box1 a,.M-box2 a,.M-box3 a{ float: left; - margin:0 5px; - width: 38px; - height: 38px; - line-height: 38px; + width: 30px; + height: 33px; + line-height: 33px; background: #fff; border: 1px solid #ebebeb; - color: #08c; + color: #3598DC; font-size: 14px; + text-decoration:none } .M-box a:hover,.M-box1 a:hover,.M-box2 a:hover,.M-box3 a:hover{ - color:#fff; - background: #3598dc; + color:#23527c; + background: #f5f5f5; } .M-box .next,.M-box .prev,.M-box1 .next,.M-box1 .prev{ - font-family: "Simsun"; + font-family: "Open Sans", sans-serif; font-size: 16px; font-weight: bold; + line-height: 30px; } .now,.count{ padding:0 5px; color:#f00; } - +.dian-dian{ + float: left; + width: 30px; + height: 33px; + font-size: 14px; + line-height: 33px; + color: #999999; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #DDDDDD !important; + border-left-width: 0 !important;; + border-right-width: 0 !important;; +} +.pageView{ + display: inline-flex; + height: 33px; +} +.pageMessage{ + color:#999999; + display: inline-block; + margin: 7px; +} +.pageMessage input{ + border: 1px solid #ddd; + color:#999999; + width:10%; + height: 22px; + font-size: 14px; + line-height: 33px; + margin-left:5px; + text-align:center; +} /* input{ float: left; From 52551e63da95ca6d384285795f1bc77b344b9c76 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 2 Jan 2019 11:41:34 +0800 Subject: [PATCH 137/147] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/static/pages/scripts/jquery.pagination.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/static/pages/scripts/jquery.pagination.js b/src/main/webapp/static/pages/scripts/jquery.pagination.js index e8444931d..f4ebc5ab8 100644 --- a/src/main/webapp/static/pages/scripts/jquery.pagination.js +++ b/src/main/webapp/static/pages/scripts/jquery.pagination.js @@ -21,8 +21,8 @@ current:1, //当前第几页 prevCls:'prev', //上一页class nextCls:'next', //下一页class - prevContent:'<', //上一页内容 - nextContent:'>', //下一页内容 + prevContent:'«', //上一页内容 + nextContent:'»', //下一页内容 activeCls:'active', //当前页选中状态 coping:false, //首页和尾页 homePage:'', //首页节点内容 @@ -80,7 +80,7 @@ } if(current >= opts.count * 2 && current != 1 && pageCount != opts.count){ var home = opts.coping && opts.homePage ? opts.homePage : '1'; - html += opts.coping ? ''+home+'...' : ''; + html += opts.coping ? ''+home+'...' : ''; } var start = current - opts.count, end = current + opts.count; @@ -97,7 +97,7 @@ } if(current + opts.count < pageCount && current >= 1 && pageCount > opts.count){ var end = opts.coping && opts.endPage ? opts.endPage : pageCount; - html += opts.coping ? '...'+end+'' : ''; + html += opts.coping ? '...'+end+'' : ''; } if(current < pageCount){//下一页 html += ''+opts.nextContent+'' From af8eb2f5464bfac95f409cefebeee391ac1070a2 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Wed, 2 Jan 2019 10:15:29 +0600 Subject: [PATCH 138/147] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E6=96=87=E4=BB=B6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/messages/message_en.properties | 7 +++++-- src/main/resources/messages/message_ru.properties | 7 +++++-- src/main/resources/messages/message_zh_CN.properties | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index b0b58fa79..e35ca8087 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1355,7 +1355,7 @@ translated_dest_ip=Translated destination address translated_dest_port=Translated destination port show_ips=View all IP show_available_ips=View available IP -radius_log=Radius Log +radius_log=Radius Record message_type=Code nas_ip=NAS IP Address framed_ip=Framed IP Address @@ -1435,4 +1435,7 @@ min_length=Minimum Length length_error=Length Error duplicate=Duplicate print=Print -traffic_connect_log=Traffic Log \ No newline at end of file +traffic_connect_log=Traffic Log +keyword_log_to_url=KeywordLogToURL +http_log=HTTP Logs +cut_sample_tool=Cut Sample Tool \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 4d23d483d..8b97df174 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1359,7 +1359,7 @@ translated_dest_ip=\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\ translated_dest_port=\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u041f\u043e\u0440\u0442 \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f show_ips=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0412\u0441\u0435 IP show_available_ips=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 IP -radius_log=\u0416\u0443\u0440\u043D\u0430\u043B Radius +radius_log=\u0417\u0430\u043F\u0438\u0441\u0438 Radius message_type=\u041a\u043e\u0434 nas_ip=NAS IP-\u0430\u0434\u0440\u0435\u0441 framed_ip=Framed IP-\u0430\u0434\u0440\u0435\u0441 @@ -1439,4 +1439,7 @@ min_length=Minimum Length length_error=Length Error duplicate=Duplicate print=Print -traffic_connect_log=\u0416\u0443\u0440\u043D\u0430\u043B \u0422\u0440\u0430\u0444\u0438\u043A\u0430 \ No newline at end of file +traffic_connect_log=\u0416\u0443\u0440\u043D\u0430\u043B \u0422\u0440\u0430\u0444\u0438\u043A\u0430 +keyword_log_to_url=KeywordLogToURL +http_log=HTTP Logs +cut_sample_tool=Cut Sample Tool \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index cc06f9266..07a1d0de1 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1435,4 +1435,7 @@ min_length=\u6700\u5c0f\u957f\u5ea6 length_error=\u957f\u5ea6\u9519\u8bef duplicate=\u91cd\u590d\u7684 print=\u6253\u5370 -traffic_connect_log=\u6D41\u91CF\u65E5\u5FD7 \ No newline at end of file +traffic_connect_log=\u6D41\u91CF\u65E5\u5FD7 +keyword_log_to_url=\u5173\u952E\u5B57\u65E5\u5FD7\u8F6CURL +http_log=HTTP \u65E5\u5FD7 +cut_sample_tool=\u6837\u4F8B\u526A\u5207\u5DE5\u5177 \ No newline at end of file From 764c90932bebd50b9d3e91e70d42cb0466b91400 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Wed, 2 Jan 2019 11:59:25 +0600 Subject: [PATCH 139/147] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=B0=83=E5=BA=A6=E9=80=9A=E7=94=A8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/util/SchedulerTaskUtil.java | 189 ++++++++++++++++++ .../nis/util/ServiceConfigTemplateUtil.java | 33 ++- .../nis/web/controller/BaseController.java | 2 +- .../ConfigSynchronizationDao.xml | 142 +++++++++++-- 4 files changed, 348 insertions(+), 18 deletions(-) create mode 100644 src/main/java/com/nis/util/SchedulerTaskUtil.java diff --git a/src/main/java/com/nis/util/SchedulerTaskUtil.java b/src/main/java/com/nis/util/SchedulerTaskUtil.java new file mode 100644 index 000000000..e79e9432c --- /dev/null +++ b/src/main/java/com/nis/util/SchedulerTaskUtil.java @@ -0,0 +1,189 @@ +package com.nis.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.google.common.collect.Lists; +import com.nis.domain.configuration.AvFileSampleCfg; +import com.nis.domain.configuration.AvSignSampleCfg; +import com.nis.domain.configuration.BaseCfg; +import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.DnsIpCfg; +import com.nis.domain.configuration.DnsResStrategy; +import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.PxyObjKeyring; +import com.nis.domain.configuration.PxyObjTrustedCaCert; +import com.nis.domain.configuration.PxyObjTrustedCaCrl; +import com.nis.web.dao.configuration.ConfigSynchronizationDao; +import com.nis.web.service.BaseService; +import com.nis.web.service.SpringContextHolder; + +/** + * 配置任务调度通用类 + * 定时任务调用,处理界面配置状态修改,以及下发综合服务处理 + * @author ThinkPad + * + */ +public class SchedulerTaskUtil { + + //调度任务的配置信息,复用配置同步DAO + private static ConfigSynchronizationDao configSynchronizationDao = SpringContextHolder.getBean(ConfigSynchronizationDao.class); + + /** + * 根据业务与编译ID查询配置,修改失效或生效状态,并下发至综合服务 + * @param serviceId 不可空 + * @param compileId 不可空 + * @param oldIsValid 配置当前状态 0无效,1有效,可空 + * @param newIsValid 配置最新修改状态 0无效,1有效,不可空 + * @return boolean + */ + public boolean updateConfigByServiceAndCompile(Integer serviceId,Integer compileId,Integer oldIsValid,Integer newIsValid){ + //根据业务查询配置文件,获取该业务的配置域表信息 + ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil(); + List> serviceList = serviceTemplate.getServiceListByServiceId(serviceId); + //根据编译ID查询配置表中的配置信息 + for(Map service:serviceList){ + String tableName = service.get("tableName").toString(); + String serviceType = service.get("serviceType").toString(); + String className = service.get("className").toString(); + BaseCfg entity = new BaseCfg(); + entity.setServiceId(serviceId); + entity.setCompileId(compileId); + entity.setTableName(tableName); + List list = Lists.newArrayList(); + if("1".equals(serviceType)){//maat类配置 + //查询配置 + if("cfg_index_info".equals(tableName)){ + list = configSynchronizationDao.getCfgIndexList(entity); + + }else if("file_digest_cfg".equals(tableName)){ + list = configSynchronizationDao.getFileDigestListByService(entity); + + }else if("app_policy_cfg".equals(tableName)){ + list = configSynchronizationDao.getAppPolicyList(entity); + + }else if("app_feature_index".equals(tableName)){ + list = configSynchronizationDao.getAppFeatureIndexList(entity); + + } + if(newIsValid.equals(1)){//生效 + //调用综合服务配置生效启用接口 + + }else if(newIsValid.equals(0)){//失效 + //调用综合服务配置失效停用接口 + + } + }else if("2".equals(serviceType)){//回调类配置 + List newList = Lists.newArrayList(); + List ids = Lists.newArrayList(); + //查询配置 + if(entity.getServiceId().equals(3)){//ip drop回调类配置用了主表和子表关系 + list = configSynchronizationDao.getCfgIndexList(entity); + if(!StringUtil.isEmpty(list)){ + List compileIds = Lists.newArrayList(); + for(int i=0;i(); + list=configSynchronizationDao.getPxyObjTrustedCrlCfgListByCertId(ids); + for(int i=0;i(); + //只允许单独下发certId为空或0的crl配置 + list = configSynchronizationDao.getPxyObjTrustedCrlCfgList(entity); + for(int i=0;i> getServiceList(Integer functionId){ + public List> getServiceListByFunctionId(Integer functionId){ List> list =new ArrayList(); if(!StringUtil.isEmpty(functionId)) { List serviceList = DictUtils.getFunctionServiceDictList(functionId); @@ -97,6 +96,34 @@ public class ServiceConfigTemplateUtil { } + } + } + return list; + } + /** + * + * @param serviceId + * @return + */ + public List> getServiceListByServiceId(Integer serviceId){ + List> list =new ArrayList(); + if(!StringUtil.isEmpty(serviceId)) { + List elements = root.selectNodes("service"); + for(Element element:elements){ + String serviceIdC=element.attributeValue("id"); + if(!StringUtil.isEmpty(serviceIdC) + && String.valueOf(serviceId).equals(serviceIdC)) { + Map map = new HashMap(); + for(int i=0;i> list = serviceTemplate.getServiceList(5); + List> list = serviceTemplate.getServiceListByServiceId(518); for(Map map :list){ System.out.println("业务配置:"+map.get("id")+","+map.get("functionId")+","+map.get("serviceType")+","+map.get("tableName")); List> cfgList = (List>) map.get("cfgList"); diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 97840a1bd..2b6984f04 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -2386,7 +2386,7 @@ public class BaseController { if(auditBatchCfg != null && !StringUtil.isEmpty(auditBatchCfg.getFunctionId())) { functionId=auditBatchCfg.getFunctionId(); } - List> serviceList = serviceTemplate.getServiceList(functionId); + List> serviceList = serviceTemplate.getServiceListByFunctionId(functionId); for(Map service:serviceList){ String tableNameXml = service.get("tableName").toString(); diff --git a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml index 8325e5c9c..05ff5b85d 100644 --- a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml @@ -991,8 +991,18 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 + ORDER BY a.CFG_ID @@ -1016,7 +1026,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1148,7 +1166,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1172,7 +1198,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 and (cert_id is null or cert_id == 0) @@ -1208,7 +1242,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1232,7 +1274,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1253,7 +1303,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1278,7 +1336,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1304,7 +1370,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1331,7 +1405,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1355,7 +1437,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1394,7 +1484,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1425,7 +1523,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID @@ -1454,7 +1560,15 @@ AND a.action=#{action,jdbcType=INTEGER} - and a.is_valid=#{isValid} and a.is_audit=#{isAudit} + + AND a.is_valid=#{isValid,jdbcType=INTEGER} + + + AND a.is_audit=#{isAudit,jdbcType=INTEGER} + + + AND a.compile_id=#{compileId,jdbcType=INTEGER} + and a.is_valid!=-1 ORDER BY a.CFG_ID From 721e4e2c6fbd20bc41f63a17ceb4298ba07eb5a8 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Wed, 2 Jan 2019 12:01:53 +0600 Subject: [PATCH 140/147] =?UTF-8?q?=E4=BF=AE=E6=94=B9http=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=92=8Chttp=E5=85=B3=E9=94=AE=E5=AD=97=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=9A=84=E8=8F=9C=E5=8D=95=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/20181230/update_sys_menu.sql | 3 +++ src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp | 2 +- src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/sql/20181230/update_sys_menu.sql diff --git a/src/main/resources/sql/20181230/update_sys_menu.sql b/src/main/resources/sql/20181230/update_sys_menu.sql new file mode 100644 index 000000000..64576747b --- /dev/null +++ b/src/main/resources/sql/20181230/update_sys_menu.sql @@ -0,0 +1,3 @@ +-- 修改菜单国际化编码 +UPDATE `sys_menu` SET `id`='1151', `parent_id`='706', `parent_ids`='0,1,152,1131,706,', `code`='keyword_log_to_url', `name`='网页关键字', `sort`='30', `href`='/log/ntc/httpkey/list', `target`='', `icon`='', `is_show`='1', `permission`='', `create_by`='1', `create_date`='2018-10-25 18:22:36', `update_by`='1', `update_date`='2018-12-30 12:34:10', `remarks`='', `del_flag`='1', `menu_bg`=NULL, `quick_action`='0', `is_top`='0', `function_id`='635' WHERE (`id`='1151'); +UPDATE `sys_menu` SET `id`='1152', `parent_id`='706', `parent_ids`='0,1,152,1131,706,', `code`='http_log', `name`='HTTP', `sort`='20', `href`='/log/ntc/http/list', `target`='', `icon`='', `is_show`='1', `permission`='', `create_by`='1', `create_date`='2018-10-25 18:24:43', `update_by`='1', `update_date`='2018-12-30 12:34:31', `remarks`='', `del_flag`='1', `menu_bg`=NULL, `quick_action`='0', `is_top`='0', `function_id`='8' WHERE (`id`='1152'); diff --git a/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp index 398ea102f..3348eaa34 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp @@ -98,7 +98,7 @@

    - +

    diff --git a/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp index 6a37e0f8c..7bd74b432 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp @@ -75,7 +75,7 @@

    - +

    From d81673187d9053d1e6f717b6288bbf67f0e8ae94 Mon Sep 17 00:00:00 2001 From: tanghao Date: Wed, 2 Jan 2019 16:45:07 +0800 Subject: [PATCH 141/147] =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E5=AF=BC=E5=87=BApng?= =?UTF-8?q?=20pdf=E5=8A=9F=E8=83=BD=E5=BC=80=E6=94=BE=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../highcharts/js/offline-exporting.js | 330 +++++++++++++++++- .../webapp/static/pages/scripts/echart.js | 9 +- 2 files changed, 322 insertions(+), 17 deletions(-) diff --git a/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js b/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js index 38062c420..aee446312 100644 --- a/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js +++ b/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js @@ -1,19 +1,317 @@ /* - Highcharts JS v6.1.0 (2018-04-13) - Client side exporting module +Highcharts JS v6.1.0 (2018-04-13) +Client side exporting module - (c) 2015 Torstein Honsi / Oystein Moseng +(c) 2015 Torstein Honsi / Oystein Moseng - License: www.highcharts.com/license -*/ -(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(c){function n(a,f){var d=t.getElementsByTagName("head")[0],b=t.createElement("script");b.type="text/javascript";b.src=a;b.onload=f;b.onerror=function(){c.error("Error loading script "+a)};d.appendChild(b)}var C=c.merge,e=c.win,r=e.navigator,t=e.document,w=c.each,x=e.URL||e.webkitURL||e,B=/Edge\/|Trident\/|MSIE /.test(r.userAgent),D=/Edge\/\d+/.test(r.userAgent),E=B?150:0;c.CanVGRenderer={}; -c.dataURLtoBlob=function(a){if(e.atob&&e.ArrayBuffer&&e.Uint8Array&&e.Blob&&x.createObjectURL){a=a.match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/);for(var c=e.atob(a[3]),d=new e.ArrayBuffer(c.length),d=new e.Uint8Array(d),b=0;br.userAgent.indexOf("Chrome");try{if(!c&&0>r.userAgent.toLowerCase().indexOf("firefox"))return x.createObjectURL(new e.Blob([a],{type:"image/svg+xml;charset-utf-16"}))}catch(d){}return"data:image/svg+xml;charset\x3dUTF-8,"+ -encodeURIComponent(a)};c.imageToDataUrl=function(a,c,d,b,u,l,k,m,p){var g=new e.Image,h,f=function(){setTimeout(function(){var e=t.createElement("canvas"),f=e.getContext&&e.getContext("2d"),y;try{if(f){e.height=g.height*b;e.width=g.width*b;f.drawImage(g,0,0,e.width,e.height);try{y=e.toDataURL(c),u(y,c,d,b)}catch(F){h(a,c,d,b)}}else k(a,c,d,b)}finally{p&&p(a,c,d,b)}},E)},q=function(){m(a,c,d,b);p&&p(a,c,d,b)};h=function(){g=new e.Image;h=l;g.crossOrigin="Anonymous";g.onload=f;g.onerror=q;g.src=a}; -g.onload=f;g.onerror=q;g.src=a};c.downloadSVGLocal=function(a,f,d,b){function u(b,a){a=new e.jsPDF("l","pt",[b.width.baseVal.value+2*a,b.height.baseVal.value+2*a]);w(b.querySelectorAll('*[visibility\x3d"hidden"]'),function(b){b.parentNode.removeChild(b)});e.svg2pdf(b,a,{removeInvalid:!0});return a.output("datauristring")}function l(){z.innerHTML=a;var e=z.getElementsByTagName("text"),f;w(e,function(b){w(["font-family","font-size"],function(a){for(var c=b;c&&c!==z;){if(c.style[a]){b.style[a]=c.style[a]; -break}c=c.parentNode}});b.style["font-family"]=b.style["font-family"]&&b.style["font-family"].split(" ").splice(-1);f=b.getElementsByTagName("title");w(f,function(a){b.removeChild(a)})});e=u(z.firstChild,0);try{c.downloadURL(e,v),b&&b()}catch(G){d()}}var k,m,p=!0,g,h=f.libURL||c.getOptions().exporting.libURL,z=t.createElement("div"),q=f.type||"image/png",v=(f.filename||"chart")+"."+("image/svg+xml"===q?"svg":q.split("/")[1]),A=f.scale||1,h="/"!==h.slice(-1)?h+"/":h;if("image/svg+xml"===q)try{r.msSaveOrOpenBlob? -(m=new MSBlobBuilder,m.append(a),k=m.getBlob("image/svg+xml")):k=c.svgToDataUrl(a),c.downloadURL(k,v),b&&b()}catch(y){d()}else"application/pdf"===q?e.jsPDF&&e.svg2pdf?l():(p=!0,n(h+"jspdf.js",function(){n(h+"svg2pdf.js",function(){l()})})):(k=c.svgToDataUrl(a),g=function(){try{x.revokeObjectURL(k)}catch(y){}},c.imageToDataUrl(k,q,{},A,function(a){try{c.downloadURL(a,v),b&&b()}catch(F){d()}},function(){var f=t.createElement("canvas"),u=f.getContext("2d"),l=a.match(/^]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1]* -A,k=a.match(/^]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*A,m=function(){u.drawSvg(a,0,0,l,k);try{c.downloadURL(r.msSaveOrOpenBlob?f.msToBlob():f.toDataURL(q),v),b&&b()}catch(H){d()}finally{g()}};f.width=l;f.height=k;e.canvg?m():(p=!0,n(h+"rgbcolor.js",function(){n(h+"canvg.js",function(){m()})}))},d,d,function(){p&&g()}))};c.Chart.prototype.getSVGForLocalExport=function(a,e,d,b){var f=this,l,k=0,m,p,g,h,n,q=function(a,c,d){++k;d.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href", -a);k===l.length&&b(f.sanitizeSVG(m.innerHTML,p))};c.wrap(c.Chart.prototype,"getChartHTML",function(b){var a=b.apply(this,Array.prototype.slice.call(arguments,1));p=this.options;m=this.container.cloneNode(!0);return a});f.getSVGForExport(a,e);l=m.getElementsByTagName("image");try{if(l.length)for(h=0,n=l.length;h r.userAgent.indexOf("Chrome"); + try { + if (!c && 0 > r.userAgent.toLowerCase().indexOf("firefox")) + return x.createObjectURL(new e.Blob([a], { + type: "image/svg+xml;charset-utf-16" + })) + } catch (d) {} + return "data:image/svg+xml;charset\x3dUTF-8," + + encodeURIComponent(a) + }; + c.imageToDataUrl = function (a, c, d, b, u, l, k, m, p) { + var g = new e.Image, + h, + f = function () { + setTimeout(function () { + var e = t.createElement("canvas"), + f = e.getContext && e.getContext("2d"), + y; + try { + if (f) { + e.height = g.height * b; + e.width = g.width * b; + f.drawImage(g, 0, 0, e.width, e.height); + try { + y = e.toDataURL(c), + u(y, c, d, b) + } catch (F) { + h(a, c, d, b) + } + } else + k(a, c, d, b) + } + finally { + p && p(a, c, d, b) + } + }, E) + }, + q = function () { + m(a, c, d, b); + p && p(a, c, d, b) + }; + h = function () { + g = new e.Image; + h = l; + g.crossOrigin = "Anonymous"; + g.onload = f; + g.onerror = q; + g.src = a + }; + g.onload = f; + g.onerror = q; + g.src = a + }; + c.downloadSVGLocal = function (a, f, d, b) { + function u(b, a) { + a = new e.jsPDF("l", "pt", [b.width.baseVal.value + 2 * a, b.height.baseVal.value + 2 * a]); + w(b.querySelectorAll('*[visibility\x3d"hidden"]'), function (b) { + b.parentNode.removeChild(b) + }); + e.svg2pdf(b, a, { + removeInvalid: !0 + }); + return a.output("datauristring") + } + function l() { + z.innerHTML = a; + var e = z.getElementsByTagName("text"), + f; + w(e, function (b) { + w(["font-family", "font-size"], function (a) { + for (var c = b; c && c !== z; ) { + if (c.style[a]) { + b.style[a] = c.style[a]; + break + } + c = c.parentNode + } + }); + b.style["font-family"] = b.style["font-family"] && b.style["font-family"].split(" ").splice(-1); + f = b.getElementsByTagName("title"); + w(f, function (a) { + b.removeChild(a) + }) + }); + e = u(z.firstChild, 0); + try { + c.downloadURL(e, v), + b && b() + } catch (G) { + d() + } + } + var k, + m, + p = !0, + g, + h = f.libURL || c.getOptions().exporting.libURL, + z = t.createElement("div"), + q = f.type || "image/png", + v = (f.filename || "chart") + "." + ("image/svg+xml" === q ? "svg" : q.split("/")[1]), + A = f.scale || 1, + h = "/" !== h.slice(-1) ? h + "/" : h; + if ("image/svg+xml" === q) + try { + r.msSaveOrOpenBlob ? + (m = new MSBlobBuilder, m.append(a), k = m.getBlob("image/svg+xml")) : k = c.svgToDataUrl(a), + c.downloadURL(k, v), + b && b() + } catch (y) { + d() + } + else + "application/pdf" === q ? e.jsPDF && e.svg2pdf ? l() : (p = !0, n(h + "jspdf.js", function () { + n(h + "svg2pdf.js", function () { + l() + }) + })) : (k = c.svgToDataUrl(a), g = function () { + try { + x.revokeObjectURL(k) + } catch (y) {} + }, c.imageToDataUrl(k, q, {}, A, function (a) { + try { + c.downloadURL(a, v), + b && b() + } catch (F) { + d() + } + }, function () { + var f = t.createElement("canvas"), + u = f.getContext("2d"), + l = a.match(/^]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * + A, + k = a.match(/^]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * A, + m = function () { + u.drawSvg(a, 0, 0, l, k); + try { + c.downloadURL(r.msSaveOrOpenBlob ? f.msToBlob() : f.toDataURL(q), v), + b && b() + } catch (H) { + d() + } + finally { + g() + } + }; + f.width = l; + f.height = k; + e.canvg ? m() : (p = !0, n(h + "rgbcolor.js", function () { + n(h + "canvg.js", function () { + m() + }) + })) + }, d, d, function () { + p && g() + })) + }; + c.Chart.prototype.getSVGForLocalExport = function (a, e, d, b) { + var f = this, + l, + k = 0, + m, + p, + g, + h, + n, + q = function (a, c, d) { + ++k; + d.imageElement.setAttributeNS("http://www.w3.org/1999/xlink", "href", + a); + k === l.length && b(f.sanitizeSVG(m.innerHTML, p)) + }; + c.wrap(c.Chart.prototype, "getChartHTML", function (b) { + var a = b.apply(this, Array.prototype.slice.call(arguments, 1)); + p = this.options; + m = this.container.cloneNode(!0); + return a + }); + f.getSVGForExport(a, e); + l = m.getElementsByTagName("image"); + try { + if (l.length) + for (h = 0, n = l.length; h < n; ++h) + g = l[h], c.imageToDataUrl(g.getAttributeNS("http://www.w3.org/1999/xlink", "href"), "image/png", { + imageElement: g + }, a.scale, q, d, d, d); + else + b(f.sanitizeSVG(m.innerHTML, p)) + } catch (v) { + d() + } + }; + c.Chart.prototype.exportChartLocal = + function (a, e) { + var d = this, + b = c.merge(d.options.exporting, a), + f = function () { + if (!1 === b.fallbackToExportServer) + if (b.error) + b.error(b); + else + throw "Fallback to export server disabled"; + else + d.exportChart(b) + }; + B && ("application/pdf" === b.type || d.container.getElementsByTagName("image").length && "image/svg+xml" !== b.type) || "application/pdf" === b.type && d.container.getElementsByTagName("image").length ? f() : d.getSVGForLocalExport(b, e, f, function (a) { + -1 < a.indexOf("\x3cforeignObject") && "image/svg+xml" !== b.type ? f() : c.downloadSVGLocal(a, + b, f) + }) + }; + C(!0, c.getOptions().exporting, { + libURL: "https://code.highcharts.com/6.1.0/lib/", + menuItemDefinitions: { + downloadPNG: { + textKey: "downloadPNG", + onclick: function () { + console.log(this) + this.legend.itemStyle.color='#000000' + this.exportChartLocal() + this.legend.itemStyle.color='#ffffff' + console.log('ok') + console.log(this) + } + }, + downloadJPEG: { + textKey: "downloadJPEG", + onclick: function () { + this.exportChartLocal({ + type: "image/jpeg" + }) + } + }, + downloadSVG: { + textKey: "downloadSVG", + onclick: function () { + this.exportChartLocal({ + type: "image/svg+xml" + }) + } + }, + downloadPDF: { + textKey: "downloadPDF", + onclick: function () { + this.legend.itemStyle.color='#000000' + this.exportChartLocal({ + type: "application/pdf" + }) + this.legend.itemStyle.color='#ffffff' + } + } + } + }) + })(n) +}); diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 979477f92..a35a06139 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -1365,7 +1365,14 @@ function exportingButton(color) { fill: color } } - } + }, + menuItems: [ + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs + ] } }; return button; From c34f3bf3ee52de5b99ca59bd2328a158655b7cbe Mon Sep 17 00:00:00 2001 From: chenjinsong Date: Wed, 2 Jan 2019 17:05:48 +0800 Subject: [PATCH 142/147] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E6=95=B0=E6=8D=AE=E5=85=89=E6=9D=9F=E6=95=88=E6=9E=9C?= =?UTF-8?q?=EF=BC=9B=E6=9B=B4=E6=94=B9=E7=99=BB=E5=BD=95=E9=A1=B5=E5=AD=97?= =?UTF-8?q?=E4=BD=93=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/login.jsp | 669 ++++++++++++------------ 1 file changed, 340 insertions(+), 329 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/login.jsp b/src/main/webapp/WEB-INF/views/login.jsp index 3f3c57132..60312e902 100644 --- a/src/main/webapp/WEB-INF/views/login.jsp +++ b/src/main/webapp/WEB-INF/views/login.jsp @@ -44,8 +44,6 @@ padding: 0px; } body{ - max-height:864px; - max-width:1518px; background-color:rgba(255,255,255,0); background-image: url("${pageContext.request.contextPath}/static/login/assets/images/login/backimg.png"); @@ -69,15 +67,19 @@ } .main_left{ - background-image: url("${pageContext.request.contextPath}/static/login/assets/images/login/two/login_03.png"); - background-repeat:no-repeat; - background-size:contain; max-height: 695px; max-width: 905px; - } + #left_img{ + position: absolute; + z-index: -1; + display: inline-block; + height: auto; + max-width: 100%; + } + .main_right{ - background-image: url("${pageContext.request.contextPath}/static/login/assets/images/login/login_06-K.png"); + background-image: url("${pageContext.request.contextPath}/static/login/assets/images/login/login_06.png"); background-repeat:no-repeat; background-size: 100% 100%; max-height: 501px; @@ -93,6 +95,7 @@ width: 300px; height: 260px; } + .foot{ position: absolute; bottom: 0px; @@ -107,6 +110,7 @@
    +
    @@ -123,19 +127,19 @@
    -
    +
    @@ -211,336 +215,343 @@ if("ontouchend" in document) document.write(" From ce5c0782bda74ab5d4e506e7576b0c72b9a66337 Mon Sep 17 00:00:00 2001 From: tanghao Date: Wed, 2 Jan 2019 19:02:24 +0800 Subject: [PATCH 143/147] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=83=8C=E6=99=AF=E8=89=B2=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=96=87=E5=AD=97=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/static/pages/scripts/echart.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index a35a06139..9cd32e2f4 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -4,10 +4,12 @@ chart: { events: { beforePrint: function () { - $(".highcharts-background").attr("fill","rgba(48,48,48,1)") + $('.highcharts-legend text').css('color','#000000'); + $('.highcharts-legend text').css('fill','#000000'); }, afterPrint: function () { - $(".highcharts-background").attr("fill","rgba(255, 255, 255, 0)") + $('.highcharts-legend text').css('color','#ffffff'); + $('.highcharts-legend text').css('fill','#ffffff'); } } } From e6426052cdd29c62d584667372b1028b468c768f Mon Sep 17 00:00:00 2001 From: zhangwei Date: Wed, 2 Jan 2019 17:17:15 +0600 Subject: [PATCH 144/147] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=98=E7=BA=BF=E5=9B=BE=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=8C=BA=E8=AE=BE=E7=BD=AE=EF=BC=9B=202.=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8E=A5=E5=8F=A3=E7=9A=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E5=B0=86=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=9C=A8=E6=8E=A5=E5=8F=A3=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=B8=AD=EF=BC=8C=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3URL=E5=8F=82=E6=95=B0=E4=B8=AD=EF=BC=9B=203.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E5=90=AF=E5=81=9C=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=B0=83=E5=BA=A6=E9=80=BB=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/maat/ToUpdateMaatBeanStatus.java | 122 ++++++ .../java/com/nis/util/ConfigServiceUtil.java | 36 ++ src/main/java/com/nis/util/Constants.java | 3 + .../java/com/nis/util/SchedulerTaskUtil.java | 390 ++++++++++++------ .../TrafficStatisticsReportController.java | 4 +- .../ConfigSynchronizationDao.java | 2 + .../ConfigSynchronizationDao.xml | 20 + src/main/resources/nis.properties | 184 +++++---- .../views/dashboard/trafficBandwidthList.jsp | 3 +- 9 files changed, 553 insertions(+), 211 deletions(-) create mode 100644 src/main/java/com/nis/domain/maat/ToUpdateMaatBeanStatus.java diff --git a/src/main/java/com/nis/domain/maat/ToUpdateMaatBeanStatus.java b/src/main/java/com/nis/domain/maat/ToUpdateMaatBeanStatus.java new file mode 100644 index 000000000..869d7e249 --- /dev/null +++ b/src/main/java/com/nis/domain/maat/ToUpdateMaatBeanStatus.java @@ -0,0 +1,122 @@ +/** + *@Title: ToMaatBean.java + *@Package com.nis.domain.configuration + *@Description TODO + *@author dell + *@date 2018年2月28日 下午2:03:08 + *@version 版本号 + */ +package com.nis.domain.maat; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * 修改maat类配置状态 + * @ClassName: ToUpdateStatusMaatBean.java + * @Description: TODO + * @author (dell) + * @date 2019年1月2日 下午3:08:08 + * @version V1.0 + */ +public class ToUpdateMaatBeanStatus implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = -3468862666445104490L; + /** + * @Fields serialVersionUID:TODO(转换为maat格式的java bean) + * + * @since 1.0.0 + */ + @Expose + private String version; + @Expose + @SerializedName("operator") + private String creatorName; + @Expose + @SerializedName("opTime") + private Date auditTime; + @Expose + private Integer opAction; + @Expose + private List configCompileStartStopList; + + public static class UpdateMaatCfgStatus{ + @Expose + private Integer compileId; + @Expose + private Integer isValid; + @Expose + @SerializedName("opTime") + private Date auditTime; + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + public Integer getIsValid() { + return isValid; + } + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + public Date getAuditTime() { + return auditTime; + } + public void setAuditTime(Date auditTime) { + this.auditTime = auditTime; + } + + } + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public Date getAuditTime() { + return auditTime; + } + + public void setAuditTime(Date auditTime) { + this.auditTime = auditTime; + } + + public List getConfigCompileStartStopList() { + return configCompileStartStopList; + } + + public void setConfigCompileStartStopList(List configCompileStartStopList) { + this.configCompileStartStopList = configCompileStartStopList; + } + + public Integer getOpAction() { + return opAction; + } + + public void setOpAction(Integer opAction) { + this.opAction = opAction; + } + + public static void main(String[] args) { + + } +} diff --git a/src/main/java/com/nis/util/ConfigServiceUtil.java b/src/main/java/com/nis/util/ConfigServiceUtil.java index c29b8b35f..8779f74ff 100644 --- a/src/main/java/com/nis/util/ConfigServiceUtil.java +++ b/src/main/java/com/nis/util/ConfigServiceUtil.java @@ -814,6 +814,42 @@ public class ConfigServiceUtil { return bean; } + /** + * maat配置停启用 + * @param params + * @return + */ + public static String configStatusUpdate(String params) throws MaatConvertException{ + String result = null; + ToMaatResult bean = null; + Response response=null; + try { + String url = Constants.SERVICE_URL+Constants.CONFIG_START_STOP_UPDATE; + //创建连接 + WebTarget wt = ClientUtil.getWebTarger(url); + logger.info("put url:"+url); + //获取响应结果 + Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON); + try { + response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON)); + if(response != null) { + result=response.readEntity(String.class); + } + } catch (Exception e) { + throw new MaatConvertException(""); + } + if(response !=null && response.getStatus() == 200){ + JSONObject resObject = JSONObject.fromObject(result); + bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class); + }else{ + throw new MaatConvertException(":"+result); + } + } catch (Exception e) { + throw e; + } + + return result; + } public static void main(String[] args) { try { // getId(1,1); diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index a473f80ba..c8a5836d5 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -799,4 +799,7 @@ public final class Constants { public static final String NTC_EVENT_MONITOR_OR_BLOCK_Report =Configurations.getStringProperty("ntcEventsMonitorOrBlock",""); public static final String NTC_EVENT_KEYPROTECTION_Report =Configurations.getStringProperty("ntcEventKeyProtection",""); + + //配置启停服务接口方法 + public static final String CONFIG_START_STOP_UPDATE=Configurations.getStringProperty("configStartStop", "configStartStop"); } diff --git a/src/main/java/com/nis/util/SchedulerTaskUtil.java b/src/main/java/com/nis/util/SchedulerTaskUtil.java index e79e9432c..52baa0ca0 100644 --- a/src/main/java/com/nis/util/SchedulerTaskUtil.java +++ b/src/main/java/com/nis/util/SchedulerTaskUtil.java @@ -1,20 +1,36 @@ package com.nis.util; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.google.common.collect.Lists; +import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AvFileSampleCfg; import com.nis.domain.configuration.AvSignSampleCfg; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.DnsIpCfg; import com.nis.domain.configuration.DnsResStrategy; +import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.PxyObjKeyring; import com.nis.domain.configuration.PxyObjTrustedCaCert; import com.nis.domain.configuration.PxyObjTrustedCaCrl; +import com.nis.domain.maat.MaatCfg; +import com.nis.domain.maat.ToMaatBean; +import com.nis.domain.maat.ToMaatResult; +import com.nis.domain.maat.ToUpdateMaatBeanStatus; +import com.nis.domain.maat.MaatCfg.DigestCfg; +import com.nis.domain.maat.MaatCfg.GroupCfg; +import com.nis.domain.maat.MaatCfg.IpCfg; +import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; +import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.domain.maat.ToUpdateMaatBeanStatus.UpdateMaatCfgStatus; import com.nis.web.dao.configuration.ConfigSynchronizationDao; import com.nis.web.service.BaseService; import com.nis.web.service.SpringContextHolder; @@ -29,6 +45,7 @@ public class SchedulerTaskUtil { //调度任务的配置信息,复用配置同步DAO private static ConfigSynchronizationDao configSynchronizationDao = SpringContextHolder.getBean(ConfigSynchronizationDao.class); + private Logger logger = LoggerFactory.getLogger(getClass()); /** * 根据业务与编译ID查询配置,修改失效或生效状态,并下发至综合服务 @@ -49,141 +66,280 @@ public class SchedulerTaskUtil { String className = service.get("className").toString(); BaseCfg entity = new BaseCfg(); entity.setServiceId(serviceId); - entity.setCompileId(compileId); entity.setTableName(tableName); List list = Lists.newArrayList(); + List callBackCfgList = Lists.newArrayList(); + boolean isUpdateContent = false; + /** + * 根据编译ID查询配置,如果配置当前审核状态为未审核(is_audit=0),并且newIsValid=1需要查询详细的域配置信息,下发配置详细内容, + * 如果已审核(is_audit=1),则只查询配置主表,更新配置状态即可, + * 如果审核取消(is_audit=3)则删除定时任务,表示配置已最终删除,此状态处理原则上在配置修改拦截器中处理 + */ if("1".equals(serviceType)){//maat类配置 - //查询配置 - if("cfg_index_info".equals(tableName)){ - list = configSynchronizationDao.getCfgIndexList(entity); - - }else if("file_digest_cfg".equals(tableName)){ - list = configSynchronizationDao.getFileDigestListByService(entity); - - }else if("app_policy_cfg".equals(tableName)){ - list = configSynchronizationDao.getAppPolicyList(entity); - - }else if("app_feature_index".equals(tableName)){ - list = configSynchronizationDao.getAppFeatureIndexList(entity); - - } - if(newIsValid.equals(1)){//生效 - //调用综合服务配置生效启用接口 - - }else if(newIsValid.equals(0)){//失效 - //调用综合服务配置失效停用接口 - - } - }else if("2".equals(serviceType)){//回调类配置 - List newList = Lists.newArrayList(); - List ids = Lists.newArrayList(); - //查询配置 - if(entity.getServiceId().equals(3)){//ip drop回调类配置用了主表和子表关系 - list = configSynchronizationDao.getCfgIndexList(entity); - if(!StringUtil.isEmpty(list)){ - List compileIds = Lists.newArrayList(); + Date updateTime = new Date(); + //下发并修改配置状态的参数类 + ToUpdateMaatBeanStatus maatStatusBean = new ToUpdateMaatBeanStatus(); + UpdateMaatCfgStatus updateCfg = new UpdateMaatCfgStatus(); + List configCompileStartStopList = new ArrayList(); + maatStatusBean.setVersion(Constants.MAAT_VERSION); + maatStatusBean.setOpAction(Constants.INSERT_ACTION); + maatStatusBean.setAuditTime(updateTime); + maatStatusBean.setCreatorName("TaskScheduler");//任务调度定时修改状态 + + //下发带有配置内容的参数对象 + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + +// for(Integer compileId:compileIds){ + entity.setCompileId(compileId); + //查询配置 + if("cfg_index_info".equals(tableName)){ + list = configSynchronizationDao.getCfgIndexList(entity); + List> cfgList = (List>) service.get("cfgList"); for(int i=0;i m:cfgList){ + String regionTableName = m.get("tableName").toString(); + config.setTableName(regionTableName); + configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态 + } + } + } } - List subList = configSynchronizationDao.getIpDropList("ip_port_cfg", compileIds); - for(int i=0;i> cfgList = (List>) service.get("cfgList"); for(int i=0;i m:cfgList){ + String regionTableName = m.get("tableName").toString(); + config.setTableName(regionTableName); + configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态 + } + } + } } - - }else if(className.equals("AvSignSampleCfg")){//音视频场景配置 - list = configSynchronizationDao.getAvSignCfgList(entity); + + }else if("app_policy_cfg".equals(tableName)){ + list = configSynchronizationDao.getAppPolicyList(entity); + List> cfgList = (List>) service.get("cfgList"); for(int i=0;i(); - list=configSynchronizationDao.getPxyObjTrustedCrlCfgListByCertId(ids); - for(int i=0;i m:cfgList){ + String regionTableName = m.get("tableName").toString(); + config.setTableName(regionTableName); + configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态 + } + } + } } - }else if(className.equals("PxyObjTrustedCaCrl")){ - ids=new ArrayList<>(); - //只允许单独下发certId为空或0的crl配置 - list = configSynchronizationDao.getPxyObjTrustedCrlCfgList(entity); - for(int i=0;i compileIdArray = Lists.newArrayList(); + for(int i=0;i getComplexStrListByService(BaseCfg entity); public List getAppIpPortList(@Param("tableName")String tableName,@Param("compileIds")List compileIds); public List getAppIpFeatureList(BaseCfg entity); + + public void updateCfgStatus(BaseCfg entity); } diff --git a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml index 05ff5b85d..9b76df62b 100644 --- a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml @@ -1582,6 +1582,26 @@ AND a.CFG_ID!=#{cfgId,jdbcType=BIGINT} + + + + + update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, + edit_time = #{editTime,jdbcType=TIMESTAMP} + + ,is_audit = #{isAudit,jdbcType=INTEGER} + ,audit_time=#{auditTime,jdbcType=TIMESTAMP} + + + + AND cfg_id = #{cfgId,jdbcType=BIGINT} + + + AND compile_id = #{compileId,jdbcType=INTEGER} + + and function_id=#{functionId,jdbcType=INTEGER} + + + + insert into app_complex_feature_cfg ( + APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, + SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, + ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, + DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5, + ver,ihl,tos,total_length,flags,fragment_offset,protocol,icmp_type,icmp_code,icmp_identifier,header_type + )values ( + , + #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER}, + #{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR}, + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}, + #{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}, + #{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}, + #{ver,jdbcType=VARCHAR},#{ihl,jdbcType=VARCHAR},#{tos,jdbcType=VARCHAR},#{totalLength,jdbcType=VARCHAR}, + #{flags,jdbcType=VARCHAR},#{fragmentOffset,jdbcType=VARCHAR},#{protocol,jdbcType=VARCHAR},#{icmpType,jdbcType=VARCHAR}, + #{icmpCode,jdbcType=VARCHAR},#{icmpIdentifier,jdbcType=VARCHAR},#{headerType,jdbcType=VARCHAR} + ) + + diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index 77fe7a122..f4902b221 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -1613,6 +1613,8 @@ public abstract class BaseService { type="DnsResStrategy"; }else if(list.get(0) instanceof AsnIpCfg) { type="AsnIpCfg"; + }else if(list.get(0) instanceof AppComplexFeatureCfg) { + type="AppComplexFeature"; } if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) { this.saveCfgIndexOf(cfgIndexInfos); @@ -1634,6 +1636,9 @@ public abstract class BaseService { }else if("AsnIpCfg".equals(type)) { List listPage = (List) list; this.saveAsnIpBatch(listPage); + }else if("AppComplexFeature".equals(type)) { + List listPage = (List) list; + this.saveAppComplexFeatureBatch(listPage); }else if("BaseStringCfg".equals(type)) { List> listPage = (List>) list; // 调用对应配置的service @@ -1815,6 +1820,30 @@ public abstract class BaseService { } } + + /** + * APP Payload导入配置时数据批量入库 + * @param data + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveAppComplexFeatureBatch(List data) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + AppComplexFeatureCfg cfg = data.get(index); + ((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppComplexFeatureCfgBatch(cfg); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + + } + /** * 同一个app下的ip批量保存 * @param cfgs diff --git a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java index 5b105e535..a251d9143 100644 --- a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java @@ -5,6 +5,8 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; +import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; @@ -20,6 +22,7 @@ import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppStringFeatureCfg; import com.nis.domain.configuration.AppTcpCfg; import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; @@ -111,43 +114,9 @@ public class AppMultiFeatureCfgService extends BaseService { cfg.setIsCaseInsenstive(0); cfg.setExprType(3); cfg.setMatchMethod(0); - String keyword = ""; - if(cfg.getHeaderType().equals("IP_header")){ - if(StringUtils.isNoneBlank(cfg.getVer())){ - keyword += "0-3:"+cfg.getVer()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIhl())){ - keyword += "4-7:"+cfg.getIhl()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getTos())){ - keyword += "8-15:"+cfg.getTos()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getTotalLength())){ - keyword += "16-31:"+cfg.getTotalLength()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getFlags())){ - keyword += "48-50:"+cfg.getFlags()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getFragmentOffset())){ - keyword += "56-63:"+cfg.getFragmentOffset()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getProtocol())){ - keyword += "72-79:"+cfg.getProtocol()+Constants.KEYWORD_EXPR; - } - }else{ - if(StringUtils.isNoneBlank(cfg.getIcmpType())){ - keyword += "0-7:"+cfg.getIcmpType()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIcmpCode())){ - keyword += "8-15:"+cfg.getIcmpCode()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIcmpIdentifier())){ - keyword += "32-47:"+cfg.getIcmpIdentifier()+Constants.KEYWORD_EXPR; - } - } - keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR)); - cfg.setCfgKeywords(keyword); + this.setL3HeaderKeyword(cfg); appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg); + }else if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); cfg.setHeaderType(null); @@ -205,43 +174,9 @@ public class AppMultiFeatureCfgService extends BaseService { cfg.setIsCaseInsenstive(0); cfg.setExprType(3); cfg.setMatchMethod(0); - String keyword = ""; - if(cfg.getHeaderType().equals("IP_header")){ - if(StringUtils.isNoneBlank(cfg.getVer())){ - keyword += "0-3:"+cfg.getVer()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIhl())){ - keyword += "4-7:"+cfg.getIhl()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getTos())){ - keyword += "8-15:"+cfg.getTos()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getTotalLength())){ - keyword += "16-31:"+cfg.getTotalLength()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getFlags())){ - keyword += "48-50:"+cfg.getFlags()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getFragmentOffset())){ - keyword += "56-63:"+cfg.getFragmentOffset()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getProtocol())){ - keyword += "72-79:"+cfg.getProtocol()+Constants.KEYWORD_EXPR; - } - }else{ - if(StringUtils.isNoneBlank(cfg.getIcmpType())){ - keyword += "0-7:"+cfg.getIcmpType()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIcmpCode())){ - keyword += "8-15:"+cfg.getIcmpCode()+Constants.KEYWORD_EXPR; - } - if(StringUtils.isNotBlank(cfg.getIcmpIdentifier())){ - keyword += "32-47:"+cfg.getIcmpIdentifier()+Constants.KEYWORD_EXPR; - } - } - keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR)); - cfg.setCfgKeywords(keyword); + this.setL3HeaderKeyword(cfg); appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg); + }else if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); cfg.setHeaderType(null); @@ -259,6 +194,46 @@ public class AppMultiFeatureCfgService extends BaseService { } } } + + public void setL3HeaderKeyword(AppComplexFeatureCfg cfg) { + String keyword = ""; + if(cfg.getHeaderType().equals("IP_header")){ + if(StringUtils.isNoneBlank(cfg.getVer())){ + keyword += "0-3:"+cfg.getVer()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getIhl())){ + keyword += "4-7:"+cfg.getIhl()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getTos())){ + keyword += "8-15:"+cfg.getTos()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getTotalLength())){ + keyword += "16-31:"+cfg.getTotalLength()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getFlags())){ + keyword += "48-50:"+cfg.getFlags()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getFragmentOffset())){ + keyword += "56-63:"+cfg.getFragmentOffset()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getProtocol())){ + keyword += "72-79:"+cfg.getProtocol()+Constants.KEYWORD_EXPR; + } + }else{ + if(StringUtils.isNoneBlank(cfg.getIcmpType())){ + keyword += "0-7:"+cfg.getIcmpType()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getIcmpCode())){ + keyword += "8-15:"+cfg.getIcmpCode()+Constants.KEYWORD_EXPR; + } + if(StringUtils.isNotBlank(cfg.getIcmpIdentifier())){ + keyword += "32-47:"+cfg.getIcmpIdentifier()+Constants.KEYWORD_EXPR; + } + } + keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR)); + cfg.setCfgKeywords(keyword); + } + public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit) { ToMaatBean maatBean = new ToMaatBean(); MaatCfg maatCfg = new MaatCfg(); @@ -460,4 +435,219 @@ public class AppMultiFeatureCfgService extends BaseService { return dataMap; } + /** + * APP Payload L3_HEADER导入操作特殊属性限制 + * @param baseStringCfg + * @param errInfo + * @param prop + */ + public void checkImportAppPayload(AppComplexFeatureCfg baseStringCfg, StringBuffer errInfo, Properties prop) { + String headerType = baseStringCfg.getHeaderType(); + String ver = baseStringCfg.getVer(); + String ihl = baseStringCfg.getIhl(); + String tos = baseStringCfg.getTos(); + String totalLength = baseStringCfg.getTotalLength(); + String flags = baseStringCfg.getFlags(); + String fragmentOffset = baseStringCfg.getFragmentOffset(); + String protocol = baseStringCfg.getProtocol(); + String icmpType = baseStringCfg.getIcmpType(); + String icmpCode = baseStringCfg.getIcmpCode(); + String icmpIdentifier = baseStringCfg.getIcmpIdentifier(); + + boolean errorFlag = false; + Pattern pattern = Pattern.compile("^([0-9|a-f|A-F]*)$");//.matcher(keyword).matches(); + StringBuffer errInfoCopy = new StringBuffer(); + errInfoCopy.append(errInfo); + + if("IP_header".equals(headerType)) { + boolean ipHeaderFlag = false; + List ipHeaderList = new ArrayList<>(); + if(StringUtils.isNotBlank(baseStringCfg.getVer())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getIhl())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getTos())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getTotalLength())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getFlags())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getFragmentOffset())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(StringUtils.isNotBlank(baseStringCfg.getProtocol())) { ipHeaderList.add(baseStringCfg.getVer()); } + if(ipHeaderList.size() > 4) {// IP_header最多填写四个属性值 + errInfo.append("IP_header " + prop.getProperty("l3_header_error")+";"); + }else { + ipHeaderFlag = true; + } + + int count = 0; + if(StringUtils.isBlank(ver) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "VER ") + ";"); + }else if(ver.trim().length() != 4 && ipHeaderFlag){ + errInfo.append( + "VER "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(ver).matches() && ipHeaderFlag) { + errInfo.append( + "VER "+ " '" + ver + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(ihl) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "IHL ") + ";"); + }else if(ihl.trim().length() != 4 && ipHeaderFlag){ + errInfo.append( + "IHL "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(ihl).matches() && ipHeaderFlag) { + errInfo.append( + "IHL "+ " '" + ihl + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(tos) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "TOS ") + ";"); + }else if(tos.trim().length() != 8 && ipHeaderFlag){ + errInfo.append( + "TOS "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(tos).matches() && ipHeaderFlag) { + errInfo.append( + "TOS "+ " '" + tos + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(totalLength) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "Total Length ") + ";"); + }else if(totalLength.trim().length() != 16 && ipHeaderFlag){ + errInfo.append( + "Total Length "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(totalLength).matches() && ipHeaderFlag) { + errInfo.append( + "Total Length "+ " '" + totalLength + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(flags) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "Flags ") + ";"); + }else if(flags.trim().length() != 3 && ipHeaderFlag){ + errInfo.append( + "Flags "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(flags).matches() && ipHeaderFlag) { + errInfo.append( + "Flags "+ " '" + flags + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(fragmentOffset) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "fragment offset ") + ";"); + }else if(fragmentOffset.trim().length() != 8 && ipHeaderFlag){ + errInfo.append( + "fragment offset "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(fragmentOffset).matches() && ipHeaderFlag) { + errInfo.append( + "fragment offset "+ " '" + fragmentOffset + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(protocol) && ipHeaderFlag) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "Protocol ") + ";"); + }else if(protocol.trim().length() != 8 && ipHeaderFlag){ + errInfo.append( + "Protocol "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(protocol).matches() && ipHeaderFlag) { + errInfo.append( + "Protocol "+ " '" + protocol + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if((count >0 || count <5) && (!errorFlag)) { + errInfo.setLength(0);; + errInfo.append(errInfoCopy); + } + baseStringCfg.setIcmpType(null); + baseStringCfg.setIcmpCode(null); + baseStringCfg.setIcmpIdentifier(null); + }else { + int count = 0; + if(StringUtils.isBlank(icmpType)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "ICMP type ") + ";"); + }else if(icmpType.trim().length() != 8){ + errInfo.append( + "ICMP type "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(icmpType).matches()) { + errInfo.append( + "ICMP type "+ " '" + icmpType + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(icmpCode)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "ICMP code ") + ";"); + }else if(icmpCode.trim().length() != 8){ + errInfo.append( + "ICMP code "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(icmpCode).matches()) { + errInfo.append( + "ICMP code "+ " '" + icmpCode + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if(StringUtils.isBlank(icmpIdentifier)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), "ICMP identifier ") + ";"); + }else if(icmpIdentifier.trim().length() != 16){ + errInfo.append( + "ICMP identifier "+prop.getProperty("length_error") + ";"); + errorFlag = true; + }else if(!pattern.matcher(icmpIdentifier).matches()) { + errInfo.append( + "ICMP identifier "+ " '" + icmpIdentifier + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + errorFlag = true; + }else { + count++; + } + + if((count >0) && (!errorFlag)) { + errInfo.setLength(0);; + errInfo.append(errInfoCopy); + } + baseStringCfg.setVer(null); + baseStringCfg.setIhl(null); + baseStringCfg.setTos(null); + baseStringCfg.setTotalLength(null); + baseStringCfg.setFlags(null); + baseStringCfg.setFragmentOffset(null); + baseStringCfg.setProtocol(null); + } + + } + } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index e35ca8087..27aac9641 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1438,4 +1438,10 @@ print=Print traffic_connect_log=Traffic Log keyword_log_to_url=KeywordLogToURL http_log=HTTP Logs -cut_sample_tool=Cut Sample Tool \ No newline at end of file +cut_sample_tool=Cut Sample Tool +hex_minlength_3=Please enter a hexadecimal string of length 3 +hex_minlength_4=Please enter a hexadecimal string of length 4 +hex_minlength_8=Please enter a hexadecimal string of length 8 +hex_minlength_16=Please enter a hexadecimal string of length 16 +need_input=Attributes need to be filled in +max_input=Fill in at most four \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 8b97df174..0cb27f12d 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1442,4 +1442,10 @@ print=Print traffic_connect_log=\u0416\u0443\u0440\u043D\u0430\u043B \u0422\u0440\u0430\u0444\u0438\u043A\u0430 keyword_log_to_url=KeywordLogToURL http_log=HTTP Logs -cut_sample_tool=Cut Sample Tool \ No newline at end of file +cut_sample_tool=Cut Sample Tool +hex_minlength_3=Please enter a hexadecimal string of length 3 +hex_minlength_4=Please enter a hexadecimal string of length 4 +hex_minlength_8=Please enter a hexadecimal string of length 8 +hex_minlength_16=Please enter a hexadecimal string of length 16 +need_input=Attributes need to be filled in +max_input=Fill in at most four \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 07a1d0de1..710d6f28b 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1438,4 +1438,10 @@ print=\u6253\u5370 traffic_connect_log=\u6D41\u91CF\u65E5\u5FD7 keyword_log_to_url=\u5173\u952E\u5B57\u65E5\u5FD7\u8F6CURL http_log=HTTP \u65E5\u5FD7 -cut_sample_tool=\u6837\u4F8B\u526A\u5207\u5DE5\u5177 \ No newline at end of file +cut_sample_tool=\u6837\u4F8B\u526A\u5207\u5DE5\u5177 +hex_minlength_3=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A3\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32 +hex_minlength_4=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A4\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32 +hex_minlength_8=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A8\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32 +hex_minlength_16=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A16\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32 +need_input=\u9700\u8981\u586B\u5199\u5C5E\u6027 +max_input=\u6700\u591A\u586B\u5199\u56DB\u4E2A \ No newline at end of file diff --git a/src/main/resources/sql/20190102/update_function_dicts.sql b/src/main/resources/sql/20190102/update_function_dicts.sql new file mode 100644 index 000000000..2b3c60455 --- /dev/null +++ b/src/main/resources/sql/20190102/update_function_dicts.sql @@ -0,0 +1,6 @@ +-- APP Payload -- +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 563 AND dict_id = 211; +UPDATE function_region_dict SET is_import = 1 WHERE function_id = 563 AND dict_id = 212; +UPDATE function_service_dict SET is_import = 1 WHERE function_id = 563; + + diff --git a/src/main/webapp/WEB-INF/include/excel/importModal.jsp b/src/main/webapp/WEB-INF/include/excel/importModal.jsp index a72b2da63..2b5297212 100644 --- a/src/main/webapp/WEB-INF/include/excel/importModal.jsp +++ b/src/main/webapp/WEB-INF/include/excel/importModal.jsp @@ -94,11 +94,11 @@
    - - + +