|
|
@ -870,11 +870,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)); |
|
|
|
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)); |
|
|
|
if (!CollectionUtils.isEmpty(agencyMonthlyList)) { |
|
|
|
List<FactTagViewedAgencyQuarterlyEntity> 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<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); |
|
|
|
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)); |
|
|
|
if (!CollectionUtils.isEmpty(agencyMonthlyList)) { |
|
|
|
List<FactTagViewedAgencyYearlyEntity> 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<String, FactArticlePublishedAgencyDailyEntity> 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()); |
|
|
|