diff --git a/zc-business/src/main/java/com/zc/business/statistics/cache/DailyTrafficStatisticsCache.java b/zc-business/src/main/java/com/zc/business/statistics/cache/DailyTrafficStatisticsCache.java index 043bbada..b3b600da 100644 --- a/zc-business/src/main/java/com/zc/business/statistics/cache/DailyTrafficStatisticsCache.java +++ b/zc-business/src/main/java/com/zc/business/statistics/cache/DailyTrafficStatisticsCache.java @@ -70,7 +70,9 @@ public class DailyTrafficStatisticsCache extends AbstractTrafficStatisticsCache // 更新统计日期 dcTrafficSectionData.setStatisticalDate(dcTrafficSectionData.getStatisticalDate(), TrafficDataPeriodTypeEnum.DAY); - // 将新数据添加到数据列表中 + // 移除旧数据 + instance.getData().remove(dcTrafficSectionData); + // 添加数据 instance.getData().add(dcTrafficSectionData); } diff --git a/zc-business/src/main/java/com/zc/business/statistics/cache/MonthlyTrafficStatisticsCache.java b/zc-business/src/main/java/com/zc/business/statistics/cache/MonthlyTrafficStatisticsCache.java index 0d3d5956..28c6f83a 100644 --- a/zc-business/src/main/java/com/zc/business/statistics/cache/MonthlyTrafficStatisticsCache.java +++ b/zc-business/src/main/java/com/zc/business/statistics/cache/MonthlyTrafficStatisticsCache.java @@ -70,7 +70,9 @@ public class MonthlyTrafficStatisticsCache extends AbstractTrafficStatisticsCach // 更新统计日期 dcTrafficSectionData.setStatisticalDate(dcTrafficSectionData.getStatisticalDate(), TrafficDataPeriodTypeEnum.MONTH); - // 将新数据添加到数据列表中 + // 移除旧数据 + instance.getData().remove(dcTrafficSectionData); + // 添加数据 instance.getData().add(dcTrafficSectionData); } diff --git a/zc-business/src/main/java/com/zc/business/statistics/cache/QuarterlyTrafficStatisticsCache.java b/zc-business/src/main/java/com/zc/business/statistics/cache/QuarterlyTrafficStatisticsCache.java index 5b4d5ef0..ea3bc677 100644 --- a/zc-business/src/main/java/com/zc/business/statistics/cache/QuarterlyTrafficStatisticsCache.java +++ b/zc-business/src/main/java/com/zc/business/statistics/cache/QuarterlyTrafficStatisticsCache.java @@ -73,7 +73,9 @@ public class QuarterlyTrafficStatisticsCache extends AbstractTrafficStatisticsCa // 更新统计日期 dcTrafficSectionData.setStatisticalDate(dcTrafficSectionData.getStatisticalDate(), TrafficDataPeriodTypeEnum.QUARTER); - // 将新数据添加到数据列表中 + // 移除旧数据 + instance.getData().remove(dcTrafficSectionData); + // 添加数据 instance.getData().add(dcTrafficSectionData); } diff --git a/zc-business/src/main/java/com/zc/business/statistics/cache/YearlyTrafficStatisticsCache.java b/zc-business/src/main/java/com/zc/business/statistics/cache/YearlyTrafficStatisticsCache.java index 8b21f675..7b5147f4 100644 --- a/zc-business/src/main/java/com/zc/business/statistics/cache/YearlyTrafficStatisticsCache.java +++ b/zc-business/src/main/java/com/zc/business/statistics/cache/YearlyTrafficStatisticsCache.java @@ -73,7 +73,9 @@ public class YearlyTrafficStatisticsCache extends AbstractTrafficStatisticsCache // 更新统计日期 dcTrafficSectionData.setStatisticalDate(dcTrafficSectionData.getStatisticalDate(), TrafficDataPeriodTypeEnum.YEAR); - // 将新数据添加到数据列表中 + // 移除旧数据 + instance.getData().remove(dcTrafficSectionData); + // 添加数据 instance.getData().add(dcTrafficSectionData); }