mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user