# Conflicts:
#	jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java
This commit is contained in:
2024-03-26 17:13:26 +08:00
4 changed files with 94 additions and 35 deletions

View File

@@ -314,8 +314,31 @@ public class OrderService {
if (!StringUtils.equals(orderInfo.getMemberId(), dto.getMemberId())) {
throw new BusinessException(ReturnCodeEnum.CODE_ORDER_MEMBER_NOT_MATCH_ERROR);
}
// 判断该桩所在的站点是否推送了第三方站点(需要我方平台发送启动指令的,如:华为平台)
List<ThirdPartyStationRelationVO> relationInfoList = thirdPartyStationRelationService.getRelationInfoList(orderInfo.getStationId());
if (CollectionUtils.isNotEmpty(relationInfoList)) {
for (ThirdPartyStationRelationVO vo : relationInfoList) {
String startMode = vo.getStartMode();
if (StringUtils.equals(Constants.ONE, startMode)) {
// 启动类型为 1 的即为对接了类似华为平台,需要调用第三方平台的统一停止充电接口
ThirdPartyCommonStopChargeDTO commonStopChargeDTO = new ThirdPartyCommonStopChargeDTO();
commonStopChargeDTO.setThirdPartyType(vo.getThirdPartyType());
commonStopChargeDTO.setOrderBasicInfo(orderInfo);
// 调用统一停止充电接口
String result = commonService.commonStopCharge(commonStopChargeDTO);
log.info("订单:{}调用第三方平台统一停止充电接口,调用结果 SuccStat:{}", orderInfo.getOrderCode(), result);
}else {
// 发送停止指令
pileRemoteService.remoteStopCharging(orderInfo.getPileSn(), orderInfo.getConnectorCode(), orderInfo.getTransactionCode());
}
}
}else {
// 发送停止指令
pileRemoteService.remoteStopCharging(orderInfo.getPileSn(), orderInfo.getConnectorCode(), orderInfo.getTransactionCode());
}
// 发送停止指令
pileRemoteService.remoteStopCharging(orderInfo.getPileSn(), orderInfo.getConnectorCode(), orderInfo.getTransactionCode());
// pileRemoteService.remoteStopCharging(orderInfo.getPileSn(), orderInfo.getConnectorCode(), orderInfo.getTransactionCode());
log.info("订单号:{}发送停机指令成功", dto.getOrderCode());
}