diff --git a/src/main/java/com/nis/domain/restful/NtcAppLog.java b/src/main/java/com/nis/domain/restful/NtcAppLog.java index 8b25735..ea47df7 100644 --- a/src/main/java/com/nis/domain/restful/NtcAppLog.java +++ b/src/main/java/com/nis/domain/restful/NtcAppLog.java @@ -1,5 +1,6 @@ package com.nis.domain.restful; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.LogEntity; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -26,6 +27,10 @@ public class NtcAppLog extends LogEntity { private Integer labelAppId; @ApiModelProperty(value = "应用来源", required = true) private Integer labelAppSource; + + + protected String searchLabelAppId;//App Id + protected String searchLabelProtoId;//协议类型ID public Integer getLabelProtoId() { return labelProtoId; @@ -71,4 +76,20 @@ public class NtcAppLog extends LogEntity { public void setLabelAppSource(Integer labelAppSource) { this.labelAppSource = labelAppSource; } + @JsonIgnore + public String getSearchLabelAppId() { + return searchLabelAppId; + } + + public void setSearchLabelAppId(String searchLabelAppId) { + this.searchLabelAppId = searchLabelAppId; + } + @JsonIgnore + public String getSearchLabelProtoId() { + return searchLabelProtoId; + } + + public void setSearchLabelProtoId(String searchLabelProtoId) { + this.searchLabelProtoId = searchLabelProtoId; + } } diff --git a/src/main/java/com/nis/domain/restful/NtcBgpLog.java b/src/main/java/com/nis/domain/restful/NtcBgpLog.java index 0a84fcf..edbb66d 100644 --- a/src/main/java/com/nis/domain/restful/NtcBgpLog.java +++ b/src/main/java/com/nis/domain/restful/NtcBgpLog.java @@ -1,5 +1,6 @@ package com.nis.domain.restful; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.LogEntity; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -21,6 +22,8 @@ public class NtcBgpLog extends LogEntity { @ApiModelProperty(value="路由信息", required=true) protected String route; + protected String searchAsNum;//ASN号 + public void setType(Integer type) { this.type = type; } @@ -40,4 +43,12 @@ public class NtcBgpLog extends LogEntity { return route; } + @JsonIgnore + public String getSearchAsNum() { + return searchAsNum; + } + + public void setSearchAsNum(String searchAsNum) { + this.searchAsNum = searchAsNum; + } } diff --git a/src/main/java/com/nis/domain/restful/NtcDdosLog.java b/src/main/java/com/nis/domain/restful/NtcDdosLog.java index 05b70a7..f899142 100644 --- a/src/main/java/com/nis/domain/restful/NtcDdosLog.java +++ b/src/main/java/com/nis/domain/restful/NtcDdosLog.java @@ -2,6 +2,7 @@ package com.nis.domain.restful; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.LogEntity; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -33,6 +34,8 @@ public class NtcDdosLog extends LogEntity { protected Integer isBlock; protected String searchIsBlock; //攻击流量是否被丢弃 + protected String searchAttackType; //攻击类型 + public Integer getAttackType() { return attackType; } @@ -82,6 +85,7 @@ public class NtcDdosLog extends LogEntity { this.isBlock = isBlock; } + @JsonIgnore public String getSearchIsBlock() { return searchIsBlock; } @@ -89,4 +93,13 @@ public class NtcDdosLog extends LogEntity { public void setSearchIsBlock(String searchIsBlock) { this.searchIsBlock = searchIsBlock; } + + @JsonIgnore + public String getSearchAttackType() { + return searchAttackType; + } + + public void setSearchAttackType(String searchAttackType) { + this.searchAttackType = searchAttackType; + } } diff --git a/src/main/java/com/nis/domain/restful/NtcFtpLog.java b/src/main/java/com/nis/domain/restful/NtcFtpLog.java index 00d9ae9..3a515a3 100644 --- a/src/main/java/com/nis/domain/restful/NtcFtpLog.java +++ b/src/main/java/com/nis/domain/restful/NtcFtpLog.java @@ -1,5 +1,6 @@ package com.nis.domain.restful; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.LogEntity; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -17,7 +18,8 @@ public class NtcFtpLog extends LogEntity { @ApiModelProperty(value = "FTP内容", required = true) protected String ftpContent; - + protected String searchFtpUrl; + public String getFtpUrl() { return ftpUrl; } @@ -33,4 +35,12 @@ public class NtcFtpLog extends LogEntity { public void setFtpContent(String ftpContent) { this.ftpContent = ftpContent; } + @JsonIgnore + public String getSearchFtpUrl() { + return searchFtpUrl; + } + + public void setSearchFtpUrl(String searchFtpUrl) { + this.searchFtpUrl = searchFtpUrl; + } } diff --git a/src/main/java/com/nis/domain/restful/NtcP2pLog.java b/src/main/java/com/nis/domain/restful/NtcP2pLog.java index 8583efc..5e8c71f 100644 --- a/src/main/java/com/nis/domain/restful/NtcP2pLog.java +++ b/src/main/java/com/nis/domain/restful/NtcP2pLog.java @@ -1,5 +1,6 @@ package com.nis.domain.restful; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.LogEntity; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -22,6 +23,8 @@ public class NtcP2pLog extends LogEntity { @ApiModelProperty(value = "Emule搜索关键词", required = true) private String p2pKeyword; + protected String searchP2pFileId; + protected String searchP2pKeyword; /** * @return the p2pProto */ @@ -58,4 +61,22 @@ public class NtcP2pLog extends LogEntity { public void setP2pKeyword(String p2pKeyword) { this.p2pKeyword = p2pKeyword; } + + @JsonIgnore + public String getSearchP2pFileId() { + return searchP2pFileId; + } + + public void setSearchP2pFileId(String searchP2pFileId) { + this.searchP2pFileId = searchP2pFileId; + } + + @JsonIgnore + public String getSearchP2pKeyword() { + return searchP2pKeyword; + } + + public void setSearchP2pKeyword(String searchP2pKeyword) { + this.searchP2pKeyword = searchP2pKeyword; + } } diff --git a/src/main/java/com/nis/domain/restful/NtcStreamingMediaLog.java b/src/main/java/com/nis/domain/restful/NtcStreamingMediaLog.java index cb2bbb1..7790624 100644 --- a/src/main/java/com/nis/domain/restful/NtcStreamingMediaLog.java +++ b/src/main/java/com/nis/domain/restful/NtcStreamingMediaLog.java @@ -1,5 +1,6 @@ package com.nis.domain.restful; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.LogEntity; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -16,6 +17,8 @@ public class NtcStreamingMediaLog extends LogEntity { protected String url; @ApiModelProperty(value="传输协议", required=true) protected String protocol; + + protected String searchUrl; public String getUrl() { return url; } @@ -28,4 +31,13 @@ public class NtcStreamingMediaLog extends LogEntity { public void setProtocol(String protocol) { this.protocol = protocol; } + + @JsonIgnore + public String getSearchUrl() { + return searchUrl; + } + + public void setSearchUrl(String searchUrl) { + this.searchUrl = searchUrl; + } } diff --git a/src/main/java/com/nis/domain/restful/NtcVoipLog.java b/src/main/java/com/nis/domain/restful/NtcVoipLog.java index 40da9f4..f5769d9 100644 --- a/src/main/java/com/nis/domain/restful/NtcVoipLog.java +++ b/src/main/java/com/nis/domain/restful/NtcVoipLog.java @@ -1,5 +1,6 @@ package com.nis.domain.restful; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.LogEntity; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -25,6 +26,9 @@ public class NtcVoipLog extends LogEntity { protected String callingNumber; @ApiModelProperty(value="VOIP被叫电信号码", required=true) protected String calledNumber; + + protected String searchCallingAccount; + protected String searchCalledAccount; /** * @return the voipProtocol */ @@ -67,4 +71,21 @@ public class NtcVoipLog extends LogEntity { public void setCalledNumber(String calledNumber) { this.calledNumber = calledNumber; } + + @JsonIgnore + public String getSearchCalledAccount() { + return searchCalledAccount; + } + + public void setSearchCalledAccount(String searchCalledAccount) { + this.searchCalledAccount = searchCalledAccount; + } + @JsonIgnore + public String getSearchCallingAccount() { + return searchCallingAccount; + } + + public void setSearchCallingAccount(String searchCallingAccount) { + this.searchCallingAccount = searchCallingAccount; + } } diff --git a/src/main/java/com/nis/domain/restful/dashboard/AppConnRecordStatistic.java b/src/main/java/com/nis/domain/restful/dashboard/AppConnRecordStatistic.java index 270bc4b..12055e0 100644 --- a/src/main/java/com/nis/domain/restful/dashboard/AppConnRecordStatistic.java +++ b/src/main/java/com/nis/domain/restful/dashboard/AppConnRecordStatistic.java @@ -5,44 +5,94 @@ import com.fasterxml.jackson.annotation.JsonIgnore; public class AppConnRecordStatistic extends AppTrendEntity{ protected String ipAddr; - protected String pktNum; - protected String byteNum; - protected String logNum; //日志数量 + protected Double pktNum; + protected String pktPercent; + protected Double byteNum; + protected String bytePercent; + protected Double logNum; //日志数量 + protected String logPercent; + protected String searchQuota="1"; //统计指标 1:连接数 2:包数 3:字节数 public AppConnRecordStatistic() { super(); // TODO Auto-generated constructor stub } - public AppConnRecordStatistic(String ipAddr, String pktNum, String byteNum, - String logNum) { + + public AppConnRecordStatistic(String ipAddr, Double pktNum, + String pktPercent, Double byteNum, String bytePercent, + Double logNum, String logPercent) { super(); this.ipAddr = ipAddr; this.pktNum = pktNum; + this.pktPercent = pktPercent; this.byteNum = byteNum; + this.bytePercent = bytePercent; this.logNum = logNum; + this.logPercent = logPercent; } + public String getIpAddr() { return ipAddr; } public void setIpAddr(String ipAddr) { this.ipAddr = ipAddr; } - public String getPktNum() { + + public Double getPktNum() { return pktNum; } - public void setPktNum(String pktNum) { + + public void setPktNum(Double pktNum) { this.pktNum = pktNum; } - public String getByteNum() { + + public String getPktPercent() { + return pktPercent; + } + + public void setPktPercent(String pktPercent) { + this.pktPercent = pktPercent; + } + + public Double getByteNum() { return byteNum; } - public void setByteNum(String byteNum) { + + public void setByteNum(Double byteNum) { this.byteNum = byteNum; } - public String getLogNum() { + + public String getBytePercent() { + return bytePercent; + } + + public void setBytePercent(String bytePercent) { + this.bytePercent = bytePercent; + } + + public Double getLogNum() { return logNum; } - public void setLogNum(String logNum) { + + public void setLogNum(Double logNum) { this.logNum = logNum; } + + public String getLogPercent() { + return logPercent; + } + + public void setLogPercent(String logPercent) { + this.logPercent = logPercent; + } + + @JsonIgnore + public String getSearchQuota() { + return searchQuota; + } + + public void setSearchQuota(String searchQuota) { + this.searchQuota = searchQuota; + } + } diff --git a/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java b/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java index fe3a4db..7b488d8 100644 --- a/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java +++ b/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java @@ -42,7 +42,7 @@ import com.wordnik.swagger.annotations.Api; import com.wordnik.swagger.annotations.ApiOperation; import com.zdjizhi.utils.StringUtil; -@SuppressWarnings("unchecked") +@SuppressWarnings("all") @RestController @RequestMapping(value = "${servicePath}/log/v1") @Api(value = "DashboardServiceController", description = "统计分析图表基本服务接口") @@ -320,14 +320,14 @@ public class DashboardServiceController extends BaseRestController { */ @RequestMapping(value = "trafficProtocolList", method = RequestMethod.GET) @ApiOperation(value = "协议统计占比与报表", httpMethod = "GET", notes = "对应协议统计详情占比与报表") - public Map trafficProtocolList(Integer[] protoType,String beginDate, String endDate, Model model, HttpServletRequest request, + public Map trafficProtocolList(Integer[] protoType,String beginDate, String endDate,Integer entranceId, Model model, HttpServletRequest request, HttpServletResponse response) { long start = System.currentTimeMillis(); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); List list = new ArrayList(); try { - List ipActiveList = dashboardService.getProtocolList(beginDate, endDate,protoType); + List ipActiveList = dashboardService.getProtocolList(beginDate, endDate,protoType,entranceId); if (ipActiveList != null && ipActiveList.size() > 0) { String jsonString = JsonMapper.toJsonString(ipActiveList); list = (java.util.List) JsonMapper.fromJsonList(jsonString, HashMap.class); @@ -403,7 +403,7 @@ public class DashboardServiceController extends BaseRestController { */ @RequestMapping(value = "trafficIpActiveOneHour", method = RequestMethod.GET) @ApiOperation(value = "活跃IP统计一个小时的活跃IP", httpMethod = "GET", notes = "对应活跃IP实时统计查询服务。") - public Map trafficIpActiveOneHour(String beginDate, String endDate, Model model, + public Map trafficIpActiveOneHour(String beginDate, String endDate, Model model,Integer entranceId, HttpServletRequest request, HttpServletResponse response) { long start = System.currentTimeMillis(); @@ -413,7 +413,7 @@ public class DashboardServiceController extends BaseRestController { try { Date begin = DateUtils.parseDate(beginDate); Date end = DateUtils.parseDate(endDate); - List ipActiveChart = dashboardService.ipActiveOneHour(begin, end); + List ipActiveChart = dashboardService.ipActiveOneHour(begin, end,entranceId); if (ipActiveChart != null && ipActiveChart.size() > 0) { list = ipActiveChart; } @@ -440,7 +440,7 @@ public class DashboardServiceController extends BaseRestController { */ @RequestMapping(value = "trafficIpActiveFiveMinute", method = RequestMethod.GET) @ApiOperation(value = "活跃IP最近一个小时的变化趋势统计", httpMethod = "GET", notes = "对最新TOP10的活跃IP,在近一个小时的变化情况进行统计") - public Map trafficIpActiveFiveMinute(String beginDate, String endDate, Model model, + public Map trafficIpActiveFiveMinute(String beginDate, String endDate, Model model,Integer entranceId, HttpServletRequest request, HttpServletResponse response) { long start = System.currentTimeMillis(); @@ -454,7 +454,7 @@ public class DashboardServiceController extends BaseRestController { begin = DateUtils.parseDate(beginDate); end = DateUtils.parseDate(endDate); } - List ipActiveChart = dashboardService.ipActiveFiveMinute(begin, end); + List ipActiveChart = dashboardService.ipActiveFiveMinute(begin, end,entranceId); if (ipActiveChart != null && ipActiveChart.size() > 0) { list = ipActiveChart; } @@ -515,14 +515,14 @@ public class DashboardServiceController extends BaseRestController { */ @RequestMapping(value = "trafficAppList", method = RequestMethod.GET) @ApiOperation(value = "App统计占比与报表", httpMethod = "GET", notes = "对应App统计详情占比与报表") - public Map trafficAppList(Integer[] appType, String beginDate, String endDate, Model model, + public Map trafficAppList(Integer[] appType, String beginDate, String endDate, Model model,Integer entranceId, HttpServletRequest request, HttpServletResponse response) { long start = System.currentTimeMillis(); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); List list = new ArrayList(); try { - List appList = dashboardService.getAppList(beginDate, endDate, appType); + List appList = dashboardService.getAppList(beginDate, endDate, appType,entranceId); if (appList != null && appList.size() > 0) { String jsonString = JsonMapper.toJsonString(appList); list = (java.util.List) JsonMapper.fromJsonList(jsonString, HashMap.class); diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.java b/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.java index 119b073..fc8d147 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.java +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.java @@ -14,7 +14,8 @@ public interface TrafficAppStatisticDao { TrafficAppStatistic getMaxStatTime(); List appChart(@Param("statTime")Date statTime); - List getAppList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("appType")Integer[] appType); + List getAppList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("appType")Integer[] appType,@Param("entranceId")Integer entranceId); List getAppTrend(TrafficAppFocusStatistic entity); List appConnRecordTop100(AppConnRecordStatistic entity); + List appConnRecordTotal(AppConnRecordStatistic entity); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.xml b/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.xml index 8192017..9c2f382 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.xml @@ -30,7 +30,7 @@ @@ -46,24 +49,40 @@ - + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.java b/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.java index e22e825..9c606aa 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.java +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.java @@ -15,9 +15,9 @@ public interface TrafficIpActiveStatisticDao { // List getIpList(TrafficIpActiveStatistic trafficIpActiveStatistic); TrafficIpActiveStatistic getMaxStatTime(); - ArrayList ipActiveFiveMinute( @Param("ipAddr") String ipAddr,@Param("beginDate")Date beginDate,@Param("endDate")Date endDate); + ArrayList ipActiveFiveMinute( @Param("ipAddr") String ipAddr,@Param("beginDate")Date beginDate,@Param("endDate")Date endDate,@Param("entranceId")Integer entranceId); - HashMap ipActiveOneHour(@Param("ipAddr") String ipAddr,@Param("beginDate")Date beginDate,@Param("endDate")Date endDate); + HashMap ipActiveOneHour(@Param("ipAddr") String ipAddr,@Param("beginDate")Date beginDate,@Param("endDate")Date endDate,@Param("entranceId")Integer entranceId); - ArrayList ipActiveChart(@Param("beginDate")Date beginDate,@Param("endDate")Date endDate); + ArrayList ipActiveChart(@Param("beginDate")Date beginDate,@Param("endDate")Date endDate,@Param("entranceId")Integer entranceId); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml b/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml index cbacf36..ed1eedd 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml @@ -36,6 +36,9 @@ @@ -61,14 +64,21 @@ diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.java b/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.java index f551971..839c05c 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.java +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.java @@ -13,6 +13,6 @@ public interface TrafficProtocolStatisticDao { TrafficProtocolStatistic getMaxStatTime(); List protocolChart(@Param("statTime")Date statTime); - List getProtocolList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("protoType")Integer[] protoType); + List getProtocolList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("protoType")Integer[] protoType,@Param("entranceId")Integer entranceId); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml b/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml index 45c8ccf..17e989e 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml @@ -27,7 +27,7 @@ diff --git a/src/main/java/com/nis/web/service/LogDataService.java b/src/main/java/com/nis/web/service/LogDataService.java index 42041ed..30cbbca 100644 --- a/src/main/java/com/nis/web/service/LogDataService.java +++ b/src/main/java/com/nis/web/service/LogDataService.java @@ -259,7 +259,7 @@ public class LogDataService { String field = filedAndColumnMap.get(key).toLowerCase(); if (type.equals("java.lang.String")) { - if (field.equals("url") || field.equals("website")) { + if (field.contains("url") || field.equals("website")) { whereSB.append(" and " + field + " like '" + StringEscapeUtils.unescapeHtml4(value.toString().trim()) + "%'"); } else if (field.equals("client_locate") || field.equals("server_locate")) { @@ -416,7 +416,7 @@ public class LogDataService { if (typeName.equals("java.lang.String")) { String field = filedAndColumnMap.get(key); - if (field.equals("url") || field.equals("website")) { + if (field.contains("url") || field.equals("website")) { whereSB.append(" and " + field + " like '" + StringEscapeUtils.unescapeHtml4(value.toString().trim()) + "%'"); } else { diff --git a/src/main/java/com/nis/web/service/restful/DashboardService.java b/src/main/java/com/nis/web/service/restful/DashboardService.java index 465c4f2..b50ce34 100644 --- a/src/main/java/com/nis/web/service/restful/DashboardService.java +++ b/src/main/java/com/nis/web/service/restful/DashboardService.java @@ -1,5 +1,6 @@ package com.nis.web.service.restful; +import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -15,6 +16,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.TreeMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -536,9 +538,9 @@ public class DashboardService extends BaseService { /** * 获取活跃IPtop10 的趋势图 */ - public List ipActiveFiveMinute(Date beginDate, Date endDate) { + public List ipActiveFiveMinute(Date beginDate, Date endDate,Integer entranceId) { List listMap = new ArrayList(); - List ipListTop10 = trafficIpActiveStatisticDao.ipActiveChart(beginDate, endDate); + List ipListTop10 = trafficIpActiveStatisticDao.ipActiveChart(beginDate, endDate,entranceId); if (ipListTop10 != null && ipListTop10.size() > 0) { StringBuilder ipStr = new StringBuilder(); for (LinkedHashMap map : ipListTop10) { @@ -559,13 +561,13 @@ public class DashboardService extends BaseService { } ArrayList ipInfoList = trafficIpActiveStatisticDao - .ipActiveFiveMinute(ipStr.toString(), beginDate, endDate); + .ipActiveFiveMinute(ipStr.toString(), beginDate, endDate,entranceId); // 存放每个IP,每个时间点的总数 Map ipCountListMap = new HashMap(); int index = 0; for (int i = 0; i < dateRangeList.size(); i++) { // 存放一个时间点中每个IP的总数 - Map ipCountMap = new HashMap(); + Map ipCountMap = new TreeMap(); Date date = dateRangeList.get(i); for (int j = index; j < ipInfoList.size(); j++) { TrafficIpActiveStatistic ipInfo = ipInfoList.get(j); @@ -627,18 +629,18 @@ public class DashboardService extends BaseService { * * @return */ - public List ipActiveOneHour(Date beginDate, Date endDate) { + public List ipActiveOneHour(Date beginDate, Date endDate,Integer entranceId) { // TrafficIpActiveStatistic maxStatTime = trafficIpActiveStatisticDao.getMaxStatTime(); ArrayList listMap = new ArrayList(); // if (maxStatTime != null && maxStatTime.getStatTime() != null) { // Date statTime = maxStatTime.getStatTime(); - ArrayList list = trafficIpActiveStatisticDao.ipActiveChart(beginDate, endDate); + ArrayList list = trafficIpActiveStatisticDao.ipActiveChart(beginDate, endDate,entranceId); if (list != null && list.size() > 0) { for (LinkedHashMap map : list) { if (map.get("ipAddr") != null) { String ipAddr = (String) map.get("ipAddr"); - HashMap resMap = trafficIpActiveStatisticDao.ipActiveOneHour(ipAddr, beginDate, endDate); + HashMap resMap = trafficIpActiveStatisticDao.ipActiveOneHour(ipAddr, beginDate, endDate,entranceId); if (resMap != null) { listMap.add(resMap); } @@ -664,7 +666,7 @@ public class DashboardService extends BaseService { ArrayList list = new ArrayList<>(); // if (maxStatTime != null && maxStatTime.getStatTime() != null) { // Date statTime = maxStatTime.getStatTime(); - list = trafficIpActiveStatisticDao.ipActiveChart(beginDate, endDate); + list = trafficIpActiveStatisticDao.ipActiveChart(beginDate, endDate,null); if (list != null && list.size() > 0) { for (LinkedHashMap map : list) { if (map.get("ipAddr") != null) { @@ -704,12 +706,12 @@ public class DashboardService extends BaseService { * * @return */ - public List getProtocolList(String startTime, String endTime, Integer[] protoType) { + public List getProtocolList(String startTime, String endTime, Integer[] protoType,Integer entranceId) { // TrafficProtocolStatistic maxStatTime = trafficProtocolStatisticDao.getMaxStatTime(); List list = new ArrayList(); // if (maxStatTime != null && maxStatTime.getStatTime() != null) { // Date statTime = maxStatTime.getStatTime(); - list = trafficProtocolStatisticDao.getProtocolList(startTime, endTime, protoType); + list = trafficProtocolStatisticDao.getProtocolList(startTime, endTime, protoType,entranceId); // } return list; } @@ -740,12 +742,12 @@ public class DashboardService extends BaseService { * * @return */ - public List getAppList(String startTime, String endTime, Integer[] appType) { + public List getAppList(String startTime, String endTime, Integer[] appType,Integer entranceId) { // TrafficAppStatistic maxStatTime = trafficAppStatisticDao.getMaxStatTime(); List list = new ArrayList(); // if (maxStatTime != null && maxStatTime.getStatTime() != null) { // Date statTime = maxStatTime.getStatTime(); - list = trafficAppStatisticDao.getAppList(startTime, endTime, appType); + list = trafficAppStatisticDao.getAppList(startTime, endTime, appType,entranceId); // } return list; } @@ -1695,8 +1697,18 @@ public class DashboardService extends BaseService { } public List appConnRecordTop100(AppConnRecordStatistic entity) { + DecimalFormat df = new DecimalFormat("##.##"); List list = new ArrayList(); list = trafficAppStatisticDao.appConnRecordTop100(entity); + if (!StringUtil.isEmpty(list)) { + //统计总量 + AppConnRecordStatistic sum = trafficAppStatisticDao.appConnRecordTotal(entity).get(0); + for (AppConnRecordStatistic obj : list) { + obj.setBytePercent(df.format(obj.getByteNum()/sum.getByteNum()*100)); + obj.setPktPercent(df.format(obj.getPktNum()/sum.getPktNum()*100)); + obj.setLogPercent(df.format(obj.getLogNum()/sum.getLogNum()*100)); + } + } return list; } }