mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update
This commit is contained in:
@@ -323,8 +323,36 @@ public class JsowellTask {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> thirdPartyTypeList = Lists.newArrayList(ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(),
|
||||||
|
ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(),
|
||||||
|
ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode()
|
||||||
|
);
|
||||||
|
|
||||||
|
for (String thirdPartyType : thirdPartyTypeList) {
|
||||||
|
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType);
|
||||||
|
if (CollectionUtils.isEmpty(stationInfoVOS)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> 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();
|
String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode();
|
||||||
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType);
|
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType);
|
||||||
|
|
||||||
@@ -369,7 +397,7 @@ public class JsowellTask {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("吉林省平台推送充电站用能统计失败", e);
|
log.error("吉林省平台推送充电站用能统计失败", e);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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<ThirdPartySecretInfoVO> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1282,7 +1282,11 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送站点统计信息 notification_station_stats_info
|
||||||
|
* @param stationId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String notificationOperationStatsInfo(String stationId) {
|
public String notificationOperationStatsInfo(String stationId) {
|
||||||
// 1. 获取统计时间范围(前一日的00:00:00至23:59:59)
|
// 1. 获取统计时间范围(前一日的00:00:00至23:59:59)
|
||||||
|
|||||||
Reference in New Issue
Block a user