diff --git a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java index 6aa0fe9d0..6ade0862d 100644 --- a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java +++ b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java @@ -323,8 +323,36 @@ public class JsowellTask { return; } + List thirdPartyTypeList = Lists.newArrayList(ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(), + ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(), + ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode() + ); + + for (String thirdPartyType : thirdPartyTypeList) { + List stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType); + if (CollectionUtils.isEmpty(stationInfoVOS)) { + continue; + } + + List stationIdList = stationInfoVOS.stream() + .map(StationInfoVO::getStationId) + .collect(Collectors.toList()); + + for (String stationId : stationIdList) { + NotificationDTO dto = new NotificationDTO(); + dto.setStationId(stationId); + dto.setPlatformType(thirdPartyType); + notificationService.notificationOperationStatsInfo(dto); + } + } + + + + + + // 贵州推送充电站统计信息 - try { + /* try { String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(); List stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType); @@ -369,7 +397,7 @@ public class JsowellTask { } } catch (Exception e) { log.error("吉林省平台推送充电站用能统计失败", e); - } + }*/ } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/NotificationService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/NotificationService.java index 1bb3941ec..0ae600f70 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/NotificationService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/NotificationService.java @@ -390,4 +390,37 @@ public class NotificationService { } } } + + + /** + * 推送站点用能统计信息 + * @param dto + */ + public void notificationOperationStatsInfo(NotificationDTO dto) { + String stationId = dto.getStationId(); + String platformType = dto.getPlatformType(); + if (StringUtils.isBlank(stationId)) { + throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR); + } + // 通过stationId 查询该站点需要对接的平台配置 + List secretInfoVOS = thirdpartySecretInfoService.queryStationToPlatformList(stationId); + if (CollectionUtils.isEmpty(secretInfoVOS)) { + return; + } + // 调用相应平台的处理方法 + for (ThirdPartySecretInfoVO secretInfoVO : secretInfoVOS) { + if (StringUtils.isNotBlank(platformType) && !StringUtils.equals(platformType, secretInfoVO.getPlatformType())) { + // 如果dto中的platformType不为空,并且不等于secretInfoVO.getPlatformType(),continue + continue; + } + try { + // 根据平台类型获取Service + ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType()); + platformService.notificationOperationStatsInfo(stationId); + } catch (Exception e) { + logger.error("推送充换电站用能统计信息error", e); + } + } + } + } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/JiLinPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/JiLinPlatformServiceImpl.java index 2679f1a53..2913a14ef 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/JiLinPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/JiLinPlatformServiceImpl.java @@ -1282,7 +1282,11 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { } - + /** + * 推送站点统计信息 notification_station_stats_info + * @param stationId + * @return + */ @Override public String notificationOperationStatsInfo(String stationId) { // 1. 获取统计时间范围(前一日的00:00:00至23:59:59)