From 8725f79377d84d314f4906c40d081d8997dd9a6e Mon Sep 17 00:00:00 2001 From: lizijie <lzjiiie@163.com> Date: Tue, 15 Mar 2022 15:37:01 +0800 Subject: [PATCH] 环比数据接口页数功能修改 --- screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java b/screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java index 21083f0..86df41a 100644 --- a/screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java +++ b/screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java @@ -51,28 +51,31 @@ if (reportType == null) { if (startTime == null || endTime == null) return false; - reportType = Constants.DAILYREPORT; //������������������������������������������ String endTimeStr = DateUtils.dateToDateString(endTime,"yyyy-MM-dd"); endTimeStr+=" 23:59:59"; endTime = DateUtils.getDate(endTimeStr,"yyyy-MM-dd HH:mm:ss"); } else { - if (reportType.equals(Constants.HOURYLYREPORT)) { + if(startTime!=null&&endTime!=null) + return false; + if (reportType.equals(Constants.HOURLY_REPORT)) { //������������������������������������������ Date previousHour = DateUtils.getDateOfMin(new Date(), -60); startTime = DateUtils.getHourlyStartTime(previousHour); - } else if (reportType.equals(Constants.DAILYREPORT)) { + } else if (reportType.equals(Constants.DAILY_REPORT)) { //������������������������������������ Date yesterday = DateUtils.getDateOfDay(new Date(),-1); startTime = DateUtils.getDailyStartTime(yesterday); - } else if (reportType.equals(Constants.WEEKLYREPORT)) { + } else if (reportType.equals(Constants.WEEKLY_REPORT)) { //������������������������������������ Date previous = DateUtils.getDateOfDay(new Date(),-7); startTime = DateUtils.getWeeklyStartTime(previous); - } else if (reportType.equals(Constants.MONTHLYREPORT)) { + endTime = DateUtils.getWeeklyEndTime(previous); + } else if (reportType.equals(Constants.MONTHLY_REPORT)) { //������������������������������������ Date lastMonthFirstDay = DateUtils.getFirstDayOfLastMonth(); startTime = DateUtils.getMonthlyStartTime(lastMonthFirstDay); + endTime = DateUtils.getMonthlyEndTime(lastMonthFirstDay); } else return false; } -- Gitblit v1.8.0