新增 浙江省平台推送历史充电订单接口

This commit is contained in:
Lemon
2024-08-19 14:29:37 +08:00
parent 723be8d54b
commit 381fed9d29
6 changed files with 129 additions and 14 deletions

View File

@@ -224,4 +224,36 @@ public class NotificationService {
}
}
}
/**
* 历史充电订单信息推送
* notification_orderInfo/notification_charge_order_info
*/
public void notificationChargeOrderInfoHistory(NotificationDTO dto) {
String stationId = dto.getStationId();
String orderCode = dto.getOrderCode();
String platformType = dto.getPlatformType();
if (StringUtils.isBlank(stationId) || StringUtils.isBlank(orderCode)) {
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.notificationChargeOrderInfoHistory(orderCode);
} catch (Exception e) {
logger.error("历史充电订单信息推送error", e);
}
}
}
}