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 410bb15cb2..c5bd28f916 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 STATS_FAILED_GRID_DAILY = "方法:groupGridDaily ==>【网格小组统计出错了... 维度:网格-日】customerId为:"; + String STATS_FAILED_GRID_DAILY = "统计数据方法groupGridDaily【网格小组统计-网格-日】执行失败,客户ID:%s,统计日期:%s,异常信息:%s"; - String STATS_FAILED_AGENCY_DAILY = "方法:groupAgencyDaily ==>【网格小组统计出错了... 维度:机关-日】customerId为:"; + String STATS_FAILED_AGENCY_DAILY = "统计数据方法groupAgencyDaily【网格小组统计-机关-日】执行失败,客户ID:%s,统计日期:%s,异常信息:%s"; } 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 b6c2ea8cf4..a120a4c219 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 @@ -34,8 +34,6 @@ import java.util.stream.Collectors; @Slf4j public class StatsGroupServiceImpl implements StatsGroupService { - @Autowired - private DimGridService dimGridService; @Autowired private DimAgencyService dimAgencyService; @Autowired @@ -63,15 +61,15 @@ public class StatsGroupServiceImpl implements StatsGroupService { List customerIds; do { customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); if (customerIds.size() != NumConstant.ZERO){ customerIds.forEach(customerId -> { try { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); List gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId()); List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); } catch (Exception e) { - log.error(GroupConstant.STATS_FAILED_GRID_DAILY+customerId,e); + log.error(String.format(GroupConstant.STATS_FAILED_GRID_DAILY,customerId,LocalDate.now(),e.getMessage())); } }); } @@ -98,7 +96,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); } catch (Exception e) { - log.error(GroupConstant.STATS_FAILED_AGENCY_DAILY+customerId,e); + log.error(String.format(GroupConstant.STATS_FAILED_AGENCY_DAILY,customerId,LocalDate.now(),e.getMessage())); } }); }