From 02a868377608ddb8d8975bf3f26510c057345aa0 Mon Sep 17 00:00:00 2001 From: xiepufeng <1072271977@qq.com> Date: Mon, 1 Apr 2024 18:10:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=87=8D=E5=90=AF=E5=90=8E?= =?UTF-8?q?=E6=9C=88=E5=AD=A3=E5=BA=A6=E5=B9=B4=E4=BA=A4=E9=80=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/StatisticalRecoveryOffsetTime.java | 14 -------------- .../statistics/handler/TrafficStatistics.java | 11 +---------- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 zc-business/src/main/java/com/zc/business/constant/StatisticalRecoveryOffsetTime.java diff --git a/zc-business/src/main/java/com/zc/business/constant/StatisticalRecoveryOffsetTime.java b/zc-business/src/main/java/com/zc/business/constant/StatisticalRecoveryOffsetTime.java deleted file mode 100644 index 78117d8d..00000000 --- a/zc-business/src/main/java/com/zc/business/constant/StatisticalRecoveryOffsetTime.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zc.business.constant; - -/** - * 统计恢复偏移时间类 - * 用于定义与交通数据恢复相关的偏移时间常量。 - * - * @author xiepufeng - */ -public class StatisticalRecoveryOffsetTime { - - // 定义交通数据段偏移的天数常量,表示偏移-10天 - public static final int TRAFFIC_SECTION_DATA_OFFSET_DAY = -10; -} - diff --git a/zc-business/src/main/java/com/zc/business/statistics/handler/TrafficStatistics.java b/zc-business/src/main/java/com/zc/business/statistics/handler/TrafficStatistics.java index 3862b9f0..2d049b8e 100644 --- a/zc-business/src/main/java/com/zc/business/statistics/handler/TrafficStatistics.java +++ b/zc-business/src/main/java/com/zc/business/statistics/handler/TrafficStatistics.java @@ -113,21 +113,12 @@ public class TrafficStatistics { * @return HashMap 包含查询条件的HashMap对象。 */ private HashMap buildPropertiesRequiredParameter() { - - // 获取数据统计的最大日期 - Date maxStatisticalDate = dcTrafficSectionDataMapper.getMaxStatisticalDate(); - - // 如果最大统计日期为null,则计算默认的最大统计日期 - if (maxStatisticalDate == null) { - maxStatisticalDate = DateUtil.offsetDay(new Date(), StatisticalRecoveryOffsetTime.TRAFFIC_SECTION_DATA_OFFSET_DAY); - } - HashMap props = new HashMap<>(); // 设置查询条件的键为“timestamp$BTW”,表示时间戳在一定范围内 props.put("terms[0].column", "timestamp$BTW"); ArrayList dateList = new ArrayList<>(); // 添加当前日期的开始和结束时间到列表,用于设定时间范围 - dateList.add(DateUtil.beginOfDay(maxStatisticalDate).toString()); + dateList.add(DateUtil.beginOfMonth(new Date()).toString()); dateList.add(DateUtil.endOfDay(new Date()).toString()); // 将日期列表以逗号分隔并设置为查询条件的值 props.put("terms[0].value", String.join(",", dateList));