提取查询时间范围到页面控制
This commit is contained in:
@@ -42,9 +42,14 @@ public class DynamicIndexController extends BaseController {
|
||||
public String dynamicIndex(HttpServletRequest request){
|
||||
String serviceIds = request.getParameter("sid");
|
||||
String baseNum = request.getParameter("baseNum");
|
||||
Object trafficAreaStat = trafficAreaStat(null, Integer.parseInt(baseNum));
|
||||
Object dropStat = dropStat(null, Integer.parseInt(baseNum));
|
||||
Object logStat = logStat(null, serviceIds, Integer.parseInt(baseNum));
|
||||
String hourStr = request.getParameter("hour");
|
||||
Integer hour = null;
|
||||
if(hourStr!=null &&!"".equals(hourStr)){
|
||||
hour = Integer.parseInt(hourStr);
|
||||
}
|
||||
Object trafficAreaStat = trafficAreaStat(hour, Integer.parseInt(baseNum));
|
||||
Object dropStat = dropStat(hour, Integer.parseInt(baseNum));
|
||||
Object logStat = logStat(hour, serviceIds, Integer.parseInt(baseNum));
|
||||
Gson gson = new GsonBuilder().create();
|
||||
String trafficJson = gson.toJson(trafficAreaStat);
|
||||
String dropJson = gson.toJson(dropStat);
|
||||
@@ -93,12 +98,12 @@ public class DynamicIndexController extends BaseController {
|
||||
List<Map> results = new ArrayList<>();
|
||||
|
||||
if (hour == null || hour <= 0) {
|
||||
hour = 24;
|
||||
hour = 1;
|
||||
}
|
||||
|
||||
Date now = new Date();
|
||||
Date start = new Date(now.getTime()-(hour*60*60*1000));
|
||||
|
||||
Date start = new Date(now.getTime()-(hour*60*60*1000)-(5*60*1000));
|
||||
now = new Date(now.getTime()-5*60*1000);
|
||||
String nowString = DateUtils.formatDate(now, "yyyy-MM-dd HH:mm:ss");
|
||||
String startString = DateUtils.formatDate(start, "yyyy-MM-dd HH:mm:ss");
|
||||
/*nowString = "2018-12-05 00:00:00";
|
||||
|
||||
Reference in New Issue
Block a user