diff --git a/src/main/java/com/nis/domain/dashboard/TrafficIpActiveStatistic.java b/src/main/java/com/nis/domain/dashboard/TrafficIpActiveStatistic.java index d39d49b34..70e5e593d 100644 --- a/src/main/java/com/nis/domain/dashboard/TrafficIpActiveStatistic.java +++ b/src/main/java/com/nis/domain/dashboard/TrafficIpActiveStatistic.java @@ -1,26 +1,43 @@ package com.nis.domain.dashboard; +import java.math.BigInteger; + import com.nis.util.excel.ExcelField; public class TrafficIpActiveStatistic{ Integer id; - @ExcelField(title="IP",sort=10) + @ExcelField(title="IP",sort=10,type=1) String ipAddr; - @ExcelField(title="Area",sort=20) + @ExcelField(title="Area",dictType="ENTRANCE",sort=20,type=1) String areaId; - @ExcelField(title="Number",sort=30) + @ExcelField(title="Link Times",sort=52,type=1) Long linkNum; - @ExcelField(title="C2S(Pkt)",sort=40) + @ExcelField(title="C2S(Pkt)",sort=60,type=1) Long c2sPktNum; - @ExcelField(title="S2C(Pkt)",sort=50) + @ExcelField(title="S2C(Pkt)",sort=70,type=1) Long s2cPktNum; - @ExcelField(title="C2S(Byte)",sort=60) + @ExcelField(title="C2S(Byte)",sort=40,type=1) Long c2sByteLen; - @ExcelField(title="S2C(Byte)",sort=70) + @ExcelField(title="S2C(Byte)",sort=50,type=1) Long s2cByteLen; - @ExcelField(title="Time",sort=80) + @ExcelField(title="Statistic Time",sort=80,type=1) String statTime; - + private String _byte; + private String _packet; + @ExcelField(title="Byte",sort=51,type=1) + public String get_byte() { + return BigInteger.valueOf(this.getC2sByteLen()).add(BigInteger.valueOf(this.getS2cByteLen())).toString(); + } + public void set_byte(String _byte) { + this._byte = _byte; + } + @ExcelField(title="Packet",sort=71,type=1) + public String get_packet() { + return BigInteger.valueOf(this.getC2sPktNum()).add(BigInteger.valueOf(this.s2cPktNum)).toString(); + } + public void set_packet(String _packet) { + this._packet = _packet; + } public Integer getId() { return id; } 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 576adffb9..4ef22df78 100644 --- a/src/main/java/com/nis/web/controller/dashboard/DashboardController.java +++ b/src/main/java/com/nis/web/controller/dashboard/DashboardController.java @@ -47,6 +47,8 @@ import com.nis.util.excel.ExportExcel; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; import com.nis.web.dao.dashboard.codedic.CodeResult; + +import antlr.StringUtils; @SuppressWarnings("rawtypes") @Controller @RequestMapping(value = "${adminPath}/dashboard") @@ -218,7 +220,7 @@ public class DashboardController extends BaseController{ //IP活跃导出 @RequestMapping(value = "export") public void exportddos(Model model,HttpServletRequest request,HttpServletResponse response, - @ModelAttribute("entry")TrafficIpActiveStatistic entity,String ids,RedirectAttributes redirectAttributes){ + @ModelAttribute("entry")TrafficIpActiveStatistic entity,String ids,String beginDate,String endDate,RedirectAttributes redirectAttributes){ try { //export data info List titleList=new ArrayList(); @@ -227,7 +229,11 @@ public class DashboardController extends BaseController{ Map noExportMap=new HashMap(); Map fromJsonList = new HashMap(); List ipActiveList = new ArrayList(); - String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_ONEHOUR); + String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_ONEHOUR; + if(org.apache.commons.lang3.StringUtils.isNotBlank(beginDate)&&org.apache.commons.lang3.StringUtils.isNotBlank(endDate)) { + url=urlAddDate(url, beginDate, endDate); + } + String string = HttpClientUtil.get(url); Gson gson = getIntGson(); fromJsonList = gson.fromJson(string, new TypeToken>(){}.getType()); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 981ae1f22..3ced6aa31 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -61,7 +61,7 @@
- +


@@ -130,9 +130,6 @@ function searchList(){ } } - - - function checkDate(start,end){ if(getDate(start)-getDate(end)>0){ alert("结束时间不能小于开始时间!"); @@ -147,7 +144,9 @@ function getDate(date){ } return dateReturn; } - +function _export(url){ + window.location=url+"?beginDate="+$("#beginDateh").val()+"&endDate="+$("#endDateh").val(); +}