From 3cf84aa99a0bb5acddf63eeea9d5d84810105c1e Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Mon, 24 Jan 2022 10:12:19 +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