From 5dac5d3054b00a83a0503be5d139d485ffc4ea50 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 24 Jun 2020 16:54:21 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/constant/GroupConstant.java | 4 ++-- .../java/com/epmet/service/impl/StatsGroupServiceImpl.java | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java index f7eccf24b1..410bb15cb2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java @@ -29,8 +29,8 @@ public interface GroupConstant { String CITY = "city"; String PROVINCE = "province"; - String ERRORGRIDDAILY = "groupGridDaily ==>【网格小组统计出错了... 维度:网格-日】customerId为:"; + String STATS_FAILED_GRID_DAILY = "方法:groupGridDaily ==>【网格小组统计出错了... 维度:网格-日】customerId为:"; - String ERRORAGENCYDAILY = "groupAgencyDaily ==>【网格小组统计出错了... 维度:机关-日】customerId为:"; + String STATS_FAILED_AGENCY_DAILY = "方法:groupAgencyDaily ==>【网格小组统计出错了... 维度:机关-日】customerId为:"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 67647f3f32..b6c2ea8cf4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -67,14 +67,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { customerIds.forEach(customerId -> { try { DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); - -// List gridsInfo = dimGridService.getGridListByCustomerId(customerId); List gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId()); - List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); } catch (Exception e) { - log.error(GroupConstant.ERRORGRIDDAILY+customerId,e); + log.error(GroupConstant.STATS_FAILED_GRID_DAILY+customerId,e); } }); } @@ -101,7 +98,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); } catch (Exception e) { - log.error(GroupConstant.ERRORAGENCYDAILY+customerId,e); + log.error(GroupConstant.STATS_FAILED_AGENCY_DAILY+customerId,e); } }); } From b813247c3680c8f36bb786db56219eee4aab3d52 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Jun 2020 17:09:15 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/logback-spring.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index 99ccda0d9c..c1135e7e28 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -137,7 +137,7 @@ - + From 69d379a5ef2be2f437e7b42a6db7a1d5e96de0c0 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 24 Jun 2020 17:13:53 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/topic/TopicDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml index 169227cff9..69386bd324 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -61,6 +61,7 @@ WHERE del_flag = '0' AND pid = #{agencyId} + AND agency_dim_type = 'all' From 38b54b5189dcf1d57b4d915b2590460d1ffe883c Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Jun 2020 17:16:20 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatsIssueServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index fd6ffe7b88..ab38ff305a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IssueConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; @@ -18,6 +19,7 @@ import com.epmet.service.StatsIssueService; import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -33,6 +35,7 @@ import java.util.stream.Collectors; * @dscription * @date 2020/6/17 16:51 */ +@Slf4j @Service public class StatsIssueServiceImpl implements StatsIssueService { @Autowired @@ -60,11 +63,17 @@ public class StatsIssueServiceImpl implements StatsIssueService { int pageSize = 100; List customerIdList = null; do { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { //遍历统计每一个客户数据 - customerStats(customerId); + try { + customerStats(customerId, date); + } catch(Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", DateUtils.format(date), e.getMessage())); + } } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -77,10 +86,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { * @param customerId * @return void */ - @Async - public void customerStats(String customerId) { - //获取当前日期前一天 - Date date = DateUtils.getBeforeDay(new Date()); + private void customerStats(String customerId, Date date) { //机关议题日统计 saveIssueAgencyDaily(customerId, date); //机关议题月统计 From ab5d8fabbd0ecb2346623c3cc9abd3dec2c7a66b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 24 Jun 2020 17:21:19 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/project/ProjectDao.xml | 2 +- .../service/impl/StatsProjectServiceImpl.java | 58 ++++++++++++------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index f61c01dedb..5f78474374 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -159,7 +159,7 @@ ) ) a ORDER BY - a.project_total DESC + a.project_total DESC, a.type ASC