增加界面大屏图表服务接口
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
package com.nis.domain.restful.dashboard;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class TrafficAppStatistic {
|
||||
private Integer statId;
|
||||
|
||||
private Integer appType;
|
||||
|
||||
private Integer entranceId;
|
||||
|
||||
private Integer c2sPktNum;
|
||||
|
||||
private Integer s2cPktNum;
|
||||
|
||||
private Integer c2sByteLen;
|
||||
|
||||
private Integer s2cByteLen;
|
||||
|
||||
private Date statTime;
|
||||
|
||||
public Integer getStatId() {
|
||||
return statId;
|
||||
}
|
||||
|
||||
public void setStatId(Integer statId) {
|
||||
this.statId = statId;
|
||||
}
|
||||
|
||||
public Integer getAppType() {
|
||||
return appType;
|
||||
}
|
||||
|
||||
public void setAppType(Integer appType) {
|
||||
this.appType = appType;
|
||||
}
|
||||
|
||||
public Integer getEntranceId() {
|
||||
return entranceId;
|
||||
}
|
||||
|
||||
public void setEntranceId(Integer entranceId) {
|
||||
this.entranceId = entranceId;
|
||||
}
|
||||
|
||||
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 Date getStatTime() {
|
||||
return statTime;
|
||||
}
|
||||
|
||||
public void setStatTime(Date statTime) {
|
||||
this.statTime = statTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.nis.domain.restful.dashboard;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class TrafficHttpStatistic {
|
||||
private Integer statId;
|
||||
|
||||
private Integer webType;
|
||||
|
||||
private Integer webId;
|
||||
|
||||
private Integer c2sPktNum;
|
||||
|
||||
private Integer s2cPktNum;
|
||||
|
||||
private Integer c2sByteLen;
|
||||
|
||||
private Integer s2cByteLen;
|
||||
|
||||
private Date statTime;
|
||||
|
||||
// 自定义字段
|
||||
private Integer count;
|
||||
private Integer pktNum;
|
||||
private Integer byteLen;
|
||||
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public Integer getPktNum() {
|
||||
return pktNum;
|
||||
}
|
||||
|
||||
public void setPktNum(Integer pktNum) {
|
||||
this.pktNum = pktNum;
|
||||
}
|
||||
|
||||
public Integer getByteLen() {
|
||||
return byteLen;
|
||||
}
|
||||
|
||||
public void setByteLen(Integer byteLen) {
|
||||
this.byteLen = byteLen;
|
||||
}
|
||||
|
||||
public Integer getStatId() {
|
||||
return statId;
|
||||
}
|
||||
|
||||
public void setStatId(Integer statId) {
|
||||
this.statId = statId;
|
||||
}
|
||||
|
||||
public Integer getWebType() {
|
||||
return webType;
|
||||
}
|
||||
|
||||
public void setWebType(Integer webType) {
|
||||
this.webType = webType;
|
||||
}
|
||||
|
||||
public Integer getWebId() {
|
||||
return webId;
|
||||
}
|
||||
|
||||
public void setWebId(Integer webId) {
|
||||
this.webId = webId;
|
||||
}
|
||||
|
||||
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 Date getStatTime() {
|
||||
return statTime;
|
||||
}
|
||||
|
||||
public void setStatTime(Date statTime) {
|
||||
this.statTime = statTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.nis.domain.restful.dashboard;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.nis.domain.BaseEntity;
|
||||
|
||||
public class TrafficIpActiveStatistic extends BaseEntity<TrafficIpActiveStatistic> {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -9198831010652509505L;
|
||||
|
||||
private Integer statId;
|
||||
|
||||
private String ipAddr;
|
||||
|
||||
private Integer areaId;
|
||||
|
||||
private Integer linkNum;
|
||||
|
||||
private Integer c2sPktNum;
|
||||
|
||||
private Integer s2cPktNum;
|
||||
|
||||
private Integer c2sByteLen;
|
||||
|
||||
private Integer s2cByteLen;
|
||||
|
||||
private Date statTime;
|
||||
|
||||
public Integer getStatId() {
|
||||
return statId;
|
||||
}
|
||||
|
||||
public void setStatId(Integer statId) {
|
||||
this.statId = statId;
|
||||
}
|
||||
|
||||
public String getIpAddr() {
|
||||
return ipAddr;
|
||||
}
|
||||
|
||||
public void setIpAddr(String ipAddr) {
|
||||
this.ipAddr = ipAddr == null ? null : ipAddr.trim();
|
||||
}
|
||||
|
||||
public Integer getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(Integer 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 Date getStatTime() {
|
||||
return statTime;
|
||||
}
|
||||
|
||||
public void setStatTime(Date statTime) {
|
||||
this.statTime = statTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TrafficIpActiveStatistic [statId=" + statId + ", ipAddr=" + ipAddr + ", areaId=" + areaId + ", linkNum="
|
||||
+ linkNum + ", c2sPktNum=" + c2sPktNum + ", s2cPktNum=" + s2cPktNum + ", c2sByteLen=" + c2sByteLen
|
||||
+ ", s2cByteLen=" + s2cByteLen + ", statTime=" + statTime + "]";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.nis.domain.restful.dashboard;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class TrafficProtocolStatistic {
|
||||
private Integer statId;
|
||||
|
||||
private Integer protoType;
|
||||
|
||||
private Integer entranceId;
|
||||
|
||||
private Integer c2sPktNum;
|
||||
|
||||
private Integer s2cPktNum;
|
||||
|
||||
private Integer c2sByteLen;
|
||||
|
||||
private Integer s2cByteLen;
|
||||
|
||||
private Date statTime;
|
||||
|
||||
public Integer getStatId() {
|
||||
return statId;
|
||||
}
|
||||
|
||||
public void setStatId(Integer statId) {
|
||||
this.statId = statId;
|
||||
}
|
||||
|
||||
public Integer getProtoType() {
|
||||
return protoType;
|
||||
}
|
||||
|
||||
public void setProtoType(Integer protoType) {
|
||||
this.protoType = protoType;
|
||||
}
|
||||
|
||||
public Integer getEntranceId() {
|
||||
return entranceId;
|
||||
}
|
||||
|
||||
public void setEntranceId(Integer entranceId) {
|
||||
this.entranceId = entranceId;
|
||||
}
|
||||
|
||||
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 Date getStatTime() {
|
||||
return statTime;
|
||||
}
|
||||
|
||||
public void setStatTime(Date statTime) {
|
||||
this.statTime = statTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.nis.domain.restful.dashboard;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class TrafficUaStatistic {
|
||||
private Integer statId;
|
||||
|
||||
private Integer bsType;
|
||||
private Integer osType;
|
||||
|
||||
private Integer entranceId;
|
||||
|
||||
private Integer c2sPktNum;
|
||||
|
||||
private Integer s2cPktNum;
|
||||
|
||||
private Integer c2sByteLen;
|
||||
|
||||
private Integer s2cByteLen;
|
||||
|
||||
private Date statTime;
|
||||
|
||||
// 自定义字段
|
||||
private Integer count;
|
||||
private Integer pktNum;
|
||||
private Integer byteLen;
|
||||
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public Integer getPktNum() {
|
||||
return pktNum;
|
||||
}
|
||||
|
||||
public void setPktNum(Integer pktNum) {
|
||||
this.pktNum = pktNum;
|
||||
}
|
||||
|
||||
public Integer getByteLen() {
|
||||
return byteLen;
|
||||
}
|
||||
|
||||
public void setByteLen(Integer byteLen) {
|
||||
this.byteLen = byteLen;
|
||||
}
|
||||
|
||||
public Integer getOsType() {
|
||||
return osType;
|
||||
}
|
||||
|
||||
public void setOsType(Integer osType) {
|
||||
this.osType = osType;
|
||||
}
|
||||
|
||||
public Integer getStatId() {
|
||||
return statId;
|
||||
}
|
||||
|
||||
public void setStatId(Integer statId) {
|
||||
this.statId = statId;
|
||||
}
|
||||
|
||||
public Integer getBsType() {
|
||||
return bsType;
|
||||
}
|
||||
|
||||
public void setBsType(Integer bsType) {
|
||||
this.bsType = bsType;
|
||||
}
|
||||
|
||||
public Integer getEntranceId() {
|
||||
return entranceId;
|
||||
}
|
||||
|
||||
public void setEntranceId(Integer entranceId) {
|
||||
this.entranceId = entranceId;
|
||||
}
|
||||
|
||||
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 Date getStatTime() {
|
||||
return statTime;
|
||||
}
|
||||
|
||||
public void setStatTime(Date statTime) {
|
||||
this.statTime = statTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
package com.nis.web.controller.restful;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.nis.restful.RestServiceException;
|
||||
import com.nis.util.Constants;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.nis.util.JsonMapper;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.controller.BaseRestController;
|
||||
import com.nis.web.service.SaveRequestLogThread;
|
||||
import com.nis.web.service.ServicesRequestLogService;
|
||||
import com.nis.web.service.restful.DashboardService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "${servicePath}/log/v1")
|
||||
@Api(value = "DashboardServiceController", description = "统计分析图表基本服务接口")
|
||||
public class DashboardServiceController extends BaseRestController {
|
||||
|
||||
@Autowired
|
||||
protected ServicesRequestLogService servicesRequestLogService;
|
||||
@Autowired
|
||||
public DashboardService dashboardService;
|
||||
|
||||
/**
|
||||
* 协议统计
|
||||
*/
|
||||
@RequestMapping(value="trafficProtocol", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "协议统计", httpMethod = "GET", notes = "对应协议统计实时统计查询服务。")
|
||||
public Map<String,?> trafficProtocol(Model model, HttpServletRequest request, HttpServletResponse response){
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<HashMap> list = new ArrayList<HashMap>();
|
||||
try {
|
||||
List<Map> ipActiveChart = dashboardService.protocolChart();
|
||||
if (ipActiveChart.size() > 0) {
|
||||
String jsonString = JsonMapper.toJsonString(ipActiveChart);
|
||||
list = (java.util.List<HashMap>) JsonMapper.fromJsonList(jsonString,HashMap.class);
|
||||
logger.info(list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "协议统计图表数据检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "IP地址日志检索成功",
|
||||
list, 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 活跃IP TOP10
|
||||
*/
|
||||
@RequestMapping(value = "trafficIpActive", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "活跃IP统计", httpMethod = "GET", notes = "对应活跃IP实时统计查询服务。")
|
||||
public Map<String,?> trafficIpActive(Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<LinkedHashMap> list = new ArrayList<LinkedHashMap>();
|
||||
try {
|
||||
List<LinkedHashMap> ipActiveChart = dashboardService.ipActiveChart();
|
||||
if (ipActiveChart.size() > 0) {
|
||||
list = ipActiveChart;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "活跃IP实时统计数据检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "活跃IP实时统计数据检索成功",list, 0);
|
||||
}
|
||||
/**
|
||||
* app流量分析 TOP10
|
||||
*/
|
||||
@RequestMapping(value = "trafficApp", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "app流量分析统计", httpMethod = "GET", notes = "对应app流量分析实时统计查询服务。")
|
||||
public Map<String, ?> trafficApp(Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
try {
|
||||
List<Map> appChart = dashboardService.appChart();
|
||||
if (appChart.size() > 0) {
|
||||
list = appChart;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "App流量统计数据检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "App流量统计数据检索成功",list, 0);
|
||||
}
|
||||
@RequestMapping(value = "trafficOsList", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "操作系统流量分析统计", httpMethod = "GET", notes = "对应终端用户的操作系统列表显示")
|
||||
public Map<String,?> trafficOsList(Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
try {
|
||||
List<Map> osChart = dashboardService.systemList();
|
||||
if (osChart.size() > 0) {
|
||||
list = osChart;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "操作系统流量分析统计检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "操作系统流量分析统计检索成功",list, 0);
|
||||
}
|
||||
@RequestMapping(value = "trafficBrowserChart", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "操作系统下浏览器流量分析统计", httpMethod = "GET", notes = "对应终端用户某个操作系统的浏览器分类统计显示")
|
||||
public Map<String, ?> trafficBrowserChart(Integer osType,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
try {
|
||||
List<Map> osChart = dashboardService.getBrowserBySystem(osType);
|
||||
if (osChart.size() > 0) {
|
||||
list=osChart;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "操作系统下浏览器分类统计数据检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "操作系统下浏览器分类统计数据检索成功",list, 0);
|
||||
}
|
||||
@RequestMapping(value = "trafficBsList", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "浏览器流量分析统计", httpMethod = "GET", notes = "对应终端用户的浏览器列表显示")
|
||||
public Map<String, ?> trafficBsList(Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
try {
|
||||
List<Map> bsChart = dashboardService.browserList();
|
||||
if (bsChart.size() > 0) {
|
||||
list = bsChart;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "浏览器流量分析统计数据检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "浏览器流量分析统计数据检索成功",list, 0);
|
||||
}
|
||||
@RequestMapping(value = "trafficSystemChart", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "浏览器下操作系统流量分析统计", httpMethod = "GET", notes = "对应终端用户某个浏览器的操作系统分类统计显示")
|
||||
public Map<String,?> trafficSystemChart(Integer bsType,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
try {
|
||||
List<Map> bsChart = dashboardService.getSystemBybrowser(bsType);
|
||||
if (bsChart.size() > 0) {
|
||||
list = bsChart;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "浏览器下操作系统流量统计数据检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "浏览器下操作系统流量统计数据检索成功",list, 0);
|
||||
}
|
||||
@RequestMapping(value = "trafficWebsiteList", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "网站流量分析统计", httpMethod = "GET", notes = "对应网站http分类显示")
|
||||
public Map<String,?> trafficWebsiteList(Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
try {
|
||||
List<Map> websiteChart = dashboardService.websiteList();
|
||||
if (websiteChart.size() > 0) {
|
||||
list = websiteChart;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "网站流量分析统计数据检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "网站流量分析统计数据检索成功",list, 0);
|
||||
}
|
||||
@RequestMapping(value = "trafficWebTypeChart", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "http网站分类分析统计", httpMethod = "GET", notes = "对应某个网站类型分类统计图")
|
||||
public Map<String, ?> trafficWebTypeChart(Integer webId,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
try {
|
||||
List<Map> websiteChart = dashboardService.getTypeBywebsite(webId);
|
||||
if (websiteChart.size() > 0) {
|
||||
list = websiteChart;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "http网站分类分析数据检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "http网站分类分析数据检索成功",list, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.nis.web.dao.dashboard;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface TrafficAppStatisticDao {
|
||||
|
||||
List<Map> appChart();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nis.web.dao.dashboard.TrafficAppStatisticDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficAppStatistic">
|
||||
<id column="stat_id" jdbcType="INTEGER" property="statId" />
|
||||
<result column="app_type" jdbcType="INTEGER" property="appType" />
|
||||
<result column="entrance_id" jdbcType="INTEGER" property="entranceId" />
|
||||
<result column="c2s_pkt_num" jdbcType="INTEGER" property="c2sPktNum" />
|
||||
<result column="s2c_pkt_num" jdbcType="INTEGER" property="s2cPktNum" />
|
||||
<result column="c2s_byte_len" jdbcType="INTEGER" property="c2sByteLen" />
|
||||
<result column="s2c_byte_len" jdbcType="INTEGER" property="s2cByteLen" />
|
||||
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
stat_id, app_type, entrance_id, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
|
||||
stat_time
|
||||
</sql>
|
||||
<select id="appChart" resultType="java.util.HashMap">
|
||||
SELECT app_type appType, count(app_type) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_app_statistic
|
||||
WHERE app_type !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY app_type limit 0,10
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.nis.web.dao.dashboard;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.restful.dashboard.TrafficHttpStatistic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface TrafficHttpStatisticDao {
|
||||
List<TrafficHttpStatistic> websiteList();
|
||||
|
||||
List<Map> getTypeBywebsite(@Param("webId") Integer webId);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nis.web.dao.dashboard.TrafficHttpStatisticDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficHttpStatistic">
|
||||
<id column="stat_id" jdbcType="INTEGER" property="statId" />
|
||||
<result column="web_type" jdbcType="INTEGER" property="webType" />
|
||||
<result column="web_id" jdbcType="INTEGER" property="webId" />
|
||||
<result column="c2s_pkt_num" jdbcType="INTEGER" property="c2sPktNum" />
|
||||
<result column="s2c_pkt_num" jdbcType="INTEGER" property="s2cPktNum" />
|
||||
<result column="c2s_byte_len" jdbcType="INTEGER" property="c2sByteLen" />
|
||||
<result column="s2c_byte_len" jdbcType="INTEGER" property="s2cByteLen" />
|
||||
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
stat_id, web_type, web_id, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
|
||||
stat_time
|
||||
</sql>
|
||||
<!--获取网站列表列表 -->
|
||||
<select id="websiteList" resultMap="BaseResultMap">
|
||||
SELECT web_id webId, count(web_id) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_http_statistic
|
||||
WHERE web_id !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY web_id ORDER BY count DESC limit 0,10
|
||||
</select>
|
||||
<!-- 根据网站分类 -->
|
||||
<select id="getTypeBywebsite" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
SELECT web_type webType, count(web_type) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_http_statistic
|
||||
WHERE web_type !=0 and web_id=#{webId} and stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY web_type limit 0,10
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.nis.web.dao.dashboard;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.restful.dashboard.TrafficIpActiveStatistic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface TrafficIpActiveStatisticDao {
|
||||
|
||||
List<TrafficIpActiveStatistic> getList(TrafficIpActiveStatistic trafficIpActiveStatistic);
|
||||
|
||||
ArrayList<LinkedHashMap> ipActiveChart();
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nis.web.dao.dashboard.TrafficIpActiveStatisticDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficIpActiveStatistic">
|
||||
<id column="stat_id" jdbcType="INTEGER" property="statId" />
|
||||
<result column="ip_addr" jdbcType="VARCHAR" property="ipAddr" />
|
||||
<result column="area_id" jdbcType="INTEGER" property="areaId" />
|
||||
<result column="link_num" jdbcType="INTEGER" property="linkNum" />
|
||||
<result column="c2s_pkt_num" jdbcType="INTEGER" property="c2sPktNum" />
|
||||
<result column="s2c_pkt_num" jdbcType="INTEGER" property="s2cPktNum" />
|
||||
<result column="c2s_byte_len" jdbcType="INTEGER" property="c2sByteLen" />
|
||||
<result column="s2c_byte_len" jdbcType="INTEGER" property="s2cByteLen" />
|
||||
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
stat_id, ip_addr, area_id, link_num, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
|
||||
stat_time
|
||||
</sql>
|
||||
<!-- 活跃IPTOP列表 -->
|
||||
<select id="getList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from galaxy.traffic_ip_active_statistic
|
||||
</select>
|
||||
|
||||
<!-- IP流量统计-->
|
||||
<select id="ipActiveChart" resultType="java.util.LinkedHashMap">
|
||||
SELECT ip_addr ipAddr, SUM(link_num) linkNum ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ip_active_statistic
|
||||
WHERE stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY ip_addr ORDER BY link_num DESC limit 0,10
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.nis.web.dao.dashboard;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface TrafficProtocolStatisticDao {
|
||||
|
||||
List<Map> protocolChart();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nis.web.dao.dashboard.TrafficProtocolStatisticDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficProtocolStatistic">
|
||||
<id column="stat_id" jdbcType="INTEGER" property="statId" />
|
||||
<result column="proto_type" jdbcType="INTEGER" property="protoType" />
|
||||
<result column="entrance_id" jdbcType="INTEGER" property="entranceId" />
|
||||
<result column="c2s_pkt_num" jdbcType="INTEGER" property="c2sPktNum" />
|
||||
<result column="s2c_pkt_num" jdbcType="INTEGER" property="s2cPktNum" />
|
||||
<result column="c2s_byte_len" jdbcType="INTEGER" property="c2sByteLen" />
|
||||
<result column="s2c_byte_len" jdbcType="INTEGER" property="s2cByteLen" />
|
||||
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
stat_id, proto_type, entrance_id, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
|
||||
stat_time
|
||||
</sql>
|
||||
<select id="protocolChart" resultType="java.util.HashMap">
|
||||
SELECT proto_type protoType, count(proto_type) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_protocol_statistic
|
||||
WHERE proto_type!=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY proto_type limit 0,10
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.nis.web.dao.dashboard;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.restful.dashboard.TrafficUaStatistic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface TrafficUaStatisticDao {
|
||||
|
||||
List<TrafficUaStatistic> systemList();
|
||||
|
||||
List<Map> getBrowserBySystem(@Param("osType") Integer osType);
|
||||
|
||||
List<TrafficUaStatistic> browserList();
|
||||
|
||||
List<Map> getSystemBybrowser(@Param("bsType") Integer bsType);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nis.web.dao.dashboard.TrafficUaStatisticDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficUaStatistic">
|
||||
<id column="stat_id" jdbcType="INTEGER" property="statId" />
|
||||
<result column="bs_type" jdbcType="INTEGER" property="bsType" />
|
||||
<result column="os_type" jdbcType="INTEGER" property="osType" />
|
||||
<result column="entrance_id" jdbcType="INTEGER" property="entranceId" />
|
||||
<result column="c2s_pkt_num" jdbcType="INTEGER" property="c2sPktNum" />
|
||||
<result column="s2c_pkt_num" jdbcType="INTEGER" property="s2cPktNum" />
|
||||
<result column="c2s_byte_len" jdbcType="INTEGER" property="c2sByteLen" />
|
||||
<result column="s2c_byte_len" jdbcType="INTEGER" property="s2cByteLen" />
|
||||
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
stat_id, bs_type,os_type, entrance_id, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
|
||||
stat_time
|
||||
</sql>
|
||||
<!--获取操作系统列表 -->
|
||||
<select id="systemList" resultMap="BaseResultMap">
|
||||
SELECT os_type osType, count(os_type) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
|
||||
WHERE os_type !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY os_type ORDER BY count DESC limit 0,10
|
||||
</select>
|
||||
<!-- 根据操作系统获取浏览器分类 -->
|
||||
<select id="getBrowserBySystem" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
SELECT bs_type bsType, count(bs_type) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
|
||||
WHERE bs_type !=0 and os_type=#{osType} and stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY bs_type limit 0,10
|
||||
</select>
|
||||
<!--获取浏览器列表 -->
|
||||
<select id="browserList" resultMap="BaseResultMap">
|
||||
SELECT bs_type bsType, count(bs_type) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
|
||||
WHERE bs_type !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY bs_type ORDER BY count DESC limit 0,10
|
||||
</select>
|
||||
<!-- 根据浏览器获取操作系统分类 -->
|
||||
<select id="getSystemBybrowser" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
SELECT os_type osType, count(os_type) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
|
||||
WHERE os_type !=0 and bs_type=#{bsType} and stat_time >= DATE_SUB(NOW(),INTERVAL 555 HOUR)
|
||||
GROUP BY os_type limit 0,10
|
||||
</select>
|
||||
</mapper>
|
||||
118
src/main/java/com/nis/web/service/restful/DashboardService.java
Normal file
118
src/main/java/com/nis/web/service/restful/DashboardService.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.dashboard.TrafficHttpStatistic;
|
||||
import com.nis.domain.restful.dashboard.TrafficIpActiveStatistic;
|
||||
import com.nis.domain.restful.dashboard.TrafficUaStatistic;
|
||||
import com.nis.web.dao.dashboard.TrafficAppStatisticDao;
|
||||
import com.nis.web.dao.dashboard.TrafficHttpStatisticDao;
|
||||
import com.nis.web.dao.dashboard.TrafficIpActiveStatisticDao;
|
||||
import com.nis.web.dao.dashboard.TrafficProtocolStatisticDao;
|
||||
import com.nis.web.dao.dashboard.TrafficUaStatisticDao;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@Service
|
||||
public class DashboardService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
public TrafficIpActiveStatisticDao trafficIpActiveStatisticDao;
|
||||
@Autowired
|
||||
public TrafficProtocolStatisticDao trafficProtocolStatisticDao;
|
||||
@Autowired
|
||||
public TrafficAppStatisticDao trafficAppStatisticDao;
|
||||
@Autowired
|
||||
public TrafficUaStatisticDao trafficUaStatisticDao;
|
||||
@Autowired
|
||||
public TrafficHttpStatisticDao trafficHttpStatisticDao;
|
||||
|
||||
/**
|
||||
* 分页查询活跃IPtop100
|
||||
* @return
|
||||
*/
|
||||
public Page<TrafficIpActiveStatistic> getList(Page<TrafficIpActiveStatistic> page,TrafficIpActiveStatistic entry){
|
||||
// 设置分页参数
|
||||
entry.setPage(page);
|
||||
// 执行分页查询
|
||||
page.setList(trafficIpActiveStatisticDao.getList(entry));
|
||||
return page;
|
||||
}
|
||||
|
||||
public List<LinkedHashMap> ipActiveChart(){
|
||||
|
||||
ArrayList<LinkedHashMap> list = trafficIpActiveStatisticDao.ipActiveChart();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Map> protocolChart() {
|
||||
List<Map> list = trafficProtocolStatisticDao.protocolChart();
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Map> appChart() {
|
||||
List<Map> list = trafficAppStatisticDao.appChart();
|
||||
return list;
|
||||
}
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public List<Map> systemList(){
|
||||
List<Map> result = new ArrayList<Map>();
|
||||
List<TrafficUaStatistic> list = trafficUaStatisticDao.systemList();
|
||||
for (TrafficUaStatistic ua : list) {
|
||||
Map map = new HashMap();
|
||||
map.put("osType",ua.getOsType());
|
||||
map.put("count",ua.getCount());
|
||||
map.put("pktNum",ua.getPktNum());
|
||||
map.put("byteLen",ua.getByteLen());
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public List<Map> getBrowserBySystem(Integer osType ){
|
||||
List<Map> list = trafficUaStatisticDao.getBrowserBySystem(osType);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Map> browserList() {
|
||||
List<Map> result = new ArrayList<Map>();
|
||||
List<TrafficUaStatistic> list = trafficUaStatisticDao.browserList();
|
||||
for (TrafficUaStatistic ua : list) {
|
||||
Map map = new HashMap();
|
||||
map.put("bsType",ua.getBsType());
|
||||
map.put("count",ua.getCount());
|
||||
map.put("pktNum",ua.getPktNum());
|
||||
map.put("byteLen",ua.getByteLen());
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public List<Map> getSystemBybrowser(Integer bsType ){
|
||||
List<Map> list = trafficUaStatisticDao.getSystemBybrowser(bsType);
|
||||
return list;
|
||||
}
|
||||
public List<Map> websiteList() {
|
||||
List<Map> result = new ArrayList<Map>();
|
||||
List<TrafficHttpStatistic> list = trafficHttpStatisticDao.websiteList();
|
||||
for (TrafficHttpStatistic website : list) {
|
||||
Map map = new HashMap();
|
||||
map.put("webId",website.getWebId());
|
||||
map.put("count",website.getCount());
|
||||
map.put("pktNum",website.getPktNum());
|
||||
map.put("byteLen",website.getByteLen());
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public List<Map> getTypeBywebsite(Integer webId ){
|
||||
List<Map> list = trafficHttpStatisticDao.getTypeBywebsite(webId);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user