|  |  | @ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.DateUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.DimAgencyConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.ProjectConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.StatsFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.voice.ArticleViewedSummaryDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.stats.*; | 
			
		
	
	
		
			
				
					|  |  | @ -21,6 +22,7 @@ import com.epmet.service.voice.ArticleVisitRecordService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.voice.TagCustomerService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.util.DimIdGenerator; | 
			
		
	
		
			
				
					|  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.util.CollectionUtils; | 
			
		
	
	
		
			
				
					|  |  | @ -105,222 +107,268 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { | 
			
		
	
		
			
				
					|  |  |  | 	private FactTagViewedAgencyYearlyService factTagViewedAgencyYearlyService; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean articleSummaryDailyStatsjob(Date statsDate) { | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean articleSummaryDailyStatsjob(StatsFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		Date statsDate = getStatsDateFromParam(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 		String statsDateStr = DateUtils.format(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
 | 
			
		
	
		
			
				
					|  |  |  | 		if (statsDate == null) { | 
			
		
	
		
			
				
					|  |  |  | 			//查询的是昨天及以前的数据
 | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -NumConstant.ONE), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		//入参有客户Id的则按客户Id执行,没有的则全部客户都执行
 | 
			
		
	
		
			
				
					|  |  |  | 		if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { | 
			
		
	
		
			
				
					|  |  |  | 			statsSummaryByCustomerId(dimIdBean, statsDateStr, formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 		int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 		List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 		String statsDateStr = DateUtils.format(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		do { | 
			
		
	
		
			
				
					|  |  |  | 			customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 				for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						//key:所在机关Id
 | 
			
		
	
		
			
				
					|  |  |  | 						Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  | 						statsPublishedGridDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); | 
			
		
	
		
			
				
					|  |  |  | 						statsPublishedDepartmentDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); | 
			
		
	
		
			
				
					|  |  |  | 						statsPublishedAgencyDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error("articlePublishedCountDayStats exception", e); | 
			
		
	
		
			
				
					|  |  |  | 			int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 			int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 			List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 			do { | 
			
		
	
		
			
				
					|  |  |  | 				customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 				if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 					for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 						statsSummaryByCustomerId(dimIdBean, statsDateStr, customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		return true; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagUsedDailyStatsjob(Date statsDate) { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
 | 
			
		
	
		
			
				
					|  |  |  | 		if (statsDate == null) { | 
			
		
	
		
			
				
					|  |  |  | 			//当天的凌晨时间 即为今天之前的数据
 | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 	private Date getStatsDateFromParam(StatsFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		Date statsDate = null; | 
			
		
	
		
			
				
					|  |  |  | 		if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -NumConstant.ONE), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		return statsDate; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	private void statsSummaryByCustomerId(DimIdGenerator.DimIdBean dimIdBean, String statsDateStr, String customerId) { | 
			
		
	
		
			
				
					|  |  |  | 		try { | 
			
		
	
		
			
				
					|  |  |  | 			//key:所在机关Id
 | 
			
		
	
		
			
				
					|  |  |  | 			Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  | 			statsPublishedGridDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); | 
			
		
	
		
			
				
					|  |  |  | 			statsPublishedDepartmentDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); | 
			
		
	
		
			
				
					|  |  |  | 			statsPublishedAgencyDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); | 
			
		
	
		
			
				
					|  |  |  | 		} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 			log.error("articlePublishedCountDayStats exception", e); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagUsedDailyStatsjob(StatsFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		Date statsDate = getStatsDateFromParam(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 		int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 		List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 		do { | 
			
		
	
		
			
				
					|  |  |  | 			customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 				for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 					Date finalStatsDate = statsDate; | 
			
		
	
		
			
				
					|  |  |  | 					//统计
 | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", customerId, dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 		if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { | 
			
		
	
		
			
				
					|  |  |  | 			//统计
 | 
			
		
	
		
			
				
					|  |  |  | 			try { | 
			
		
	
		
			
				
					|  |  |  | 				statsTagUsedDaily(statsDate, dimIdBean, formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 			} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 				log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", formDTO.getCustomerId(), dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 			int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 			List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 			do { | 
			
		
	
		
			
				
					|  |  |  | 				customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 				if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 					for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 						//统计
 | 
			
		
	
		
			
				
					|  |  |  | 						try { | 
			
		
	
		
			
				
					|  |  |  | 							statsTagUsedDaily(statsDate, dimIdBean, customerId); | 
			
		
	
		
			
				
					|  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 							log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", customerId, dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		return true; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagUsedMonthlyStatsjob(Date statsDate) { | 
			
		
	
		
			
				
					|  |  |  | 		//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
 | 
			
		
	
		
			
				
					|  |  |  | 		if (statsDate == null) { | 
			
		
	
		
			
				
					|  |  |  | 			//当天的凌晨时间 即为今天之前的数据
 | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagUsedMonthlyStatsjob(StatsFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		Date statsDate = getStatsDateFromParam(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 		DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 		int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 		List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 		do { | 
			
		
	
		
			
				
					|  |  |  | 			customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 				for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", customerId, dimIdBean.getMonthId()), e); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { | 
			
		
	
		
			
				
					|  |  |  | 			try { | 
			
		
	
		
			
				
					|  |  |  | 				statsTagUsedMonthly(dimIdBean.getMonthId(), formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 			} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 				log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", formDTO.getCustomerId(), dimIdBean.getMonthId()), e); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 			int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 			List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 			do { | 
			
		
	
		
			
				
					|  |  |  | 				customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 				if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 					for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 						try { | 
			
		
	
		
			
				
					|  |  |  | 							statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 							log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", customerId, dimIdBean.getMonthId()), e); | 
			
		
	
		
			
				
					|  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		return true; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagViewedDailyStatsjob(Date statsDate) { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
 | 
			
		
	
		
			
				
					|  |  |  | 		if (statsDate == null) { | 
			
		
	
		
			
				
					|  |  |  | 			//当天的凌晨时间 即为今天之前的数据
 | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagViewedDailyStatsjob(StatsFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		Date statsDate = getStatsDateFromParam(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 		DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 		int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 		List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 		do { | 
			
		
	
		
			
				
					|  |  |  | 			customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 				for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						statsTagViewedDaily(statsDate, dimIdBean, customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", customerId, dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 		if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { | 
			
		
	
		
			
				
					|  |  |  | 			try { | 
			
		
	
		
			
				
					|  |  |  | 				statsTagViewedDaily(statsDate, dimIdBean, formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 			} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 				log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", formDTO.getCustomerId(), dimIdBean.getMonthId()), e); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 			int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 			List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 			do { | 
			
		
	
		
			
				
					|  |  |  | 				customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 				if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 					for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 						try { | 
			
		
	
		
			
				
					|  |  |  | 							statsTagViewedDaily(statsDate, dimIdBean, customerId); | 
			
		
	
		
			
				
					|  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 							log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", customerId, dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		return true; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagViewedMonthlyStatsjob(Date statsDate) { | 
			
		
	
		
			
				
					|  |  |  | 		//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
 | 
			
		
	
		
			
				
					|  |  |  | 		if (statsDate == null) { | 
			
		
	
		
			
				
					|  |  |  | 			//当天的凌晨时间 即为今天之前的数据
 | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagViewedMonthlyStatsjob(StatsFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		Date statsDate = getStatsDateFromParam(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 		DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 		int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 		List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 		do { | 
			
		
	
		
			
				
					|  |  |  | 			customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 				for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", customerId, dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 		if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { | 
			
		
	
		
			
				
					|  |  |  | 			try { | 
			
		
	
		
			
				
					|  |  |  | 				statsTagViewedMonthly(dimIdBean.getMonthId(), formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 			} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 				log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", formDTO.getCustomerId(), dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 			int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 			List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 			do { | 
			
		
	
		
			
				
					|  |  |  | 				customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 				if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 					for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 						try { | 
			
		
	
		
			
				
					|  |  |  | 							statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 							log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", customerId, dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		return true; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagUsedQuarterlyStatsjob(Date statsDate) { | 
			
		
	
		
			
				
					|  |  |  | 		//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
 | 
			
		
	
		
			
				
					|  |  |  | 		if (statsDate == null) { | 
			
		
	
		
			
				
					|  |  |  | 			//当天的凌晨时间 即为今天之前的数据
 | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagUsedQuarterlyStatsjob(StatsFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		Date statsDate = getStatsDateFromParam(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 		DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 		int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 		List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 		do { | 
			
		
	
		
			
				
					|  |  |  | 			customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 				for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						log.debug("start === statsTagUsedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 						statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedQuarterly", customerId, dimIdBean.getQuarterId()), e); | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						log.debug("start === statsTagUsedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 						statsTagUsedYearly(dimIdBean.getYearId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedYearly", customerId, dimIdBean.getYearId()), e); | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 		if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { | 
			
		
	
		
			
				
					|  |  |  | 			try { | 
			
		
	
		
			
				
					|  |  |  | 				try { | 
			
		
	
		
			
				
					|  |  |  | 					log.debug("start === statsTagUsedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 					statsTagUsedQuarterly(dimIdBean.getQuarterId(), formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 				} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 					log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedQuarterly", formDTO.getCustomerId(), dimIdBean.getQuarterId()), e); | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 				try { | 
			
		
	
		
			
				
					|  |  |  | 					log.debug("start === statsTagUsedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 					statsTagUsedYearly(dimIdBean.getYearId(), formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 				} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 					log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedYearly", formDTO.getCustomerId(), dimIdBean.getYearId()), e); | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 			} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 				log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", formDTO.getCustomerId(), dimIdBean.getDateId()), e); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 			int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 			List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 			do { | 
			
		
	
		
			
				
					|  |  |  | 				customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 				if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 					for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 						try { | 
			
		
	
		
			
				
					|  |  |  | 							log.debug("start === statsTagUsedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 							statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 							log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedQuarterly", customerId, dimIdBean.getQuarterId()), e); | 
			
		
	
		
			
				
					|  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  | 						try { | 
			
		
	
		
			
				
					|  |  |  | 							log.debug("start === statsTagUsedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 							statsTagUsedYearly(dimIdBean.getYearId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 							log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedYearly", customerId, dimIdBean.getYearId()), e); | 
			
		
	
		
			
				
					|  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 			} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		return true; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagViewedQuarterlyStatsjob(Date statsDate) { | 
			
		
	
		
			
				
					|  |  |  | 		//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
 | 
			
		
	
		
			
				
					|  |  |  | 		if (statsDate == null) { | 
			
		
	
		
			
				
					|  |  |  | 			//当天的凌晨时间 即为今天之前的数据
 | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 	public Boolean tagViewedQuarterlyStatsjob(StatsFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		Date statsDate = getStatsDateFromParam(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 		DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); | 
			
		
	
		
			
				
					|  |  |  | 		int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 		int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 		List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 		do { | 
			
		
	
		
			
				
					|  |  |  | 			customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 				for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						log.debug("start === statsTagViewedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 						statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getQuarterId()), e); | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 					try { | 
			
		
	
		
			
				
					|  |  |  | 						log.debug("start === statsTagViewedYearly "); | 
			
		
	
		
			
				
					|  |  |  | 						statsTagViewedYearly(dimIdBean.getYearId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 					} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 						log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getYearId()), e); | 
			
		
	
		
			
				
					|  |  |  | 		if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { | 
			
		
	
		
			
				
					|  |  |  | 			try { | 
			
		
	
		
			
				
					|  |  |  | 				log.debug("start === statsTagViewedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 				statsTagViewedQuarterly(dimIdBean.getQuarterId(), formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 			} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 				log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", formDTO.getCustomerId(), dimIdBean.getQuarterId()), e); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 			try { | 
			
		
	
		
			
				
					|  |  |  | 				log.debug("start === statsTagViewedYearly "); | 
			
		
	
		
			
				
					|  |  |  | 				statsTagViewedYearly(dimIdBean.getYearId(), formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  | 			} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 				log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", formDTO.getCustomerId(), dimIdBean.getYearId()), e); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  | 			int pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  | 			int pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  | 			List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  | 			do { | 
			
		
	
		
			
				
					|  |  |  | 				customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 				if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  | 					for (String customerId : customerIdList) { | 
			
		
	
		
			
				
					|  |  |  | 						try { | 
			
		
	
		
			
				
					|  |  |  | 							log.debug("start === statsTagViewedQuarterly "); | 
			
		
	
		
			
				
					|  |  |  | 							statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 							log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getQuarterId()), e); | 
			
		
	
		
			
				
					|  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  | 						try { | 
			
		
	
		
			
				
					|  |  |  | 							log.debug("start === statsTagViewedYearly "); | 
			
		
	
		
			
				
					|  |  |  | 							statsTagViewedYearly(dimIdBean.getYearId(), customerId); | 
			
		
	
		
			
				
					|  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 							log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getYearId()), e); | 
			
		
	
		
			
				
					|  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 			} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		return true; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -870,13 +918,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { | 
			
		
	
		
			
				
					|  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  | 	private void statsTagViewedQuarterly(String quarterId, String customerId) { | 
			
		
	
		
			
				
					|  |  |  | 		List<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); | 
			
		
	
		
			
				
					|  |  |  | 		log.debug("statsTagViewedQuarterly grid quarterId:{},customerId:{},result:{}",quarterId,customerId,JSON.toJSONString(gridMonthlyList)); | 
			
		
	
		
			
				
					|  |  |  | 		log.debug("statsTagViewedQuarterly grid quarterId:{},customerId:{},result:{}", quarterId, customerId, JSON.toJSONString(gridMonthlyList)); | 
			
		
	
		
			
				
					|  |  |  | 		if (!CollectionUtils.isEmpty(gridMonthlyList)) { | 
			
		
	
		
			
				
					|  |  |  | 			List<FactTagViewedGridQuarterlyEntity> gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); | 
			
		
	
		
			
				
					|  |  |  | 			factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		List<FactTagViewedAgencyMonthlyEntity> agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); | 
			
		
	
		
			
				
					|  |  |  | 		log.debug("statsTagViewedQuarterly agency quarterId:{},customerId:{},result:{}",quarterId,customerId,JSON.toJSONString(gridMonthlyList)); | 
			
		
	
		
			
				
					|  |  |  | 		log.debug("statsTagViewedQuarterly agency quarterId:{},customerId:{},result:{}", quarterId, customerId, JSON.toJSONString(gridMonthlyList)); | 
			
		
	
		
			
				
					|  |  |  | 		if (!CollectionUtils.isEmpty(agencyMonthlyList)) { | 
			
		
	
		
			
				
					|  |  |  | 			List<FactTagViewedAgencyQuarterlyEntity> agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); | 
			
		
	
		
			
				
					|  |  |  | 			factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); | 
			
		
	
	
		
			
				
					|  |  | @ -915,13 +963,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { | 
			
		
	
		
			
				
					|  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  | 	private void statsTagViewedYearly(String yearId, String customerId) { | 
			
		
	
		
			
				
					|  |  |  | 		List<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); | 
			
		
	
		
			
				
					|  |  |  | 		log.debug("statsTagViewedYearly grid yearId:{},customerId:{},result:{}",yearId,customerId,JSON.toJSONString(gridMonthlyList)); | 
			
		
	
		
			
				
					|  |  |  | 		log.debug("statsTagViewedYearly grid yearId:{},customerId:{},result:{}", yearId, customerId, JSON.toJSONString(gridMonthlyList)); | 
			
		
	
		
			
				
					|  |  |  | 		if (!CollectionUtils.isEmpty(gridMonthlyList)) { | 
			
		
	
		
			
				
					|  |  |  | 			List<FactTagViewedGridYearlyEntity> gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); | 
			
		
	
		
			
				
					|  |  |  | 			factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		List<FactTagViewedAgencyMonthlyEntity> agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId); | 
			
		
	
		
			
				
					|  |  |  | 		log.debug("statsTagViewedYearly agency yearId:{},customerId:{},result:{}",yearId,customerId,JSON.toJSONString(agencyMonthlyList)); | 
			
		
	
		
			
				
					|  |  |  | 		log.debug("statsTagViewedYearly agency yearId:{},customerId:{},result:{}", yearId, customerId, JSON.toJSONString(agencyMonthlyList)); | 
			
		
	
		
			
				
					|  |  |  | 		if (!CollectionUtils.isEmpty(agencyMonthlyList)) { | 
			
		
	
		
			
				
					|  |  |  | 			List<FactTagViewedAgencyYearlyEntity> agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); | 
			
		
	
		
			
				
					|  |  |  | 			factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); | 
			
		
	
	
		
			
				
					|  |  | 
 |