Merge branch 'develop' of https://git.mesalab.cn/galaxy/galaxy-service.git into develop
This commit is contained in:
@@ -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<String, ?> trafficProtocolList(Integer[] protoType,String beginDate, String endDate, Model model, HttpServletRequest request,
|
||||
public Map<String, ?> 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<HashMap> list = new ArrayList<HashMap>();
|
||||
try {
|
||||
List<Map> ipActiveList = dashboardService.getProtocolList(beginDate, endDate,protoType);
|
||||
List<Map> ipActiveList = dashboardService.getProtocolList(beginDate, endDate,protoType,entranceId);
|
||||
if (ipActiveList != null && ipActiveList.size() > 0) {
|
||||
String jsonString = JsonMapper.toJsonString(ipActiveList);
|
||||
list = (java.util.List<HashMap>) 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<String, ?> trafficIpActiveOneHour(String beginDate, String endDate, Model model,
|
||||
public Map<String, ?> 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<HashMap> ipActiveChart = dashboardService.ipActiveOneHour(begin, end);
|
||||
List<HashMap> 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<String, ?> trafficIpActiveFiveMinute(String beginDate, String endDate, Model model,
|
||||
public Map<String, ?> 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<Map> ipActiveChart = dashboardService.ipActiveFiveMinute(begin, end);
|
||||
List<Map> 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<String, ?> trafficAppList(Integer[] appType, String beginDate, String endDate, Model model,
|
||||
public Map<String, ?> 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<HashMap> list = new ArrayList<HashMap>();
|
||||
try {
|
||||
List<Map> appList = dashboardService.getAppList(beginDate, endDate, appType);
|
||||
List<Map> appList = dashboardService.getAppList(beginDate, endDate, appType,entranceId);
|
||||
if (appList != null && appList.size() > 0) {
|
||||
String jsonString = JsonMapper.toJsonString(appList);
|
||||
list = (java.util.List<HashMap>) JsonMapper.fromJsonList(jsonString, HashMap.class);
|
||||
|
||||
@@ -14,7 +14,8 @@ public interface TrafficAppStatisticDao {
|
||||
|
||||
TrafficAppStatistic getMaxStatTime();
|
||||
List<Map> appChart(@Param("statTime")Date statTime);
|
||||
List<Map> getAppList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("appType")Integer[] appType);
|
||||
List<Map> getAppList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("appType")Integer[] appType,@Param("entranceId")Integer entranceId);
|
||||
List<TrafficAppFocusStatistic> getAppTrend(TrafficAppFocusStatistic entity);
|
||||
List<AppConnRecordStatistic> appConnRecordTop100(AppConnRecordStatistic entity);
|
||||
List<AppConnRecordStatistic> appConnRecordTotal(AppConnRecordStatistic entity);
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
<select id="getAppList" resultType="java.util.HashMap">
|
||||
SELECT IFNULL(c.app_name,p.app_type) appName,p.app_type appType,p.link_num linkNum, p.packets packets, p.GByte GByte FROM (
|
||||
SELECT app_type,SUM(link_num) AS link_num,SUM(c2s_pkt_num+s2c_pkt_num) AS packets,
|
||||
((SUM(c2s_byte_len+s2c_byte_len)*8)/300/1024/1024/1024) AS GByte
|
||||
((SUM(c2s_byte_len+s2c_byte_len))/1024/1024/1024) AS GByte
|
||||
FROM traffic_app_statistic WHERE
|
||||
<![CDATA[ stat_time>= #{beginTime} and stat_time< #{endTime}]]>
|
||||
<if test="appType!=null">
|
||||
@@ -39,6 +39,9 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="entranceId !=null">
|
||||
and entrance_id=#{entranceId}
|
||||
</if>
|
||||
GROUP BY app_type ) p
|
||||
LEFT JOIN ui_code_app_dic c ON p.app_type=c.view_code ORDER BY p.GByte DESC
|
||||
</select>
|
||||
@@ -46,24 +49,40 @@
|
||||
<select id="getAppTrend" parameterType="com.nis.domain.restful.dashboard.TrafficAppFocusStatistic" resultType="com.nis.domain.restful.dashboard.TrafficAppFocusStatistic">
|
||||
select stat_time time, max(unique_sip_num) sipNum,max(unique_dip_num) dipNum from traffic_app_focus_statistic t where
|
||||
<![CDATA[ stat_time>= toDateTime(#{searchStartTime}) and stat_time< toDateTime(#{searchEndTime})
|
||||
and app_id=toInt64(#{searchAppId}) ]]>
|
||||
<if test="searchEntranceId">
|
||||
<![CDATA[and entrance_id=toInt64(#{searchEntranceId}) ]]>
|
||||
</if>
|
||||
|
||||
and app_id=toInt64(#{searchAppId}) and entrance_id=toInt64(#{searchEntranceId}) ]]>
|
||||
group by stat_time
|
||||
order by stat_time
|
||||
</select>
|
||||
<!-- App通联关系Top100 -->
|
||||
<!-- App 活跃IP Top100 -->
|
||||
<select id="appConnRecordTop100" parameterType="com.nis.domain.restful.dashboard.AppConnRecordStatistic" resultType="com.nis.domain.restful.dashboard.AppConnRecordStatistic">
|
||||
select s_ip ipAddr, sum(c2s_byte_num + s2c_byte_num) byteNum, sum(c2s_pkt_num + s2c_pkt_num) pktNum, count(s_ip) logNum
|
||||
from tbs_ods_ntc_conn_record_log t where
|
||||
<![CDATA[ found_time>= toDateTime(#{searchStartTime}) and found_time< toDateTime(#{searchEndTime})
|
||||
and app_id=toInt64(#{searchAppId}) and entrance_id=toInt64(#{searchEntranceId}) ]]>
|
||||
group by s_ip
|
||||
order by
|
||||
<choose>
|
||||
<when test="searchQuota !=null and searchQuota != '' and searchQuota == 2 ">
|
||||
pktNum
|
||||
</when>
|
||||
<when test="searchQuota !=null and searchQuota != '' and searchQuota == 3 ">
|
||||
byteNum
|
||||
</when>
|
||||
<otherwise>
|
||||
logNum
|
||||
</otherwise>
|
||||
</choose>
|
||||
desc limit 100
|
||||
</select>
|
||||
<!-- App 所有IP 连接数、包数、字节数 总量统计 用于计算活跃IP Top100的占比情况 -->
|
||||
<select id="appConnRecordTotal" parameterType="com.nis.domain.restful.dashboard.AppConnRecordStatistic" resultType="com.nis.domain.restful.dashboard.AppConnRecordStatistic">
|
||||
select sum(c2s_byte_num + s2c_byte_num) byteNum, sum(c2s_pkt_num + s2c_pkt_num) pktNum, count(s_ip) logNum
|
||||
from tbs_ods_ntc_conn_record_log t where
|
||||
<![CDATA[ found_time>= toDateTime(#{searchStartTime}) and found_time< toDateTime(#{searchEndTime})
|
||||
and app_id=toInt64(#{searchAppId}) ]]>
|
||||
<if test="searchEntranceId">
|
||||
<if test="searchEntranceId !=null and searchEntranceId != ''">
|
||||
<![CDATA[and entrance_id=toInt64(#{searchEntranceId}) ]]>
|
||||
</if>
|
||||
group by s_ip
|
||||
order by logNum desc limit 100
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -15,9 +15,9 @@ public interface TrafficIpActiveStatisticDao {
|
||||
// List<TrafficIpActiveStatistic> getIpList(TrafficIpActiveStatistic trafficIpActiveStatistic);
|
||||
TrafficIpActiveStatistic getMaxStatTime();
|
||||
|
||||
ArrayList<TrafficIpActiveStatistic> ipActiveFiveMinute( @Param("ipAddr") String ipAddr,@Param("beginDate")Date beginDate,@Param("endDate")Date endDate);
|
||||
ArrayList<TrafficIpActiveStatistic> 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<LinkedHashMap> ipActiveChart(@Param("beginDate")Date beginDate,@Param("endDate")Date endDate);
|
||||
ArrayList<LinkedHashMap> ipActiveChart(@Param("beginDate")Date beginDate,@Param("endDate")Date endDate,@Param("entranceId")Integer entranceId);
|
||||
}
|
||||
@@ -36,6 +36,9 @@
|
||||
<select id="ipActiveChart" resultType="java.util.LinkedHashMap">
|
||||
SELECT ip_addr ipAddr,SUM(link_num) linkNum FROM traffic_ip_active_statistic WHERE
|
||||
<![CDATA[stat_time >= #{beginDate} AND stat_time < #{endDate}]]>
|
||||
<if test="entranceId !=null">
|
||||
and area_id=#{entranceId}
|
||||
</if>
|
||||
GROUP BY ip_addr ORDER BY linkNum DESC LIMIT 0,10
|
||||
</select>
|
||||
|
||||
@@ -61,14 +64,21 @@
|
||||
<select id="ipActiveFiveMinute" resultMap="BaseResultMap">
|
||||
select ip_addr,SUM(link_num) count ,stat_time from traffic_ip_active_statistic
|
||||
WHERE
|
||||
<![CDATA[ip_addr in (${ipAddr}) and
|
||||
stat_time>= #{beginDate} and stat_time<#{endDate} GROUP BY stat_time,ip_addr order by stat_time asc]]>
|
||||
<![CDATA[ip_addr in (${ipAddr}) and stat_time>= #{beginDate} and stat_time<#{endDate}]]>
|
||||
<if test="entranceId !=null">
|
||||
and area_id=#{entranceId}
|
||||
</if>
|
||||
GROUP BY stat_time,ip_addr order by stat_time asc
|
||||
</select>
|
||||
<!-- IP流量统计一小时-->
|
||||
<select id="ipActiveOneHour" resultType="java.util.HashMap">
|
||||
SELECT ip_addr ipAddr,area_id areaId,SUM(c2s_byte_len+s2c_byte_len) count, link_num linkNum ,c2s_pkt_num c2sPktNum,s2c_pkt_num s2cPktNum,c2s_byte_len c2sByteLen,s2c_byte_len s2cByteLen,date_format(stat_time, '%Y-%m-%d %H:%i:%s') statTime FROM traffic_ip_active_statistic
|
||||
WHERE ip_addr=#{ipAddr}
|
||||
and <![CDATA[ stat_time>= #{beginDate} and stat_time<#{endDate}]]> GROUP BY statTime
|
||||
and <![CDATA[ stat_time>= #{beginDate} and stat_time<#{endDate}]]>
|
||||
<if test="entranceId !=null">
|
||||
and area_id=#{entranceId}
|
||||
</if>
|
||||
GROUP BY statTime
|
||||
ORDER BY count DESC LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
@@ -13,6 +13,6 @@ public interface TrafficProtocolStatisticDao {
|
||||
|
||||
TrafficProtocolStatistic getMaxStatTime();
|
||||
List<Map> protocolChart(@Param("statTime")Date statTime);
|
||||
List<Map> getProtocolList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("protoType")Integer[] protoType);
|
||||
List<Map> getProtocolList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("protoType")Integer[] protoType,@Param("entranceId")Integer entranceId);
|
||||
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
<select id="getProtocolList" resultType="java.util.HashMap">
|
||||
SELECT IFNULL(c.protocol_type,p.proto_type) protocolType,p.proto_type protoType,p.link_num linkNum, p.packets packets, p.GByte GByte FROM (
|
||||
SELECT proto_type,SUM(link_num) AS link_num,SUM(c2s_pkt_num+s2c_pkt_num) AS packets,
|
||||
((SUM(c2s_byte_len+s2c_byte_len)*8)/300/1024/1024/1024) AS GByte
|
||||
((SUM(c2s_byte_len+s2c_byte_len))/1024/1024/1024) AS GByte
|
||||
FROM traffic_protocol_statistic WHERE
|
||||
<![CDATA[ stat_time>= #{beginTime} and stat_time< #{endTime}]]>
|
||||
<if test="protoType!=null">
|
||||
@@ -36,6 +36,9 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="entranceId !=null">
|
||||
and entrance_id=#{entranceId}
|
||||
</if>
|
||||
GROUP BY proto_type ) p
|
||||
LEFT JOIN ui_code_protocol_type_dic c ON p.proto_type=c.view_code ORDER BY p.GByte DESC
|
||||
</select>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<Map> ipActiveFiveMinute(Date beginDate, Date endDate) {
|
||||
public List<Map> ipActiveFiveMinute(Date beginDate, Date endDate,Integer entranceId) {
|
||||
List<Map> listMap = new ArrayList<Map>();
|
||||
List<LinkedHashMap> ipListTop10 = trafficIpActiveStatisticDao.ipActiveChart(beginDate, endDate);
|
||||
List<LinkedHashMap> 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<TrafficIpActiveStatistic> ipInfoList = trafficIpActiveStatisticDao
|
||||
.ipActiveFiveMinute(ipStr.toString(), beginDate, endDate);
|
||||
.ipActiveFiveMinute(ipStr.toString(), beginDate, endDate,entranceId);
|
||||
// 存放每个IP,每个时间点的总数
|
||||
Map<String, List> ipCountListMap = new HashMap<String, List>();
|
||||
int index = 0;
|
||||
for (int i = 0; i < dateRangeList.size(); i++) {
|
||||
// 存放一个时间点中每个IP的总数
|
||||
Map<String, Long> ipCountMap = new HashMap<String, Long>();
|
||||
Map<String, Long> ipCountMap = new TreeMap<String, Long>();
|
||||
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<HashMap> ipActiveOneHour(Date beginDate, Date endDate) {
|
||||
public List<HashMap> ipActiveOneHour(Date beginDate, Date endDate,Integer entranceId) {
|
||||
|
||||
// TrafficIpActiveStatistic maxStatTime = trafficIpActiveStatisticDao.getMaxStatTime();
|
||||
ArrayList<HashMap> listMap = new ArrayList<HashMap>();
|
||||
// if (maxStatTime != null && maxStatTime.getStatTime() != null) {
|
||||
// Date statTime = maxStatTime.getStatTime();
|
||||
ArrayList<LinkedHashMap> list = trafficIpActiveStatisticDao.ipActiveChart(beginDate, endDate);
|
||||
ArrayList<LinkedHashMap> 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<LinkedHashMap> 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<Map> getProtocolList(String startTime, String endTime, Integer[] protoType) {
|
||||
public List<Map> getProtocolList(String startTime, String endTime, Integer[] protoType,Integer entranceId) {
|
||||
// TrafficProtocolStatistic maxStatTime = trafficProtocolStatisticDao.getMaxStatTime();
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
// 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<Map> getAppList(String startTime, String endTime, Integer[] appType) {
|
||||
public List<Map> getAppList(String startTime, String endTime, Integer[] appType,Integer entranceId) {
|
||||
// TrafficAppStatistic maxStatTime = trafficAppStatisticDao.getMaxStatTime();
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
// 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<AppConnRecordStatistic> appConnRecordTop100(AppConnRecordStatistic entity) {
|
||||
DecimalFormat df = new DecimalFormat("##.##");
|
||||
List<AppConnRecordStatistic> list = new ArrayList<AppConnRecordStatistic>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user