- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.dao.voice;
-
-import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO;
-import com.epmet.entity.voice.ArticlePublishRangeEntity;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * 文章发布范围表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-06-17
- */
-@Mapper
-public interface ArticlePublishRangeDao extends BaseDao {
-
- /**
- * desc:查询网格发布文章总数及状态为发布中的文章总数
- *
- * @param customerId
- * @param createDate
- * @return
- */
- List getAllPublishedCount(@Param("customerId") String customerId, @Param("createDate") Date createDate);
-
- /**
- * desc: 根据客户Id、创建日期查询某一天的 文章发布数据
- *
- * @param customerId
- * @param startDate
- * @param endDate
- * @return: List
- */
- List getOneDayPublishedCount(@Param("customerId") String customerId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
-}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java
deleted file mode 100644
index 1aac103337..0000000000
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.entity.voice;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.util.Date;
-
-/**
- * 文章发布范围表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-06-17
- */
-@Data
-@EqualsAndHashCode(callSuper=false)
-@TableName("article_publish_range")
-public class ArticlePublishRangeEntity extends BaseEpmetEntity {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 客户ID
- */
- private String customerId;
-
- /**
- * 文章ID
- */
- private String articleId;
-
- /**
- * 网格ID
- */
- private String gridId;
-
- /**
- * 组织-网格名称
- */
- private String agencyGridName;
-
- /**
- * 组织ID
- */
- private String agencyId;
-
- /**
- * 所有上级组织机构ID 以英文:隔开
- */
- private String pids;
-
- /**
- * 所有上级名称 以横杠隔开
- */
- private String allParentName;
-
- /**
- * 下线时间
- */
- private Date offLineTime;
-
- /**
- * 发布状态 已发布:published;已下线:offline
- */
- private String publishStatus;
-
-}
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 c3827206b3..31b48152f3 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
@@ -29,7 +29,6 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors;
/**
@@ -104,21 +103,19 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
private FactTagViewedGridYearlyService factTagViewedGridYearlyService;
@Autowired
private FactTagViewedAgencyYearlyService factTagViewedAgencyYearlyService;
- @Autowired
- private ExecutorService executorService;
@Override
public Boolean articleSummaryDailyStatsjob(Date statsDate) {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
//查询的是昨天及以前的数据
- statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -1), DateUtils.DATE_PATTERN);
+ statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -NumConstant.ONE), DateUtils.DATE_PATTERN);
} else {
statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
- int pageNo = 1;
- int pageSize = 100;
+ int pageNo = NumConstant.ONE;
+ int pageSize = NumConstant.ONE_HUNDRED;
List customerIdList = null;
String statsDateStr = DateUtils.format(statsDate);
do {
@@ -147,13 +144,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
//当天的凌晨时间 即为今天之前的数据
- statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN);
+ statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN);
} else {
statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
- int pageNo = 1;
- int pageSize = 100;
+ int pageNo = NumConstant.ONE;
+ int pageSize = NumConstant.ONE_HUNDRED;
List customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
@@ -177,13 +174,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
//当天的凌晨时间 即为今天之前的数据
- statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN);
+ statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN);
} else {
statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
- int pageNo = 1;
- int pageSize = 100;
+ int pageNo = NumConstant.ONE;
+ int pageSize = NumConstant.ONE_HUNDRED;
List customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
@@ -192,7 +189,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);
+ log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", customerId, dimIdBean.getMonthId()), e);
}
}
}
@@ -206,13 +203,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
//当天的凌晨时间 即为今天之前的数据
- statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN);
+ statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN);
} else {
statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
- int pageNo = 1;
- int pageSize = 100;
+ int pageNo = NumConstant.ONE;
+ int pageSize = NumConstant.ONE_HUNDRED;
List customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
@@ -234,13 +231,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
//当天的凌晨时间 即为今天之前的数据
- statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN);
+ statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN);
} else {
statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
- int pageNo = 1;
- int pageSize = 100;
+ int pageNo = NumConstant.ONE;
+ int pageSize = NumConstant.ONE_HUNDRED;
List customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
@@ -262,13 +259,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
//当天的凌晨时间 即为今天之前的数据
- statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN);
+ statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN);
} else {
statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
- int pageNo = 1;
- int pageSize = 100;
+ int pageNo = NumConstant.ONE;
+ int pageSize = NumConstant.ONE_HUNDRED;
List customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
@@ -297,13 +294,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
//当天的凌晨时间 即为今天之前的数据
- statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN);
+ statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN);
} else {
statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
- int pageNo = 1;
- int pageSize = 100;
+ int pageNo = NumConstant.ONE;
+ int pageSize = NumConstant.ONE_HUNDRED;
List customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
@@ -318,8 +315,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
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);
}
@@ -357,7 +352,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
buildAgencySummaryData(agencySummaryMap, summaryDTO);
}
}
- boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values());
+ factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values());
} catch (Exception e) {
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate), e);
}
@@ -430,8 +425,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
e.printStackTrace();
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate), e);
}
-
-
}
private void statsPublishedAgencyDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) {
@@ -460,9 +453,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount());
-
haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities);
-
//构建机关自己的数据
FactArticlePublishedAgencyDailyEntity selfDaily = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class);
selfDaily.setCustomerId(gridDailyEntities.getCustomerId());
@@ -506,9 +497,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
agencyDailyEntityMap.putAll(haveDataAgencyDailySelfMap);
}
log.debug("statsPublishedAgencyDaily insert:{}", JSON.toJSONString(agencyDailyEntityMap.values()));
- boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values());
+ factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values());
} catch (Exception e) {
- e.printStackTrace();
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate), e);
}
}
@@ -558,7 +548,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//KEY 文章Id
Map articleMap = publishedArticleList.stream().collect(Collectors.toMap(ArticleEntity::getId, o -> o));
Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
- Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN);
+ Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, NumConstant.ONE), DateUtils.DATE_PATTERN);
//2 获取文章标签
List articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime);
if (!CollectionUtils.isEmpty(articleTagsList)) {
@@ -586,14 +576,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
}
}
-
factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values());
factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values());
//向上级机关递归添加 数据
Map finalTagUsedAgencyDailyMap = new HashMap<>();
finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap);
- List agencyDailyEntities = tagUsedAgencyDailyMap.values().stream().filter(uesedTag -> uesedTag.getUsedCount() > 0).collect(Collectors.toList());
- log.debug("===tagUsedAgencyDailyMap:"+JSON.toJSONString(tagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList())));
+ List agencyDailyEntities = tagUsedAgencyDailyMap.values().stream().filter(uesedTag -> uesedTag.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList());
+ log.debug("===tagUsedAgencyDailyMap:" + JSON.toJSONString(tagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList())));
for (FactTagUsedAgencyDailyEntity entry : agencyDailyEntities) {
DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(entry.getAgencyId());
if (dimAgencyEntity == null) {
@@ -602,11 +591,11 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
}
setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, entry, dimIdBean);
}
- log.debug("===finalTagUsedAgencyDailyMap:"+JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList())));
+ log.debug("===finalTagUsedAgencyDailyMap:" + JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList())));
if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)) {
finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap);
}
- log.debug("===finalTagUsedAgencyDailyMap:"+JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList())));
+ log.debug("===finalTagUsedAgencyDailyMap:" + JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList())));
factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values());
}
@@ -624,7 +613,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setGridId(grid.getId());
entity.setTagId(tag.getId());
entity.setTagName(tag.getTagName());
- entity.setUsedCount(0);
+ entity.setUsedCount(NumConstant.ZERO);
tagUsedGridDailyMap.put(grid.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity);
});
@@ -639,7 +628,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setDepartmentId(dept.getId());
entity.setTagId(tag.getId());
entity.setTagName(tag.getTagName());
- entity.setUsedCount(0);
+ entity.setUsedCount(NumConstant.ZERO);
tagUsedDeptDailyMap.put(dept.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity);
});
});
@@ -651,7 +640,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setAgencyId(agency.getId());
entity.setTagId(tag.getId());
entity.setTagName(tag.getTagName());
- entity.setUsedCount(0);
+ entity.setUsedCount(NumConstant.ZERO);
tagUsedAgencyDailyMap.put(agency.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity);
});
tagDefaultList.forEach(tag -> {
@@ -662,7 +651,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setAgencyId(agencyId);
entity.setTagId(tag.getId());
entity.setTagName(tag.getTagName());
- entity.setUsedCount(0);
+ entity.setUsedCount(NumConstant.ZERO);
tagUsedAgencyDailySelfMap.put(agencyId.concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity);
});
});
@@ -708,7 +697,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//获取当天的业务数据
//1获取今天文章的阅读记录数
Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
- Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN);
+ Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, NumConstant.ONE), DateUtils.DATE_PATTERN);
List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime);
if (!CollectionUtils.isEmpty(visitRecordList)) {
for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) {
@@ -747,7 +736,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//向上级机关递归添加 数据
Map finalTagUsedAgencyDailyMap = new HashMap<>();
finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap);
- List tagViewedList = tagViewedAgencyDailyMap.values().stream().filter(tagViewed -> tagViewed.getTagReadCount() > 0).collect(Collectors.toList());
+ List tagViewedList = tagViewedAgencyDailyMap.values().stream().filter(tagViewed -> tagViewed.getTagReadCount() > NumConstant.ZERO).collect(Collectors.toList());
for (FactTagViewedAgencyDailyEntity entry : tagViewedList) {
DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(entry.getAgencyId());
if (dimAgencyEntity == null) {
@@ -775,10 +764,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setGridId(grid.getId());
entity.setTagId(tag.getId());
entity.setTagName(tag.getTagName());
- entity.setTagReadCount(0);
+ entity.setTagReadCount(NumConstant.ZERO);
tagViewedGridDailyMap.put(grid.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity);
});
-
});
}
tagDefaultList.forEach(tag -> {
@@ -788,7 +776,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setAgencyId(agency.getId());
entity.setTagId(tag.getId());
entity.setTagName(tag.getTagName());
- entity.setTagReadCount(0);
+ entity.setTagReadCount(NumConstant.ZERO);
tagViewedAgencyDailyMap.put(agency.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity);
});
tagDefaultList.forEach(tag -> {
@@ -799,7 +787,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setAgencyId(agencyId);
entity.setTagId(tag.getId());
entity.setTagName(tag.getTagName());
- entity.setTagReadCount(0);
+ entity.setTagReadCount(NumConstant.ZERO);
tagViewedAgencyDailySelfMap.put(agencyId.concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity);
});
});
@@ -837,7 +825,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagViewedMonthly(String monthId, String customerId) {
-
List gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId);
if (!CollectionUtils.isEmpty(gridDailyList)) {
List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class);
@@ -849,7 +836,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class);
factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList));
}
-
}
/**
@@ -859,7 +845,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagUsedQuarterly(String quarterId, String customerId) {
-
List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId);
if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class);
@@ -875,7 +860,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class);
factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList);
}
-
}
/**
@@ -885,19 +869,16 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagViewedQuarterly(String quarterId, String customerId) {
-
List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId);
if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class);
factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList);
}
-
List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId);
if (!CollectionUtils.isEmpty(agencyMonthlyList)) {
List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class);
factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList);
}
-
}
/**
@@ -907,7 +888,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagUsedYearly(String yearId, String customerId) {
-
List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId);
if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class);
@@ -923,7 +903,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class);
factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList);
}
-
}
/**
@@ -933,8 +912,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagViewedYearly(String yearId, String customerId) {
-
-
List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId);
if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class);
@@ -945,7 +922,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class);
factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList);
}
-
}
private void setTagUsedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagUsedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) {
@@ -982,6 +958,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key);
DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid);
if (currentDimAgency == null) {
+ log.error("setTagViewedData2ParentAgency pid:{} not exist in dimAgency", pid);
return;
}
if (parentAgencyDailyEntity == null) {
@@ -1006,6 +983,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
String pid = summary.getPid();
FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid);
if (parentAgency == null) {
+ log.error("setPublishedData2ParentAgency pid:{} not exist in dimAgency", pid);
return;
}
parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount());
@@ -1031,9 +1009,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setCustomerId(dimGridEntity.getCustomerId());
entity.setAgencyId(dimGridEntity.getAgencyId());
entity.setGridId(dimGridEntity.getId());
- entity.setArticleTotalCount(0);
- entity.setArticlePublishedCount(0);
- entity.setPublishedCount(0);
+ entity.setArticleTotalCount(NumConstant.ZERO);
+ entity.setArticlePublishedCount(NumConstant.ZERO);
+ entity.setPublishedCount(NumConstant.ZERO);
result.put(dimGridEntity.getId(), entity);
});
return result;
@@ -1053,9 +1031,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setCustomerId(dimGridEntity.getCustomerId());
entity.setAgencyId(dimGridEntity.getAgencyId());
entity.setDepartmentId(dimGridEntity.getId());
- entity.setArticleTotalCount(0);
- entity.setArticlePublishedCount(0);
- entity.setPublishedCount(0);
+ entity.setArticleTotalCount(NumConstant.ZERO);
+ entity.setArticlePublishedCount(NumConstant.ZERO);
+ entity.setPublishedCount(NumConstant.ZERO);
result.put(dimGridEntity.getId(), entity);
});
return result;
@@ -1075,9 +1053,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setCustomerId(dimGridEntity.getCustomerId());
entity.setPid(dimGridEntity.getPid());
entity.setAgencyId(dimGridEntity.getId());
- entity.setArticleTotalCount(0);
- entity.setArticlePublishedCount(0);
- entity.setPublishedCount(0);
+ entity.setArticleTotalCount(NumConstant.ZERO);
+ entity.setArticlePublishedCount(NumConstant.ZERO);
+ entity.setPublishedCount(NumConstant.ZERO);
result.put(dimGridEntity.getId(), entity);
});
return result;
@@ -1102,10 +1080,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setGridId(gridId);
entity.setTagId(tagId);
entity.setTagName(tagEntity.getTagName());
- entity.setUsedCount(1);
+ entity.setUsedCount(NumConstant.ONE);
result.put(key, entity);
} else {
- entity.setUsedCount(entity.getUsedCount() + 1);
+ entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE);
}
}
@@ -1121,10 +1099,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setDepartmentId(publisherId);
entity.setTagId(tagId);
entity.setTagName(tagEntity.getTagName());
- entity.setUsedCount(1);
+ entity.setUsedCount(NumConstant.ONE);
result.put(key, entity);
} else {
- entity.setUsedCount(entity.getUsedCount() + 1);
+ entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE);
}
}
@@ -1140,10 +1118,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setAgencyId(agencyId);
entity.setTagId(tagId);
entity.setTagName(tagEntity.getTagName());
- entity.setUsedCount(1);
+ entity.setUsedCount(NumConstant.ONE);
result.put(key, entity);
} else {
- entity.setUsedCount(entity.getUsedCount() + 1);
+ entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE);
}
}
@@ -1159,10 +1137,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setAgencyId(agencyId);
entity.setTagId(tagId);
entity.setTagName(tagEntity.getTagName());
- entity.setUsedCount(1);
+ entity.setUsedCount(NumConstant.ONE);
result.put(key, entity);
} else {
- entity.setUsedCount(entity.getUsedCount() + 1);
+ entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE);
}
}
@@ -1171,7 +1149,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
String gridId = viewedSummaryDTO.getGridId();
String tagId = tagEntity.getTagId();
String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId);
- Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount();
+ Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount();
FactTagViewedGridDailyEntity entity = result.get(key);
if (entity == null) {
entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedGridDailyEntity.class);
@@ -1192,7 +1170,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
String agencyId = dimAgencyEntity.getId();
String tagId = tagEntity.getTagId();
String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId);
- Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount();
+ Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount();
FactTagViewedAgencyDailyEntity entity = result.get(key);
if (entity == null) {
entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class);
@@ -1213,7 +1191,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
String agencyId = dimAgencyEntity.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX);
String tagId = tagEntity.getTagId();
String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId);
- Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount();
+ Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount();
FactTagViewedAgencyDailyEntity entity = result.get(key);
if (entity == null) {
entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class);
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java
deleted file mode 100644
index 125e46e962..0000000000
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.service.voice;
-
-import com.epmet.commons.mybatis.service.BaseService;
-import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO;
-import com.epmet.entity.voice.ArticlePublishRangeEntity;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * 文章发布范围表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-06-17
- */
-public interface ArticlePublishRangeService extends BaseService {
-
- /**
- * desc: 根据客户Id 、创建日期查询 有史以来所有的发布文章总数
- *
- * @param customerId
- * @param createDate
- * @return: List
- * @date: 2020/6/17 16:59
- * @author: jianjun liu
- * email:liujianjun@git.elinkit.com.cn
- */
- List getAllPublishedCount(String customerId, Date createDate);
-
- /**
- * desc: 根据客户Id、创建日期查询某一天的 文章发布数据
- *
- * @param customerId
- * @param startDate
- * @param endDate
- * @return: List
- * @date: 2020/6/17 21:43
- * @author: jianjun liu
- * email:liujianjun@git.elinkit.com.cn
- */
- List getOneDayPublishedCount(String customerId, Date startDate, Date endDate);
-}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java
deleted file mode 100644
index 8fc2f430cd..0000000000
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *