Browse Source

Merge remote-tracking branch 'remotes/origin/dev_data_stats' into dev

dev_shibei_match
jianjun 5 years ago
parent
commit
6f0475aaa8
  1. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java

@ -451,20 +451,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
try {
//转换为 需要插入的Entity
Map<String, FactArticlePublishedAgencyDailyEntity> agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean);
if (!CollectionUtils.isEmpty(agencySummaryMap)){
//同一个机关下数据累加
for (Map.Entry<String, ArticleGridPublishedSummaryDTO> entry : agencySummaryMap.entrySet()) {
String agencyId = entry.getKey();
ArticleGridPublishedSummaryDTO summary = entry.getValue();
FactArticlePublishedAgencyDailyEntity dimAgencyEntity = agencyDailyEntityMap.get(agencyId);
if (dimAgencyEntity == null) {
continue;
}
dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount()+summary.getArticleTotalCount());
dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount()+summary.getArticlePublishedCount());
dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount()+summary.getPublishedCount());
}
}
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate);
Map<String, FactArticlePublishedAgencyDailyEntity> haveDataAgencyDailyMap = new HashMap<>();
@ -495,6 +482,20 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily);
}
}
if (!CollectionUtils.isEmpty(agencySummaryMap)){
//同一个机关下数据累加
for (Map.Entry<String, ArticleGridPublishedSummaryDTO> entry : agencySummaryMap.entrySet()) {
String agencyId = entry.getKey();
ArticleGridPublishedSummaryDTO summary = entry.getValue();
FactArticlePublishedAgencyDailyEntity dimAgencyEntity = agencyDailyEntityMap.get(agencyId);
if (dimAgencyEntity == null) {
continue;
}
dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount()+summary.getArticleTotalCount());
dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount()+summary.getArticlePublishedCount());
dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount()+summary.getPublishedCount());
}
}
//数据向上级机关添加
if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) {
for (Map.Entry<String, FactArticlePublishedAgencyDailyEntity> entry : haveDataAgencyDailyMap.entrySet()) {

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml

@ -13,7 +13,7 @@
AGENCY_ID,
TAG_ID,
TAG_NAME,
COUNT( USED_COUNT ) USED_COUNT,
SUM( USED_COUNT ) USED_COUNT,
MONTH_ID,
QUARTER_ID,
YEAR_ID

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml

@ -14,7 +14,7 @@
DEPARTMENT_ID,
TAG_ID,
TAG_NAME,
COUNT( USED_COUNT ) USED_COUNT,
SUM( USED_COUNT ) USED_COUNT,
MONTH_ID,
QUARTER_ID,
YEAR_ID

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml

@ -12,7 +12,7 @@
GRID_ID,
TAG_ID,
TAG_NAME,
COUNT( USED_COUNT ) USED_COUNT,
SUM( USED_COUNT ) USED_COUNT,
MONTH_ID,
QUARTER_ID,
YEAR_ID

Loading…
Cancel
Save