summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/nis/web/controller/restful/DashboardServiceController.java13
-rw-r--r--src/main/java/com/nis/web/controller/restful/NtcLogSearchController.java6
-rw-r--r--src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.java4
-rw-r--r--src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml2
-rw-r--r--src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.java2
-rw-r--r--src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml5
-rw-r--r--src/main/java/com/nis/web/service/BaseLogService.java25
-rw-r--r--src/main/java/com/nis/web/service/LogDataService.java10
-rw-r--r--src/main/java/com/nis/web/service/restful/DashboardService.java10
9 files changed, 44 insertions, 33 deletions
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 837d7fb..56ad55c 100644
--- a/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java
+++ b/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java
@@ -218,19 +218,20 @@ public class DashboardServiceController extends BaseRestController {
*/
@RequestMapping(value = "trafficBandwidthTransThree", method = RequestMethod.GET)
@ApiOperation(value = "带宽根据ip46,协议tcp,udp查询详情", httpMethod = "GET", notes = "对应带宽根据IPv4,6,协议tcp,udp统计数据显示")
- public Map<String,?> trafficBandwidthTransThree(String beginDate,String endDate,String searchQuotaType,Model model, HttpServletRequest request, HttpServletResponse response) {
+ public Map<String,?> trafficBandwidthTransThree(String beginDate,String endDate,String searchQuotaType,Model model,Integer searchDirection,
+ HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
Map resultMap=new HashMap();
try {
if(StringUtils.isEmpty(beginDate)&&StringUtils.isEmpty(endDate)) {
- Calendar cal = Calendar. getInstance ();
+ Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
endDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format(cal.getTime());//获取到完整的时间
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format(cal.getTime());
}
- resultMap = dashboardService.getBandwidthTransEntrance(beginDate, endDate,searchQuotaType);
+ resultMap = dashboardService.getBandwidthTransEntrance(beginDate, endDate,searchQuotaType,searchDirection);
} catch (Exception e) {
auditLogThread.setExceptionInfo("带宽实时统计数据检索失败:"+e.getMessage());
@@ -321,14 +322,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,Integer entranceId, Model model, HttpServletRequest request,
- HttpServletResponse response) {
+ public Map<String, ?> trafficProtocolList(Integer[] protoType,String beginDate, String endDate,Integer entranceId, Model model,
+ Integer searchDirection,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,entranceId);
+ List<Map> ipActiveList = dashboardService.getProtocolList(beginDate, endDate,protoType,entranceId,searchDirection);
if (ipActiveList != null && ipActiveList.size() > 0) {
String jsonString = JsonMapper.toJsonString(ipActiveList);
list = (java.util.List<HashMap>) JsonMapper.fromJsonList(jsonString, HashMap.class);
diff --git a/src/main/java/com/nis/web/controller/restful/NtcLogSearchController.java b/src/main/java/com/nis/web/controller/restful/NtcLogSearchController.java
index 22a9960..a69129d 100644
--- a/src/main/java/com/nis/web/controller/restful/NtcLogSearchController.java
+++ b/src/main/java/com/nis/web/controller/restful/NtcLogSearchController.java
@@ -180,9 +180,9 @@ public class NtcLogSearchController extends BaseRestController {
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request,
null);
//判断searchCfgId是否为null
- if(ntcMailLog.getSearchCfgId() ==null){
- ntcMailLog.setSearchCfgId("-1");
- }
+// if(ntcMailLog.getSearchCfgId() ==null){
+// ntcMailLog.setSearchCfgId("-1");
+// }
try {
resetTime(ntcMailLog);
ntcLogService.queryConditionCheck(auditLogThread, start, ntcMailLog, NtcMailLog.class, page);
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 87f21d0..9fb8a38 100644
--- a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.java
+++ b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.java
@@ -19,8 +19,8 @@ public interface NtcTotalReportDao {
List<Map> getTotalReportList(@Param("reportTime") Date reportTime);
List<Map> getNetFlowPortInfoNew(@Param("statTime") Date statTime);
List<TrafficTransStatistic> getBandwidthTrans(@Param("entranceId") Integer entranceId,@Param("beginDate") String beginDate,@Param("endDate") String endDate,@Param("addrType") String addrType,@Param("transType") Integer transType);
- List<TrafficTransStatistic> getBandwidthTransIPVx(@Param("beginDate") String beginDate,@Param("endDate") String endDate);
- List<TrafficTransStatistic> getBandwidthTransProtocol(@Param("beginDate") String beginDate,@Param("endDate") String endDate);
+ List<TrafficTransStatistic> getBandwidthTransIPVx(@Param("beginDate") String beginDate,@Param("endDate") String endDate,@Param("searchDirection") Integer searchDirection);
+ List<TrafficTransStatistic> getBandwidthTransProtocol(@Param("beginDate") String beginDate,@Param("endDate") String endDate,@Param("searchDirection") Integer searchDirection);
String getAddrType();
String getTransType();
String getEntranceId();
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 3fd068b..cd75f4b 100644
--- a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml
+++ b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml
@@ -73,11 +73,13 @@
WHERE
<![CDATA[ stat_time >= #{beginDate} and stat_time < #{endDate} ]]>
and addr_type in (4,6)
+ and direction =#{searchDirection}
group by addr_type,stat_time ,entrance_id order by stat_time
</select>
<select id="getBandwidthTransProtocol" resultMap="BandwidthResultMap">
select addr_type,trans_type,entrance_id,IFNULL((SUM(c2s_byte_len+s2c_byte_len)*8)/300/1024/1024/1024,0) gbps,IFNULL(SUM(c2s_pkt_num+s2c_pkt_num)/300,0) pps,IFNULL(SUM(link_num),0) linkNum, stat_time from traffic_trans_statistic
WHERE <![CDATA[stat_time >= #{beginDate} and stat_time < #{endDate} ]]>
+ and direction =#{searchDirection}
and trans_type in (6,17) group by trans_type,stat_time ,entrance_id order by stat_time
</select>
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 839c05c..091090c 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<Map> protocolChart(@Param("statTime")Date statTime);
- List<Map> getProtocolList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("protoType")Integer[] protoType,@Param("entranceId")Integer entranceId);
+ List<Map> getProtocolList(@Param("beginTime")String beginTime,@Param("endTime")String endTime,@Param("protoType")Integer[] protoType,@Param("entranceId")Integer entranceId,@Param("searchDirection")Integer searchDirection);
} \ 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 17e989e..4b006e9 100644
--- a/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml
+++ b/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml
@@ -37,7 +37,10 @@
</foreach>
</if>
<if test="entranceId !=null">
- and entrance_id=#{entranceId}
+ and entrance_id = #{entranceId}
+ </if>
+ <if test="searchDirection !=null">
+ and direction = #{searchDirection}
</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
diff --git a/src/main/java/com/nis/web/service/BaseLogService.java b/src/main/java/com/nis/web/service/BaseLogService.java
index ac04d3f..410ee38 100644
--- a/src/main/java/com/nis/web/service/BaseLogService.java
+++ b/src/main/java/com/nis/web/service/BaseLogService.java
@@ -195,16 +195,27 @@ public abstract class BaseLogService {
} catch (Exception e) {
throw new RestServiceException("searchFoundStartTime参数错误", RestBusinessCode.param_formate_error.getValue());
}
+ //service参数改为可以传多个
+ if (!StringUtil.isBlank(entity.getSearchService())) {
+ String[] splits = org.apache.commons.lang.StringUtils.split(entity.getSearchService(), ",");
+ for (String service : splits) {
+ try {
+ Integer.parseInt(service);
+ } catch (Exception e) {
+ throw new RestServiceException("searchService参数错误", RestBusinessCode.param_formate_error.getValue());
+ }
- try {
- if (!StringUtil.isBlank(entity.getSearchService())) {
- Integer.parseInt(entity.getSearchService());
}
- } catch (NumberFormatException e) {
- throw new RestServiceException("searchService参数格式错误", RestBusinessCode.param_formate_error.getValue());
- } catch (Exception e) {
- throw new RestServiceException("searchService参数错误", RestBusinessCode.param_formate_error.getValue());
}
+// try {
+// if (!StringUtil.isBlank(entity.getSearchService())) {
+// Integer.parseInt(entity.getSearchService());
+// }
+// } catch (NumberFormatException e) {
+// throw new RestServiceException("searchService参数格式错误", RestBusinessCode.param_formate_error.getValue());
+// } catch (Exception e) {
+// throw new RestServiceException("searchService参数错误", RestBusinessCode.param_formate_error.getValue());
+// }
try {
checkCloumnIsExist(thread, start, clazz, page);
} catch (RestServiceException e) {
diff --git a/src/main/java/com/nis/web/service/LogDataService.java b/src/main/java/com/nis/web/service/LogDataService.java
index 7cc6a13..2126b36 100644
--- a/src/main/java/com/nis/web/service/LogDataService.java
+++ b/src/main/java/com/nis/web/service/LogDataService.java
@@ -1004,7 +1004,8 @@ public class LogDataService {
if (field.equals("cfg_id")
|| field.equals("web_id")
|| field.equals("app_id")
- || field.equals("proto_id")) {
+ || field.equals("proto_id")
+ || field.equals("service")) {
if (field.equals("cfg_id")) {
if (value.toString().trim()
.equals("0")) {
@@ -1015,13 +1016,6 @@ public class LogDataService {
+ " ="
+ value.toString()
.trim());
- } else if (value.toString()
- .trim().equals("-1")) {
- whereSB.append(" and "
- + filedAndColumnMap
- .get(key)
- .toLowerCase()
- + " >0");
} else {
whereSB.append(" and "
+ filedAndColumnMap
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 983b771..cb51619 100644
--- a/src/main/java/com/nis/web/service/restful/DashboardService.java
+++ b/src/main/java/com/nis/web/service/restful/DashboardService.java
@@ -733,12 +733,12 @@ public class DashboardService extends BaseService {
*
* @return
*/
- public List<Map> getProtocolList(String startTime, String endTime, Integer[] protoType,Integer entranceId) {
+ public List<Map> getProtocolList(String startTime, String endTime, Integer[] protoType,Integer entranceId,Integer searchDirection) {
// 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,entranceId);
+ list = trafficProtocolStatisticDao.getProtocolList(startTime, endTime, protoType,entranceId,searchDirection);
// }
return list;
}
@@ -1290,13 +1290,13 @@ public class DashboardService extends BaseService {
return fieldType == null ? null : fieldType.split(",");
}
- public Map<String, Map> getBandwidthTransEntrance(String beginDate, String endDate,String searchQuotaType) throws ParseException {
+ public Map<String, Map> getBandwidthTransEntrance(String beginDate, String endDate,String searchQuotaType,Integer searchDirection) throws ParseException {
Map<String, Map> resultMap = new HashMap<String, Map>();
Map<String, ArrayList<TrafficTransStatistic>> listMap = new HashMap<String, ArrayList<TrafficTransStatistic>>();
List<TrafficTransStatistic> bandwidthListIPvx = new ArrayList<TrafficTransStatistic>();
List<TrafficTransStatistic> bandwidthListProtocol = new ArrayList<TrafficTransStatistic>();
- bandwidthListIPvx = ntcTotalReportDao.getBandwidthTransIPVx(beginDate, endDate);
- bandwidthListProtocol = ntcTotalReportDao.getBandwidthTransProtocol(beginDate, endDate);
+ bandwidthListIPvx = ntcTotalReportDao.getBandwidthTransIPVx(beginDate, endDate,searchDirection);
+ bandwidthListProtocol = ntcTotalReportDao.getBandwidthTransProtocol(beginDate, endDate,searchDirection);
Map<String, Map> trafficMap = new HashMap<String, Map>();
if ((!StringUtil.isEmpty(bandwidthListIPvx) && bandwidthListIPvx.size() > 0)
|| (!StringUtil.isEmpty(bandwidthListProtocol) && bandwidthListProtocol.size() > 0)) {