Browse Source

网格小组

dev_shibei_match
zxc 5 years ago
parent
commit
6b5ccecb7f
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java
  2. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java

4
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 CITY = "city";
String PROVINCE = "province"; 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";
} }

8
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 @Slf4j
public class StatsGroupServiceImpl implements StatsGroupService { public class StatsGroupServiceImpl implements StatsGroupService {
@Autowired
private DimGridService dimGridService;
@Autowired @Autowired
private DimAgencyService dimAgencyService; private DimAgencyService dimAgencyService;
@Autowired @Autowired
@ -63,15 +61,15 @@ public class StatsGroupServiceImpl implements StatsGroupService {
List<String> customerIds; List<String> customerIds;
do { do {
customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize);
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date);
if (customerIds.size() != NumConstant.ZERO){ if (customerIds.size() != NumConstant.ZERO){
customerIds.forEach(customerId -> { customerIds.forEach(customerId -> {
try { try {
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date);
List<GridIdListByCustomerResultDTO> gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId()); List<GridIdListByCustomerResultDTO> gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId());
List<GroupGridDailyResultDTO> resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); List<GroupGridDailyResultDTO> resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo);
factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId);
} catch (Exception e) { } 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<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId);
factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId);
} catch (Exception e) { } 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()));
} }
}); });
} }

Loading…
Cancel
Save