This commit is contained in:
YAS\29473
2025-05-21 17:12:42 +08:00
parent 669ec6a68e
commit 80342da5f8
3 changed files with 48 additions and 2 deletions

View File

@@ -113,7 +113,8 @@ public class RemoteStartChargingRequestHandler extends AbstractYkcHandler {
}
try {
// 启动结果回复
commonService.commonPushStartChargeResult(orderInfo);
// commonService.commonPushStartChargeResult(orderInfo);
commonService.commonPushStartChargeResultV2(orderInfo);
} catch (Exception e) {
e.printStackTrace();
}
@@ -121,7 +122,7 @@ public class RemoteStartChargingRequestHandler extends AbstractYkcHandler {
if (StringUtils.equals(startResult, Constants.DOUBLE_ZERO)) {
try {
Thread.sleep(500);
commonService.commonPushOrderInfo(orderInfo);
commonService.commonPushOrderInfoV2(orderInfo);
} catch (Exception e) {
log.error("统一推送第三方平台订单信息error, ", e);
}

View File

@@ -545,6 +545,23 @@ public class CommonService {
}
}
public void commonPushStartChargeResultV2(OrderBasicInfo orderBasicInfo) {
String stationId = orderBasicInfo.getStationId();
// 查询该站点是否推送第三方平台
List<ThirdPartySecretInfoVO> relationInfoList = thirdpartySecretInfoService.queryStationToPlatformList(stationId);
// ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
if (CollectionUtils.isEmpty(relationInfoList)) {
return;
}
for (ThirdPartySecretInfoVO relationVO : relationInfoList) {
NotificationDTO dto = new NotificationDTO();
dto.setStationId(stationId);
dto.setPlatformType(relationVO.getPlatformType());
dto.setOrderCode(orderBasicInfo.getOrderCode());
notificationService.commonPushStartChargeResult(dto);
}
}
/**
* 统一推送告警信息
* @param pileConnectorCode

View File

@@ -173,6 +173,34 @@ public class NotificationService {
}
}
public void commonPushStartChargeResult(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.notificationStartChargeResult(orderCode);
} catch (Exception e) {
logger.error("充电订单信息推送error", e);
}
}
}
/**
* 站点功率信息推送
* notification_orderInfo/notification_charge_order_info