diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 31b48152f3..9ed9ba7213 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -870,11 +870,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { */ private void statsTagViewedQuarterly(String quarterId, String customerId) { List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + log.debug("statsTagViewedQuarterly grid quarterId:{},customerId:{},result:{}",quarterId,customerId,JSON.toJSONString(gridMonthlyList)); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); } List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + log.debug("statsTagViewedQuarterly agency quarterId:{},customerId:{},result:{}",quarterId,customerId,JSON.toJSONString(gridMonthlyList)); if (!CollectionUtils.isEmpty(agencyMonthlyList)) { List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); @@ -913,11 +915,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { */ private void statsTagViewedYearly(String yearId, String customerId) { List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); + log.debug("statsTagViewedYearly grid yearId:{},customerId:{},result:{}",yearId,customerId,JSON.toJSONString(gridMonthlyList)); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); } List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId); + log.debug("statsTagViewedYearly agency yearId:{},customerId:{},result:{}",yearId,customerId,JSON.toJSONString(agencyMonthlyList)); if (!CollectionUtils.isEmpty(agencyMonthlyList)) { List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); @@ -957,8 +961,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId); FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); - if (currentDimAgency == null) { - log.error("setTagViewedData2ParentAgency pid:{} not exist in dimAgency", pid); + if (currentDimAgency == null && !NumConstant.ZERO_STR.equals(pid)) { + log.error("setTagViewedData2ParentAgency agencyId:{} not exist in dimAgency", pid); return; } if (parentAgencyDailyEntity == null) { @@ -982,8 +986,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private void setPublishedData2ParentAgency(Map agencyDailyEntityMap, FactArticlePublishedAgencyDailyEntity agencySummary, FactArticlePublishedAgencyDailyEntity summary) { String pid = summary.getPid(); FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); - if (parentAgency == null) { - log.error("setPublishedData2ParentAgency pid:{} not exist in dimAgency", pid); + if (parentAgency == null && !NumConstant.ZERO_STR.equals(pid)) { + log.error("setPublishedData2ParentAgency agencyId:{} not exist in dimAgency", pid); return; } parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount()); diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java index cb03b1a6aa..7c295f83d0 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java @@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * desc:标签被阅读次数 【月、季、年】统计定时任务 + * desc:标签被阅读次数 【季、年】统计定时任务 */ @Component("publicityTagViewedQuarterlyAndYearlyhlyStatsTask") public class PublicityTagViewedQuarterlyAndYearlyhlyStatsTask implements ITask { @@ -21,7 +21,7 @@ public class PublicityTagViewedQuarterlyAndYearlyhlyStatsTask implements ITask { @Override public void run(String params) { logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行,参数为:{}", params); - Result result = statsPublicityTaskService.tagUsedQuarterlyStatsjob(); + Result result = statsPublicityTaskService.tagViewedQuarterlyStatsjob(); if (result.success()) { logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行成功"); } else {