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

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

@@ -273,9 +273,9 @@ public class CommonService {
if (StringUtils.equals(connectorStatus, "03")) {
// 充电中
lianLianService.pushPileChargeStatusChange(orderInfo.getOrderCode());
// 推送充电状态
lianLianService.pushChargeStatus(orderInfo.getOrderCode());
}
// 推送充电状态
lianLianService.pushChargeStatus(orderInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode(), thirdPartyType)) {
// 中电联
@@ -422,12 +422,6 @@ public class CommonService {
return;
}
// 查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
if (Objects.isNull(orderInfo)) {
return;
}
// 推送
for (ThirdPartySecretInfoVO thirdPartySecretInfoVO : thirdPartySecretInfoVOS) {
NotificationDTO dto = new NotificationDTO();
@@ -435,11 +429,17 @@ public class CommonService {
dto.setPileConnectorCode(pileConnectorCode);
dto.setStatus(changedStatus);
dto.setPlatformType(thirdPartySecretInfoVO.getPlatformType());
dto.setOrderCode(orderInfo.getOrderCode());
notificationService.notificationConnectorChargeStatus(dto);
notificationService.notificationStationStatus(dto);
// 查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
if (Objects.isNull(orderInfo)) {
return;
}
dto.setOrderCode(orderInfo.getOrderCode());
notificationService.notificationConnectorChargeStatus(dto);
}
}

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);
}
}
}
}