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 a9e08f57d..1346a205a 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -47,6 +47,7 @@ import com.nis.util.DateUtil; import com.nis.util.DateUtils; import com.nis.util.DictUtils; import com.nis.util.StringUtil; +import com.nis.util.StringUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; import com.nis.web.dao.dashboard.codedic.CodeResult; @@ -469,7 +470,7 @@ public class TrafficStatisticsInfoController extends BaseController { } @RequestMapping("ajaxAppTrend") @ResponseBody - public Map ajaxAppTrend(String beginDate,String endDate,Integer appType,Integer entranceId,Model model){ + public Map ajaxAppTrend(String beginDate,String endDate,Integer appType,Integer entranceId,Integer[] searchIspCode,Model model){ Map fromJsonList = new HashMap(); Map list = new HashMap(); try { @@ -484,6 +485,10 @@ public class TrafficStatisticsInfoController extends BaseController { if(entranceId!=null){ url=url+"&searchEntranceId="+entranceId; } + if(searchIspCode!=null&&searchIspCode.length>0){ + String str=StringUtils.join(searchIspCode,","); + url=url+"&searchIspCode="+str; + } String string = HttpClientUtil.get(url); Gson gson = new GsonBuilder().create(); fromJsonList = gson.fromJson(string, new TypeToken>(){}.getType()); @@ -499,7 +504,7 @@ public class TrafficStatisticsInfoController extends BaseController { } @RequestMapping("ajaxAppTopList") @ResponseBody - public List ajaxAppTopList(String beginDate,String endDate,Integer appType,Integer entranceId,Integer searchQuota,Model model){ + public List ajaxAppTopList(String beginDate,String endDate,Integer appType,Integer entranceId,Integer searchQuota,Integer[] searchIspCode,Model model){ Map fromJsonList = new HashMap(); List list = new ArrayList(); try { @@ -519,6 +524,10 @@ public class TrafficStatisticsInfoController extends BaseController { }else{ url=url+"&searchQuota="+1; // 默认是按照link 排序 } + if(searchIspCode!=null&&searchIspCode.length>0){ + String str=StringUtils.join(searchIspCode,","); + url=url+"&searchIspCode="+str; + } String string = HttpClientUtil.get(url); Gson gson = new GsonBuilder().create(); fromJsonList = gson.fromJson(string, new TypeToken>(){}.getType()); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index 9f96f06ef..f2c865d18 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -219,7 +219,7 @@ function showActionTransChart(xData,series){ entrance="Astana"; } if(d!=null&&d.entranceId==2){ - entrance="Alamty"; + entrance="Almaty"; } series.push({ name: entrance, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp index 4aed3181f..1f8b906af 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp @@ -43,7 +43,7 @@
- @@ -51,16 +51,29 @@ +
+
+
+ +
+ +
+
- <%-- --%> +
@@ -95,7 +108,7 @@
- @@ -103,16 +116,29 @@ +
+
+
+ +
+ +
+
- <%-- --%> +
@@ -156,6 +182,7 @@ + () @@ -189,20 +216,32 @@ $("#beginDate").val(starth); $("#endDate").val(endh); var appType=$("#appType").val(); - var entranceId=$("#entranceId").val(); + var entranceId1=$("#entranceId1").val(); + var entranceId2=$("#entranceId2").val(); + var isp1=$("#isp1").val(); + var isp2=$("#isp2").val(); var searchQuota=$(".searchQuota[class~='active']").val(); - appTransAjax(starth,endh,appType,entranceId); - showRealTimeTransChart(appType,entranceId);// 实时折线 - appTop100List(starth,endh,appType,entranceId,searchQuota); + showRealTimeTransChart(appType,entranceId1,isp1);// 实时折线 + appTransAjax(starth,endh,appType,entranceId2,isp2); + appTop100List(starth,endh,appType,entranceId2,searchQuota,isp2); //筛选功能初始化 - $("#resetBtn").on("click",function() { - $("select.selectpicker").each(function() { - $(this).selectpicker('val',$(this).find('option:first').val()); + $("#resetBtn1").on("click",function() { + $("#searchForm1 select.selectpicker").each(function() { + $(this).selectpicker('val',""); $(this).find("option").attr("selected",false); - $(this).find("option:first").attr("selected",true); +// $(this).find("option:first").attr("selected",true); + }); + $("#searchForm1")[0].reset(); + }); + //筛选功能初始化 + $("#resetBtn2").on("click",function() { + $("#searchForm2 select.selectpicker").each(function() { + $(this).selectpicker('val',""); + $(this).find("option").attr("selected",false); +// $(this).find("option:first").attr("selected",true); }); $(".Wdate").attr("value", ''); - $("#searchForm")[0].reset(); + $("#searchForm2")[0].reset(); }); $(".searchQuota").on("click",function(){ $(".searchQuota").removeClass("active"); @@ -226,12 +265,14 @@ // 改变排序字段 function changeOrderby(searchQuota) { loading(); - appTop100List($("#beginDate").val(),$("#endDate").val(),$("#appType").val(),$("#entranceId").val(),searchQuota); + appTop100List($("#beginDate").val(),$("#endDate").val(),$("#appType").val(),$("#entranceId2").val(),searchQuota,$("#isp2").val()); } function searchList1() { + loading(); var appType=$("#appType").val(); - var entranceId=$("#entranceId").val(); - showRealTimeTransChart(appType,entranceId);// 折线 + var entranceId1=$("#entranceId1").val(); + var isp1=$("#isp1").val(); + showRealTimeTransChart(appType,entranceId1,isp1);// 折线 } function searchList2() { var start = $("#beginDate").val(); @@ -242,14 +283,15 @@ window.location.reload(); } else { var appType=$("#appType").val(); - var entranceId=$("#entranceId").val(); + var entranceId2=$("#entranceId2").val(); + var isp2=$("#isp2").val(); var searchQuota=$(".searchQuota[class~='active']").val(); - appTransAjax(start,end,appType,entranceId);// 折线 - appTop100List(start,end,appType,entranceId,searchQuota);// 列表 + appTransAjax(start,end,appType,entranceId2,isp2);// 折线 + appTop100List(start,end,appType,entranceId2,searchQuota,isp2);// 列表 } } // 列表 - function appTop100List(start,end,appType,entranceId,searchQuota){ + function appTop100List(start,end,appType,entranceId,searchQuota,isp){ $.ajax({ url : "${ctx}/dashboard/traffic/ajaxAppTopList", type : 'get', @@ -259,7 +301,8 @@ "endDate" : end, "appType" : appType, "entranceId" : entranceId, - "searchQuota":searchQuota + "searchQuota":searchQuota, + "searchIspCode":isp }, async : true, timeout : 50000, @@ -312,9 +355,10 @@ if (data != null) { var html =""; html += "" + data.ipAddr + ""; + html += "" + data.ispName + ""; html += "" + data.logNum + ""; html += "" + data.logPercent + " %"; -// html += "" + (((data.entranceId)==1) ? "Astana":"Alamty") + ""; +// html += "" + (((data.entranceId)==1) ? "Astana":"Almaty") + ""; html += "" + Math.round(data.pktNum*100)/100 + ""; html += "" + data.pktPercent + " %"; html += "" + Math.round(data.byteNum*100)/100 + ""; @@ -325,6 +369,7 @@ if(index==fileDataS.length-1){ html+="" html+= ""+""+""; + html+= "" +"--"+""; html+= ""+totalunique+""; html+= "" +"--"+""; html+= ""+totalpkt+""; @@ -333,7 +378,7 @@ html+= ""+"--"+""; html+= ""+"--"+""; html+= ""+"--"+""; - html+="" + html+="" } } $("#tableData").append(html); @@ -342,12 +387,20 @@ } // app曲线图 - function appTransAjax(beginDate, endDate,appType,entranceId) { + function appTransAjax(beginDate, endDate,appType,entranceId,isp) { loading(); - $.ajax({ url : "${ctx}/dashboard/traffic/ajaxAppTrend?appType="+appType+"&beginDate="+beginDate+"&endDate="+endDate+"&entranceId="+entranceId, + $.ajax({ url : "${ctx}/dashboard/traffic/ajaxAppTrend", type : "get", dataType : "json", async : true, + data : { + "beginDate" : beginDate, + "endDate" : endDate, + "appType" : appType, + "entranceId" : entranceId, + "searchIspCode":isp + }, + traditional:true, success : function(rs) { var series=new Array(); var sipResult=new Array(); @@ -502,13 +555,22 @@ $(".pageNum").text(Math.ceil(totalData/10)); } } - function realTimeTrendAjax(beginDate, endDate,appType,entranceId){ + function realTimeTrendAjax(beginDate, endDate,appType,entranceId,isp){ + console.log(isp) var result={}; $.ajax({ - url : "${ctx}/dashboard/traffic/ajaxAppTrend?appType="+appType+"&beginDate="+beginDate+"&endDate="+endDate+"&entranceId="+entranceId, + url : "${ctx}/dashboard/traffic/ajaxAppTrend", type : "get", dataType : "json", + data : { + "beginDate" : beginDate, + "endDate" : endDate, + "appType" : appType, + "entranceId" : entranceId, + "searchIspCode":isp + }, async : false, + traditional:true, success : function(rs) { result=rs; closeTip(); @@ -524,14 +586,14 @@ } var timer=null; // 局点信息 - function showRealTimeTransChart(appType,entranceId) { + function showRealTimeTransChart(appType,entranceId,isp) { var time1=(new Date().getTime())-(1000 * 60 * 10+1000 * 60 * 5); var time2=(new Date().getTime())-(1000 * 60 * 5);//推迟五分钟 var beginDate=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time1)); //获取十个点 var endDate=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time2)); // 少算一分钟 var sipResult=new Array(); var dipResult=new Array(); - var intData = realTimeTrendAjax(beginDate, endDate,appType,entranceId); //初始化数据 为10个点 + var intData = realTimeTrendAjax(beginDate, endDate,appType,entranceId,isp); //初始化数据 为10个点 sipResult=intData.sipResult; dipResult=intData.dipResult; var nowDate=new Date(); @@ -712,11 +774,19 @@ var begin=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time3)); //获取1个点少算一分钟 var end=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time4)); $.ajax({ - url : "${ctx}/dashboard/traffic/ajaxAppTrend?appType="+appType+"&beginDate="+begin+"&endDate="+end+"&entranceId="+entranceId, + url : "${ctx}/dashboard/traffic/ajaxAppTrend", type : "post", dataType : "json", cache:false, + data : { + "beginDate" : begin, + "endDate" : end, + "appType" : appType, + "entranceId" : entranceId, + "searchIspCode":isp + }, async : true, + traditional:true, success : function(rs) { var realTimeData=rs; if(realTimeData!=null&&Object.keys(realTimeData).length>0){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index f34043d48..c1e0520cc 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -29,10 +29,10 @@ - +
- + @@ -154,7 +154,7 @@ $(document).ready(function(){ $(this).find("option:first").attr("selected",true); }); $(".Wdate").attr("value",''); - $("#searchForm")[0].reset(); + $("#searchForm1")[0].reset(); }); // setInterval(function(){ // ajaxAppList(starth,new Date().Format("yyyy-MM-dd HH:mm:00")); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index 996fa4cbe..e65e4e8ee 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -248,7 +248,7 @@ function changeBandwidth(unitType,beginDate,endDate){ } }); $("#total2").val(JSON.stringify(total2)); - showBandwidthChart("chart2",unitType,xdata,series,"Alamty"); + showBandwidthChart("chart2",unitType,xdata,series,"Almaty"); closeTip(); }, error: function(data, textStatus, errorThrown){ @@ -407,7 +407,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ if(d[0].indexOf("Astana") != -1){ total=JSON.parse($("#total").val()); } - if(d[0].indexOf("Alamty") != -1){ + if(d[0].indexOf("Almaty") != -1){ total=JSON.parse($("#total2").val()); } } @@ -495,7 +495,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ if(d[0].indexOf("Astana") != -1){ total=JSON.parse($("#total").val()); } - if(d[0].indexOf("Alamty") != -1){ + if(d[0].indexOf("Almaty") != -1){ total=JSON.parse($("#total2").val()); } } diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 8fa440fc2..3395d5282 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -415,7 +415,7 @@ function showIpActiveChart(xData,series){ var html = ""; html+= ""+rs.ipAddr+""; - html+= ""+(rs.areaId==1? "Astana":"Alamty")+""; + html+= ""+(rs.areaId==1? "Astana":"Almaty")+""; html+= ""+rs.c2sByteLen+""; html+= ""+rs.s2cByteLen+""; html+= ""+byteNum+""; diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 0e635e3ab..0a4e17de8 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -395,7 +395,7 @@ html += ''; html += "" + data.website + ""; html += "" + data.uniqueNum + ""; - html += "" + (((data.entranceId)==1) ? "Astana":"Alamty") + ""; + html += "" + (((data.entranceId)==1) ? "Astana":"Almaty") + ""; html += "" + Math.round(data.pktCount*100)/100 + ""; html += "" + packper + " %"; html += "" + Math.round(data.Gbyte*100)/100 + "";