From 6f4e852b84c577454a4876f83c7085bd360fe4fb Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Tue, 17 Aug 2021 17:07:02 +0800
Subject: [PATCH] 特殊设备数据insert
---
screen-common/src/main/java/com/moral/util/DateUtils.java | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/screen-common/src/main/java/com/moral/util/DateUtils.java b/screen-common/src/main/java/com/moral/util/DateUtils.java
index 7fe7e86..9084e65 100644
--- a/screen-common/src/main/java/com/moral/util/DateUtils.java
+++ b/screen-common/src/main/java/com/moral/util/DateUtils.java
@@ -1358,7 +1358,7 @@
/*
* ������������������������������������
- * ������time=2021-08-04 ���������������������������������������
+ * ������time=2021-08-04 ���������������������������������������2021-08-04 00���2021-08-04 01���������
* time=2021-08 ���������������������������������
* */
public static List<String> getTimeLag(String time) {
@@ -1367,23 +1367,27 @@
Calendar cal = Calendar.getInstance();
String end;
String dateFormat;
+ String df;
int i;
if (length == 10) {//���
end = getDateAddDay(time, 1);
- dateFormat = yyyy_MM_dd_EN;
+ dateFormat = yyyy_MM_dd_HH_EN;
+ df = yyyy_MM_dd_EN;
i = Calendar.HOUR_OF_DAY;
} else if (length == 7) {//���
end = getDateAddMonth(time, 1);
- dateFormat = yyyy_MM_EN;
+ dateFormat = yyyy_MM_dd_EN;
+ df = yyyy_MM_EN;
i = Calendar.DAY_OF_MONTH;
} else {//���
end = getDateAddYear(time, 1);
- dateFormat = yyyy;
+ dateFormat = yyyy_MM_EN;
+ df = yyyy;
i = Calendar.MONTH;
}
- cal.setTime(getDate(time, dateFormat));
- for (long d = cal.getTimeInMillis(); d < getDate(end, dateFormat).getTime(); cal.set(i, cal.get(i) + 1), d = cal.getTimeInMillis()) {
- String format = dateToDateString(new Date(d));
+ cal.setTime(getDate(time, df));
+ for (long d = cal.getTimeInMillis(); d < getDate(end, df).getTime(); cal.set(i, cal.get(i) + 1), d = cal.getTimeInMillis()) {
+ String format = dateToDateString(new Date(d),dateFormat);
result.add(format);
}
return result;
--
Gitblit v1.8.0