diff --git a/src/main/java/com/nis/domain/dashboard/TrafficIpActiveStatistic.java b/src/main/java/com/nis/domain/dashboard/TrafficIpActiveStatistic.java new file mode 100644 index 000000000..4658de1fd --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/TrafficIpActiveStatistic.java @@ -0,0 +1,82 @@ +package com.nis.domain.dashboard; + +import com.nis.util.excel.ExcelField; + +public class TrafficIpActiveStatistic{ + Integer id; + @ExcelField(title="IP",sort=10) + String ipAddr; + @ExcelField(title="Area",sort=20) + String areaId; + @ExcelField(title="Number",sort=30) + Integer linkNum; + @ExcelField(title="C2S(Pkt)",sort=40) + Integer c2sPktNum; + @ExcelField(title="S2C(Pkt)",sort=50) + Integer s2cPktNum; + @ExcelField(title="C2S(Byte)",sort=60) + Integer c2sByteLen; + @ExcelField(title="S2C(Byte)",sort=70) + Integer s2cByteLen; + @ExcelField(title="Time",sort=80) + String statTime; + + public Integer getId() { + return id; + } + public void setId(Integer id) { + this.id = id; + } + public String getStatTime() { + return statTime; + } + public void setStatTime(String statTime) { + this.statTime = statTime; + } + public TrafficIpActiveStatistic(){ + super(); + } + public String getIpAddr() { + return ipAddr; + } + public void setIpAddr(String ipAddr) { + this.ipAddr = ipAddr; + } + public String getAreaId() { + return areaId; + } + public void setAreaId(String areaId) { + this.areaId = areaId; + } + public Integer getLinkNum() { + return linkNum; + } + public void setLinkNum(Integer linkNum) { + this.linkNum = linkNum; + } + public Integer getC2sPktNum() { + return c2sPktNum; + } + public void setC2sPktNum(Integer c2sPktNum) { + this.c2sPktNum = c2sPktNum; + } + public Integer getS2cPktNum() { + return s2cPktNum; + } + public void setS2cPktNum(Integer s2cPktNum) { + this.s2cPktNum = s2cPktNum; + } + public Integer getC2sByteLen() { + return c2sByteLen; + } + public void setC2sByteLen(Integer c2sByteLen) { + this.c2sByteLen = c2sByteLen; + } + public Integer getS2cByteLen() { + return s2cByteLen; + } + public void setS2cByteLen(Integer s2cByteLen) { + this.s2cByteLen = s2cByteLen; + } + +} \ No newline at end of file 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 b8549b93d..b5aca830b 100644 --- a/src/main/java/com/nis/web/controller/dashboard/DashboardController.java +++ b/src/main/java/com/nis/web/controller/dashboard/DashboardController.java @@ -1,10 +1,12 @@ package com.nis.web.controller.dashboard; import java.lang.reflect.Type; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Set; import javax.servlet.http.HttpServletRequest; @@ -30,10 +32,13 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.PageLog; import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.configuration.WebsiteDomainTopic; +import com.nis.domain.dashboard.TrafficIpActiveStatistic; import com.nis.util.CodeDicUtils; import com.nis.util.Constants; +import com.nis.util.DateUtils; import com.nis.util.DictUtils; import com.nis.util.StringUtil; +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; @@ -171,7 +176,48 @@ public class DashboardController extends BaseController{ return "/dashboard/trafficIpActiveList"; } - + //IP活跃导出 + @RequestMapping(value = "export") + public void exportddos(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("entry")TrafficIpActiveStatistic 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 fromJsonList = new HashMap(); + List ipActiveList = new ArrayList(); + String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_ONEHOUR); + + Gson gson = getIntGson(); + fromJsonList = gson.fromJson(string, new TypeToken>(){}.getType()); + ipActiveList = gson.fromJson(fromJsonList.get("data").toString(), new TypeToken>() {}.getType()) ; + + titleList.add("traffic_ipactive_hour_max"); + classMap.put(null, TrafficIpActiveStatistic.class); + String cfgIndexInfoNoExport=",id,"; + noExportMap.put("traffic_ipactive_hour_max",cfgIndexInfoNoExport); + dataMap.put(null, ipActiveList); + + + // 获取国际化配置 + Properties msgProp = getMsgProp(); + Map map = new HashMap(); + + String fileName = "IP-Active-Hour-Max" + "-" + DateUtils.getDate("yyyyMMddHHmmss") + + ".xlsx"; + new ExportExcel("", TrafficIpActiveStatistic.class, 1).setDataList(msgProp,ipActiveList,new HashMap()) + .write(request,response, fileName).dispose(); + + + } catch (Exception e) { + e.printStackTrace(); + logger.error("IPActive export failed",e); + addMessage(redirectAttributes,"error","export_failed"); + } +// return "/dashboard/trafficIpActiveList"; + } /** * 协议统计 */ @@ -668,78 +714,7 @@ public class DashboardController extends BaseController{ model.addAttribute("chartMap",list); return "/dashboard/trafficWebTypeList"; } - public class TrafficIpActiveStatistic{ - Integer id=1; - String ipAddr="10.1.1.2"; - String areaId="1045"; - Integer linkNum=3121; - Integer c2sPktNum=1352; - Integer s2cPktNum=2234; - Integer c2sByteLen=31; - Integer s2cByteLen=23323; - String statTime; - - public Integer getId() { - return id; - } - public void setId(Integer id) { - this.id = id; - } - public String getStatTime() { - return statTime; - } - public void setStatTime(String statTime) { - this.statTime = statTime; - } - public TrafficIpActiveStatistic(){ - super(); - } - public String getIpAddr() { - return ipAddr; - } - public void setIpAddr(String ipAddr) { - this.ipAddr = ipAddr; - } - public String getAreaId() { - return areaId; - } - public void setAreaId(String areaId) { - this.areaId = areaId; - } - public Integer getLinkNum() { - return linkNum; - } - public void setLinkNum(Integer linkNum) { - this.linkNum = linkNum; - } - public Integer getC2sPktNum() { - return c2sPktNum; - } - public void setC2sPktNum(Integer c2sPktNum) { - this.c2sPktNum = c2sPktNum; - } - public Integer getS2cPktNum() { - return s2cPktNum; - } - public void setS2cPktNum(Integer s2cPktNum) { - this.s2cPktNum = s2cPktNum; - } - public Integer getC2sByteLen() { - return c2sByteLen; - } - public void setC2sByteLen(Integer c2sByteLen) { - this.c2sByteLen = c2sByteLen; - } - public Integer getS2cByteLen() { - return s2cByteLen; - } - public void setS2cByteLen(Integer s2cByteLen) { - this.s2cByteLen = s2cByteLen; - } - - - - } + public static void main(String[] args) { Map map = new HashMap(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 53d6b01f2..74a0bb534 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -33,6 +33,11 @@

+
+ +
+
+
diff --git a/src/main/webapp/WEB-INF/views/sys/cfgOperationLogList.jsp b/src/main/webapp/WEB-INF/views/sys/cfgOperationLogList.jsp index b3cf35150..9fda44767 100644 --- a/src/main/webapp/WEB-INF/views/sys/cfgOperationLogList.jsp +++ b/src/main/webapp/WEB-INF/views/sys/cfgOperationLogList.jsp @@ -80,13 +80,14 @@ <%-- --%> - + -
+
+
diff --git a/src/main/webapp/WEB-INF/views/sys/logList.jsp b/src/main/webapp/WEB-INF/views/sys/logList.jsp index af8df2a36..4d8a3676a 100644 --- a/src/main/webapp/WEB-INF/views/sys/logList.jsp +++ b/src/main/webapp/WEB-INF/views/sys/logList.jsp @@ -65,8 +65,8 @@ onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
- - + +
@@ -74,7 +74,8 @@ -
+
+