From 5ba67b9c19d0386624e7e699504abe65fdcfa307 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sun, 28 Jun 2020 18:58:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/StatsPublicityServiceImpl.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) 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 b7d5c4a20b..9f5ea34159 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 @@ -451,20 +451,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { //转换为 需要插入的Entity Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); - if (!CollectionUtils.isEmpty(agencySummaryMap)){ - //同一个机关下数据累加 - for (Map.Entry 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 publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); Map haveDataAgencyDailyMap = new HashMap<>(); @@ -495,6 +482,20 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily); } } + if (!CollectionUtils.isEmpty(agencySummaryMap)){ + //同一个机关下数据累加 + for (Map.Entry 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 entry : haveDataAgencyDailyMap.entrySet()) { From b80ecb5081cf1b297de38fe3fa7732ab3aaa850b Mon Sep 17 00:00:00 2001 From: jianjun Date: Sun, 28 Jun 2020 19:10:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml | 2 +- .../resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml | 2 +- .../src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml index b99b5e409b..6a18c289ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml +++ b/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 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml index 8e8fb7e9b3..1f802a277e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml +++ b/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 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml index 1970dc22a7..adb493b15e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml +++ b/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