流量统计增加drop,loop,new link ,close link ,pass ,live link详情
This commit is contained in:
@@ -639,4 +639,70 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* drop, loop,new link,close link,pass,live link
|
||||
*/
|
||||
@RequestMapping("ntcTotalReportDetail")
|
||||
public String ntcTotalReportDetail(Model model,String searchAction){
|
||||
Calendar cal = Calendar. getInstance ();
|
||||
cal.setTime(new Date());
|
||||
String now = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//鑾峰彇鍒板畬鏁寸殑鏃堕棿
|
||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||
String oneHoursAgo = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||
model.addAttribute("searchAction", searchAction);
|
||||
model.addAttribute("beginDate", oneHoursAgo);
|
||||
model.addAttribute("endDate", now);
|
||||
return "/dashboard/ntcTotalReportDetailList";
|
||||
}
|
||||
@RequestMapping("ajaxNtcTotalReportDetail")
|
||||
@ResponseBody
|
||||
public Map ajaxNtcTotalReportDetail(String beginDate,String endDate,Model model,String searchAction){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
Map map = new HashMap();
|
||||
try {
|
||||
String url=Constants.DASHBOARD_URL+Constants.TREND_TOTAL_REPORT;
|
||||
if(StringUtil.isBlank(beginDate)||StringUtil.isBlank(endDate)){
|
||||
Calendar cal = Calendar. getInstance ();
|
||||
cal.setTime(new Date());
|
||||
endDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间
|
||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||
}
|
||||
URIBuilder uriBuilder = new URIBuilder(url);
|
||||
uriBuilder.addParameter("searchReportStartTime",beginDate);
|
||||
uriBuilder.addParameter("searchReportEndTime",endDate);
|
||||
url=uriBuilder.toString();
|
||||
if(searchAction!=null){
|
||||
if("action_drop".equals(searchAction)){
|
||||
url=url+"&searchBusinessType="+1;
|
||||
}
|
||||
if("action_loop".equals(searchAction)){
|
||||
url=url+"&searchBusinessType="+2;
|
||||
}
|
||||
if("new_link".equals(searchAction)){
|
||||
url=url+"&searchBusinessType="+3;
|
||||
}
|
||||
if("active_link".equals(searchAction)){
|
||||
url=url+"&searchBusinessType="+4;
|
||||
}
|
||||
if("pass".equals(searchAction)){
|
||||
url=url+"&searchBusinessType="+6;
|
||||
}
|
||||
if("live_link".equals(searchAction)){
|
||||
url=url+"&searchBusinessType="+5;
|
||||
}
|
||||
}
|
||||
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
||||
logger.debug("动作详情统计一小时"+fromJsonList);
|
||||
map = (Map) fromJsonList.get("data");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("动作详情统计一小时数据获取错误"+e);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user