Browse Source

修改代码

dev_shibei_match
jianjun 5 years ago
parent
commit
bcc0a652f9
  1. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
  2. 4
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java

12
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) { private void statsTagViewedQuarterly(String quarterId, String customerId) {
List<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); List<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId);
log.debug("statsTagViewedQuarterly grid quarterId:{},customerId:{},result:{}",quarterId,customerId,JSON.toJSONString(gridMonthlyList));
if (!CollectionUtils.isEmpty(gridMonthlyList)) { if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List<FactTagViewedGridQuarterlyEntity> gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); List<FactTagViewedGridQuarterlyEntity> gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class);
factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList);
} }
List<FactTagViewedAgencyMonthlyEntity> agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); List<FactTagViewedAgencyMonthlyEntity> agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId);
log.debug("statsTagViewedQuarterly agency quarterId:{},customerId:{},result:{}",quarterId,customerId,JSON.toJSONString(gridMonthlyList));
if (!CollectionUtils.isEmpty(agencyMonthlyList)) { if (!CollectionUtils.isEmpty(agencyMonthlyList)) {
List<FactTagViewedAgencyQuarterlyEntity> agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); List<FactTagViewedAgencyQuarterlyEntity> agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class);
factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList);
@ -913,11 +915,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
*/ */
private void statsTagViewedYearly(String yearId, String customerId) { private void statsTagViewedYearly(String yearId, String customerId) {
List<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); List<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId);
log.debug("statsTagViewedYearly grid yearId:{},customerId:{},result:{}",yearId,customerId,JSON.toJSONString(gridMonthlyList));
if (!CollectionUtils.isEmpty(gridMonthlyList)) { if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List<FactTagViewedGridYearlyEntity> gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); List<FactTagViewedGridYearlyEntity> gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class);
factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList);
} }
List<FactTagViewedAgencyMonthlyEntity> agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId); List<FactTagViewedAgencyMonthlyEntity> agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId);
log.debug("statsTagViewedYearly agency yearId:{},customerId:{},result:{}",yearId,customerId,JSON.toJSONString(agencyMonthlyList));
if (!CollectionUtils.isEmpty(agencyMonthlyList)) { if (!CollectionUtils.isEmpty(agencyMonthlyList)) {
List<FactTagViewedAgencyYearlyEntity> agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); List<FactTagViewedAgencyYearlyEntity> agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class);
factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList);
@ -957,8 +961,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId); String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId);
FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key);
DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid);
if (currentDimAgency == null) { if (currentDimAgency == null && !NumConstant.ZERO_STR.equals(pid)) {
log.error("setTagViewedData2ParentAgency pid:{} not exist in dimAgency", pid); log.error("setTagViewedData2ParentAgency agencyId:{} not exist in dimAgency", pid);
return; return;
} }
if (parentAgencyDailyEntity == null) { if (parentAgencyDailyEntity == null) {
@ -982,8 +986,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
private void setPublishedData2ParentAgency(Map<String, FactArticlePublishedAgencyDailyEntity> agencyDailyEntityMap, FactArticlePublishedAgencyDailyEntity agencySummary, FactArticlePublishedAgencyDailyEntity summary) { private void setPublishedData2ParentAgency(Map<String, FactArticlePublishedAgencyDailyEntity> agencyDailyEntityMap, FactArticlePublishedAgencyDailyEntity agencySummary, FactArticlePublishedAgencyDailyEntity summary) {
String pid = summary.getPid(); String pid = summary.getPid();
FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid);
if (parentAgency == null) { if (parentAgency == null && !NumConstant.ZERO_STR.equals(pid)) {
log.error("setPublishedData2ParentAgency pid:{} not exist in dimAgency", pid); log.error("setPublishedData2ParentAgency agencyId:{} not exist in dimAgency", pid);
return; return;
} }
parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount()); parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount());

4
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; import org.springframework.stereotype.Component;
/** /**
* desc:标签被阅读次数 统计定时任务 * desc:标签被阅读次数 统计定时任务
*/ */
@Component("publicityTagViewedQuarterlyAndYearlyhlyStatsTask") @Component("publicityTagViewedQuarterlyAndYearlyhlyStatsTask")
public class PublicityTagViewedQuarterlyAndYearlyhlyStatsTask implements ITask { public class PublicityTagViewedQuarterlyAndYearlyhlyStatsTask implements ITask {
@ -21,7 +21,7 @@ public class PublicityTagViewedQuarterlyAndYearlyhlyStatsTask implements ITask {
@Override @Override
public void run(String params) { public void run(String params) {
logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行,参数为:{}", params); logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行,参数为:{}", params);
Result result = statsPublicityTaskService.tagUsedQuarterlyStatsjob(); Result result = statsPublicityTaskService.tagViewedQuarterlyStatsjob();
if (result.success()) { if (result.success()) {
logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行成功"); logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行成功");
} else { } else {

Loading…
Cancel
Save