| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -82,7 +82,7 @@ public class DcTrafficSectionDataServiceImpl | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 定义每小时第20分钟执行的任务,用于清除过期缓存数据并将缓存中的数据整合后保存至数据库。 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // @Scheduled(cron = "0 20 * * * ?") // 每小时的20分整点执行该任务
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Scheduled(cron = "0 20 * * * ?") // 每小时的20分整点执行该任务
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public void performHourlyCleanupAndPersist() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 清除已过期的缓存数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        DailyTrafficStatisticsCache.clearExpiredData(); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -173,14 +173,20 @@ public class DcTrafficSectionDataServiceImpl | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private HashMap<String, Object> buildPropertiesRequiredParameter() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // todo 数据库中查询出最大的时间
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 获取数据统计的最大日期
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Date maxStatisticalDate = dcTrafficSectionDataMapper.getMaxStatisticalDate(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 如果最大统计日期为null,则计算默认的最大统计日期
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (maxStatisticalDate == null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            maxStatisticalDate = DateUtil.offsetDay(new Date(), StatisticalRecoveryOffsetTime.TRAFFIC_SECTION_DATA_OFFSET_DAY); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        HashMap<String, Object> props = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 设置查询条件的键为“timestamp$BTW”,表示时间戳在一定范围内
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        props.put("terms[0].column", "timestamp$BTW"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ArrayList<String> dateList = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 添加当前日期的开始和结束时间到列表,用于设定时间范围
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        dateList.add(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), StatisticalRecoveryOffsetTime.TRAFFIC_SECTION_DATA_OFFSET_DAY)).toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        dateList.add(DateUtil.beginOfDay(maxStatisticalDate).toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        dateList.add(DateUtil.endOfDay(new Date()).toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 将日期列表以逗号分隔并设置为查询条件的值
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        props.put("terms[0].value", String.join(",", dateList)); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |