update 浙江省平台接口

This commit is contained in:
Lemon
2024-08-15 15:31:43 +08:00
parent f9dabe16bb
commit bbed186e1a
6 changed files with 104 additions and 45 deletions

View File

@@ -1,5 +1,6 @@
package com.jsowell.thirdparty.common;
import com.google.common.collect.Lists;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.StringUtils;
@@ -116,15 +117,19 @@ public class NotificationService {
// 如果dto中的platformType不为空并且不等于secretInfoVO.getPlatformType()continue
continue;
}
// 根据平台类型获取Service
ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType());
try {
// 根据平台类型获取Service
ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType());
platformService.notificationConnectorChargeStatus(orderCode, secretInfoVO);
platformService.notificationEquipChargeStatus(orderCode);
} catch (Exception e) {
logger.error("设备充电中状态变化推送error:", e);
}
try {
platformService.notificationEquipChargeStatus(orderCode);
}catch (Exception e){
logger.error("notification_equip_charge_status error", e);
}
}
}
@@ -160,6 +165,34 @@ public class NotificationService {
}
}
/**
* 站点功率信息推送
* notification_orderInfo/notification_charge_order_info
*/
public void notificationStationPowerInfo(NotificationDTO dto) {
String stationId = dto.getStationId();
String platformType = dto.getPlatformType();
// 通过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.notificationPowerInfo(Lists.newArrayList(stationId));
} catch (Exception e) {
logger.error("站点功率信息推送error", e);
}
}
}
/**
* 站点费率变化推送
* notification_stationFee