From b6b5bf190ab569f898b7f45c36a158212f7ee3b5 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Tue, 25 Dec 2018 17:17:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0drop,loop,new=20link=20,close=20link=20,pass=20,live?= =?UTF-8?q?=20link=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/Constants.java | 1 + .../TrafficStatisticsInfoController.java | 66 +++++ src/main/resources/nis.properties | 3 +- .../views/dashboard/dashBoardIndex.jsp | 24 +- .../dashboard/ntcTotalReportDetailList.jsp | 280 ++++++++++++++++++ .../views/dashboard/trafficAppTypeList.jsp | 2 +- .../dashboard/trafficHttpStatisticList.jsp | 2 +- .../views/dashboard/trafficIpActiveList.jsp | 2 +- .../dashboard/trafficProtocolTypeList.jsp | 2 +- .../views/dashboard/trafficWebTypeList.jsp | 2 +- 10 files changed, 366 insertions(+), 18 deletions(-) create mode 100644 src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index cc17b59ee..d128ee70b 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -715,6 +715,7 @@ public final class Constants { 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"); + public static final String TREND_TOTAL_REPORT=Configurations.getStringProperty("trendTotalReport","trendTotalReport"); /** * httpclient 工具超时时间设置 */ 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 14ad1aeae..9075b7b30 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -639,4 +639,70 @@ public class TrafficStatisticsInfoController extends BaseController { } return list; } + /** + * drop, loop,new link,close link,pass,live link + */ + @RequestMapping("ntcTotalReportDetail") + public String ntcTotalReportDetail(Model model,String searchAction){ + Calendar cal = Calendar. getInstance (); + cal.setTime(new Date()); + String now = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//鑾峰彇鍒板畬鏁寸殑鏃堕棿 + cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1); + String oneHoursAgo = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime()); + model.addAttribute("searchAction", searchAction); + model.addAttribute("beginDate", oneHoursAgo); + model.addAttribute("endDate", now); + return "/dashboard/ntcTotalReportDetailList"; + } + @RequestMapping("ajaxNtcTotalReportDetail") + @ResponseBody + public Map ajaxNtcTotalReportDetail(String beginDate,String endDate,Model model,String searchAction){ + Map fromJsonList = new HashMap(); + Map map = new HashMap(); + try { + String url=Constants.DASHBOARD_URL+Constants.TREND_TOTAL_REPORT; + if(StringUtil.isBlank(beginDate)||StringUtil.isBlank(endDate)){ + Calendar cal = Calendar. getInstance (); + cal.setTime(new Date()); + endDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间 + cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1); + beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime()); + } + URIBuilder uriBuilder = new URIBuilder(url); + uriBuilder.addParameter("searchReportStartTime",beginDate); + uriBuilder.addParameter("searchReportEndTime",endDate); + url=uriBuilder.toString(); + if(searchAction!=null){ + if("action_drop".equals(searchAction)){ + url=url+"&searchBusinessType="+1; + } + if("action_loop".equals(searchAction)){ + url=url+"&searchBusinessType="+2; + } + if("new_link".equals(searchAction)){ + url=url+"&searchBusinessType="+3; + } + if("active_link".equals(searchAction)){ + url=url+"&searchBusinessType="+4; + } + if("pass".equals(searchAction)){ + url=url+"&searchBusinessType="+6; + } + if("live_link".equals(searchAction)){ + url=url+"&searchBusinessType="+5; + } + } + + String string = HttpClientUtil.get(url); + Gson gson = new GsonBuilder().create(); + fromJsonList = gson.fromJson(string, new TypeToken>(){}.getType()); + logger.debug("动作详情统计一小时"+fromJsonList); + map = (Map) fromJsonList.get("data"); + + } catch (Exception e) { + e.printStackTrace(); + logger.error("动作详情统计一小时数据获取错误"+e); + } + return map; + } } diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index dd9089f22..a0f0c50ac 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -603,4 +603,5 @@ trafficTopicList=trafficTopicList trafficDomainTrans=trafficDomainTrans #maximum number to import import_limit=10 -trafficPortActiveFiveMinute=trafficPortActiveFiveMinute \ No newline at end of file +trafficPortActiveFiveMinute=trafficPortActiveFiveMinute +trendTotalReport=trendTotalReport \ 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 fc7df6fbc..43f3e958f 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp @@ -101,75 +101,75 @@ 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

- +

" 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

- +

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

-

0

+

0

diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp new file mode 100644 index 000000000..73661cbb1 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -0,0 +1,280 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="traffic_ip_active"></spring:message> + + + + + +
+ +

+ +

+ +
+ + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+ + +
+
+ +
+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index b5107e140..d77aa2a73 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -84,7 +84,7 @@ -