提取查询时间范围到页面控制
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";
|
||||
|
||||
@@ -1136,7 +1136,7 @@
|
||||
$.ajax({
|
||||
type:'get',
|
||||
dataType: 'json',
|
||||
url:"${pageContext.request.contextPath}/nis/dynamicpage/indexTraffic?baseNum=" + top.baseNum,
|
||||
url:"${pageContext.request.contextPath}/nis/dynamicpage/indexTraffic?hour=2&baseNum=" + top.baseNum,
|
||||
success:function(res){//处理返回结果
|
||||
if(res) {
|
||||
data = res;
|
||||
@@ -1189,7 +1189,7 @@
|
||||
$.ajax({
|
||||
type:'get',
|
||||
dataType: 'json',
|
||||
url:'${pageContext.request.contextPath}/nis/dynamicpage/indexLog?sid=' + top.indexLogServiceId + "&baseNum=" + top.baseNum,
|
||||
url:'${pageContext.request.contextPath}/nis/dynamicpage/indexLog?hour=24&sid=' + top.indexLogServiceId + "&baseNum=" + top.baseNum,
|
||||
success:function(res){//处理返回结果
|
||||
logData = res;
|
||||
_logData = logData.shift();
|
||||
@@ -1241,7 +1241,7 @@
|
||||
$.ajax({
|
||||
type:'get',
|
||||
dataType: 'json',
|
||||
url:'${pageContext.request.contextPath}/nis/dynamicpage/indexDrop' + "?baseNum=" + top.dropBaseNum,
|
||||
url:'${pageContext.request.contextPath}/nis/dynamicpage/indexDrop?hour=24' + "&baseNum=" + top.dropBaseNum,
|
||||
success:function(res){//处理返回结果
|
||||
if(res) {
|
||||
dropData = res;
|
||||
|
||||
Reference in New Issue
Block a user