|
|
@ -163,7 +163,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
try { |
|
|
|
statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", customerId, dimIdBean.getDateId()), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -191,7 +191,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
try { |
|
|
|
statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId(), e.getMessage())); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId()), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -220,7 +220,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
try { |
|
|
|
statsTagViewedDaily(statsDate, dimIdBean, customerId); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", customerId, dimIdBean.getDateId()), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -248,7 +248,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
try { |
|
|
|
statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", customerId, dimIdBean.getDateId()), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -273,22 +273,18 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); |
|
|
|
if (!CollectionUtils.isEmpty(customerIdList)) { |
|
|
|
for (String customerId : customerIdList) { |
|
|
|
executorService.submit(() -> { |
|
|
|
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.getMessage())); |
|
|
|
} |
|
|
|
}); |
|
|
|
executorService.submit(() -> { |
|
|
|
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.getMessage())); |
|
|
|
} |
|
|
|
}); |
|
|
|
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); |
|
|
@ -312,24 +308,20 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); |
|
|
|
if (!CollectionUtils.isEmpty(customerIdList)) { |
|
|
|
for (String customerId : customerIdList) { |
|
|
|
executorService.submit(() -> { |
|
|
|
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.getMessage())); |
|
|
|
} |
|
|
|
}); |
|
|
|
executorService.submit(() -> { |
|
|
|
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.getMessage())); |
|
|
|
} |
|
|
|
}); |
|
|
|
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); |
|
|
@ -366,7 +358,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
} |
|
|
|
boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate, e.getMessage())); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate), e); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -435,7 +427,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate, e.getMessage())); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate), e); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -468,7 +460,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); |
|
|
|
|
|
|
|
//构建机关自己的数据
|
|
|
@ -482,7 +473,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!CollectionUtils.isEmpty(agencySummaryMap)){ |
|
|
|
if (!CollectionUtils.isEmpty(agencySummaryMap)) { |
|
|
|
//同一个机关下数据累加
|
|
|
|
for (Map.Entry<String, ArticleGridPublishedSummaryDTO> entry : agencySummaryMap.entrySet()) { |
|
|
|
String agencyId = entry.getKey(); |
|
|
@ -491,9 +482,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
if (dimAgencyEntity == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount()+summary.getArticleTotalCount()); |
|
|
|
dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount()+summary.getArticlePublishedCount()); |
|
|
|
dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount()+summary.getPublishedCount()); |
|
|
|
dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount() + summary.getArticleTotalCount()); |
|
|
|
dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount() + summary.getArticlePublishedCount()); |
|
|
|
dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount() + summary.getPublishedCount()); |
|
|
|
} |
|
|
|
} |
|
|
|
//数据向上级机关添加
|
|
|
@ -517,7 +508,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
|
boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate, e.getMessage())); |
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate), e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|