diff --git a/src/main/java/com/nis/domain/restful/dashboard/NtcTotalReport.java b/src/main/java/com/nis/domain/restful/dashboard/NtcTotalReport.java index 7c637e1..09875ec 100644 --- a/src/main/java/com/nis/domain/restful/dashboard/NtcTotalReport.java +++ b/src/main/java/com/nis/domain/restful/dashboard/NtcTotalReport.java @@ -5,16 +5,16 @@ import java.util.Date; public class NtcTotalReport { private Integer statId ;//int(11) NOT NULL AUTO_INCREMENT COMMENT id自增, - private Integer rejectNum ;//int(11) NOT NULL COMMENT 封堵数量, - private Integer monitorNum ;//int(11) NOT NULL COMMENT 监测数量, - private Integer c2sPktNum ;//int(11) DEFAULT NULL COMMENT c2s包数, - private Integer s2cPktNum ;//int(11) DEFAULT NULL COMMENT s2c包数, - private Integer c2sByteLen ;//int(11) NOT NULL COMMENT c2s字节数, - private Integer s2cByteLen ;//int(11) NOT NULL COMMENT s2c字节数, - private Integer newUniConnNum ;//int(11) DEFAULT NULL COMMENT 新建链接数, - private Integer liveConnNum ;//int(11) DEFAULT NULL COMMENT 活跃链接数, - private Integer dropConnNum ;//int(11) DEFAULT NULL COMMENT 丢弃链接数, - private Integer loopConnNum ;//int(11) DEFAULT NULL COMMENT 回流链接数, + private Long rejectNum ;//int(11) NOT NULL COMMENT 封堵数量, + private Long monitorNum ;//int(11) NOT NULL COMMENT 监测数量, + private Long c2sPktNum ;//int(11) DEFAULT NULL COMMENT c2s包数, + private Long s2cPktNum ;//int(11) DEFAULT NULL COMMENT s2c包数, + private Long c2sByteLen ;//int(11) NOT NULL COMMENT c2s字节数, + private Long s2cByteLen ;//int(11) NOT NULL COMMENT s2c字节数, + private Long newUniConnNum ;//int(11) DEFAULT NULL COMMENT 新建链接数, + private Long liveConnNum ;//int(11) DEFAULT NULL COMMENT 活跃链接数, + private Long dropConnNum ;//int(11) DEFAULT NULL COMMENT 丢弃链接数, + private Long loopConnNum ;//int(11) DEFAULT NULL COMMENT 回流链接数, private Date reportTime ;//datetime NOT NULL COMMENT 统计时间, public Integer getStatId() { @@ -23,64 +23,65 @@ public class NtcTotalReport { public void setStatId(Integer statId) { this.statId = statId; } - public Integer getRejectNum() { + + public Long getRejectNum() { return rejectNum; } - public void setRejectNum(Integer rejectNum) { + public void setRejectNum(Long rejectNum) { this.rejectNum = rejectNum; } - public Integer getMonitorNum() { + public Long getMonitorNum() { return monitorNum; } - public void setMonitorNum(Integer monitorNum) { + public void setMonitorNum(Long monitorNum) { this.monitorNum = monitorNum; } - public Integer getC2sPktNum() { + public Long getC2sPktNum() { return c2sPktNum; } - public void setC2sPktNum(Integer c2sPktNum) { + public void setC2sPktNum(Long c2sPktNum) { this.c2sPktNum = c2sPktNum; } - public Integer getS2cPktNum() { + public Long getS2cPktNum() { return s2cPktNum; } - public void setS2cPktNum(Integer s2cPktNum) { + public void setS2cPktNum(Long s2cPktNum) { this.s2cPktNum = s2cPktNum; } - public Integer getC2sByteLen() { + public Long getC2sByteLen() { return c2sByteLen; } - public void setC2sByteLen(Integer c2sByteLen) { + public void setC2sByteLen(Long c2sByteLen) { this.c2sByteLen = c2sByteLen; } - public Integer getS2cByteNen() { + public Long getS2cByteLen() { return s2cByteLen; } - public void setS2cByteNen(Integer s2cByteLen) { + public void setS2cByteLen(Long s2cByteLen) { this.s2cByteLen = s2cByteLen; } - public Integer getNewUniConnNum() { + public Long getNewUniConnNum() { return newUniConnNum; } - public void setNewUniConnNum(Integer newUniConnNum) { + public void setNewUniConnNum(Long newUniConnNum) { this.newUniConnNum = newUniConnNum; } - public Integer getLiveConnNum() { + public Long getLiveConnNum() { return liveConnNum; } - public void setLiveConnNum(Integer liveConnNum) { + public void setLiveConnNum(Long liveConnNum) { this.liveConnNum = liveConnNum; } - public Integer getDropConnNum() { + public Long getDropConnNum() { return dropConnNum; } - public void setDropConnNum(Integer dropConnNum) { + public void setDropConnNum(Long dropConnNum) { this.dropConnNum = dropConnNum; } - public Integer getLoopConnNum() { + public Long getLoopConnNum() { return loopConnNum; } - public void setLoopConnNum(Integer loopConnNum) { + public void setLoopConnNum(Long loopConnNum) { this.loopConnNum = loopConnNum; } public Date getReportTime() { diff --git a/src/main/java/com/nis/domain/restful/dashboard/TrafficTransStatistic.java b/src/main/java/com/nis/domain/restful/dashboard/TrafficTransStatistic.java new file mode 100644 index 0000000..1969988 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/dashboard/TrafficTransStatistic.java @@ -0,0 +1,100 @@ +package com.nis.domain.restful.dashboard; +import java.util.Date; + +public class TrafficTransStatistic { + + private Integer statId ; + private String addrType ; + private Integer transType ; + private Integer entranceId ; + private Long linkNum; + private Long c2sPktNum ; + private Long s2cPktNum ; + private Long c2sByteLen ; + private Long s2cByteLen ; + private Date statTime ; + + private String time; + private Long pps; + private Long gbps; + + public Long getPps() { + return pps; + } + public void setPps(Long pps) { + this.pps = pps; + } + public Long getGbps() { + return gbps; + } + public void setGbps(Long gbps) { + this.gbps = gbps; + } + public String getTime() { + return time; + } + public void setTime(String time) { + this.time = time; + } + public Long getLinkNum() { + return linkNum; + } + public void setLinkNum(Long linkNum) { + this.linkNum = linkNum; + } + public Integer getStatId() { + return statId; + } + public void setStatId(Integer statId) { + this.statId = statId; + } + public String getAddrType() { + return addrType; + } + public void setAddrType(String addrType) { + this.addrType = addrType; + } + public Integer getTransType() { + return transType; + } + public void setTransType(Integer transType) { + this.transType = transType; + } + public Integer getEntranceId() { + return entranceId; + } + public void setEntranceId(Integer entranceId) { + this.entranceId = entranceId; + } + public Long getC2sPktNum() { + return c2sPktNum; + } + public void setC2sPktNum(Long c2sPktNum) { + this.c2sPktNum = c2sPktNum; + } + public Long getS2cPktNum() { + return s2cPktNum; + } + public void setS2cPktNum(Long s2cPktNum) { + this.s2cPktNum = s2cPktNum; + } + public Long getC2sByteLen() { + return c2sByteLen; + } + public void setC2sByteLen(Long c2sByteLen) { + this.c2sByteLen = c2sByteLen; + } + public Long getS2cByteLen() { + return s2cByteLen; + } + public void setS2cByteLen(Long s2cByteLen) { + this.s2cByteLen = s2cByteLen; + } + public Date getStatTime() { + return statTime; + } + public void setStatTime(Date statTime) { + this.statTime = statTime; + } + +} 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 b979af3..b9ba56f 100644 --- a/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java +++ b/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java @@ -61,6 +61,30 @@ public class DashboardServiceController extends BaseRestController { } return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "业务总量汇聚实时统计数据检索成功",list, 0); } + /** + * 根据ip46,协议tcp,udp查询带宽 + */ + @RequestMapping(value = "trafficBandwidthTrans", method = RequestMethod.GET) + @ApiOperation(value = "带宽根据ip46,协议tcp,udp查询详情", httpMethod = "GET", notes = "对应带宽根据IPv4,6,协议tcp,udp统计数据显示") + public Map trafficBandwidthTrans(String addrType,Integer transType,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 resultList = dashboardService.getBandwidthTrans(addrType, transType); + if (resultList!=null&&resultList.size() > 0) { + list = resultList; + } + } catch (Exception e) { + e.printStackTrace(); + auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause()); + logger.error("带宽实时统计数据检索失败"+ExceptionUtil.getExceptionMsg(e)); + throw new ServiceRuntimeException(auditLogThread, System.currentTimeMillis() - start, + "带宽实时统计数据检索失败:" + e.getMessage(), RestBusinessCode.service_runtime_error.getValue()); + } + return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "带宽实时统计数据检索成功",list, 0); + } /** * 流量统计活跃端口统计 */ diff --git a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.java b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.java index 77aad6a..9940e19 100644 --- a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.java +++ b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.java @@ -7,12 +7,13 @@ import java.util.Map; import org.apache.ibatis.annotations.Param; import com.nis.domain.restful.dashboard.NtcTotalReport; +import com.nis.domain.restful.dashboard.TrafficTransStatistic; import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface NtcTotalReportDao { NtcTotalReport getMaxReportTime(); - Map getMaxRecvTime(); + Map getMaxStatTime(); List getTotalReportList(@Param("reportTime") Date reportTime); List getNetFlowPortInfoNew(@Param("statTime") Date statTime); -// List getNetFlowPortInfoOld(@Param("recvTime") Date recvTime); + List getBandwidthTrans(@Param("statTime") Date statTime,@Param("addrType") String addrType,@Param("transType") Integer transType); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml index 5ce1cb7..b9bf41c 100644 --- a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml @@ -1,41 +1,64 @@ - - - + + + - - + + + + + + - - + + + \ 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 0989949..bd5bf13 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml @@ -35,11 +35,11 @@