mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-20 15:19:52 +08:00
新增 第三方平台统一停止充电接口
This commit is contained in:
@@ -314,8 +314,31 @@ public class OrderService {
|
|||||||
if (!StringUtils.equals(orderInfo.getMemberId(), dto.getMemberId())) {
|
if (!StringUtils.equals(orderInfo.getMemberId(), dto.getMemberId())) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_ORDER_MEMBER_NOT_MATCH_ERROR);
|
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());
|
log.info("订单号:{}发送停机指令成功", dto.getOrderCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.jsowell.pile.dto;
|
||||||
|
|
||||||
|
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO
|
||||||
|
*
|
||||||
|
* @author Lemon
|
||||||
|
* @Date 2024/3/26 8:30:01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ThirdPartyCommonStopChargeDTO {
|
||||||
|
private String thirdPartyType;
|
||||||
|
|
||||||
|
private OrderBasicInfo orderBasicInfo;
|
||||||
|
}
|
||||||
@@ -22,6 +22,7 @@ import com.jsowell.pile.domain.ThirdPartyStationRelation;
|
|||||||
import com.jsowell.pile.domain.ThirdpartyParkingConfig;
|
import com.jsowell.pile.domain.ThirdpartyParkingConfig;
|
||||||
import com.jsowell.pile.dto.PushStationInfoDTO;
|
import com.jsowell.pile.dto.PushStationInfoDTO;
|
||||||
import com.jsowell.pile.dto.ThirdPartyCommonStartChargeDTO;
|
import com.jsowell.pile.dto.ThirdPartyCommonStartChargeDTO;
|
||||||
|
import com.jsowell.pile.dto.ThirdPartyCommonStopChargeDTO;
|
||||||
import com.jsowell.pile.dto.huawei.HWQueryStartChargeDTO;
|
import com.jsowell.pile.dto.huawei.HWQueryStartChargeDTO;
|
||||||
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
|
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
|
||||||
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
|
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
|
||||||
@@ -282,15 +283,15 @@ public class CommonService {
|
|||||||
String result = xdtService.notificationEquipChargeStatus(orderInfo.getOrderCode());
|
String result = xdtService.notificationEquipChargeStatus(orderInfo.getOrderCode());
|
||||||
log.info("推送新电途平台 充电状态 result:{}", result);
|
log.info("推送新电途平台 充电状态 result:{}", result);
|
||||||
}
|
}
|
||||||
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
|
// if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
|
||||||
// 华为平台
|
// // 华为平台
|
||||||
huaWeiService.notificationStationStatus(pileConnectorCode, changedStatus);
|
// huaWeiService.notificationStationStatus(pileConnectorCode, changedStatus);
|
||||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
// OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
||||||
if (orderInfo == null) {
|
// if (orderInfo == null) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
huaWeiService.notificationEquipChargeStatus(orderInfo.getOrderCode());
|
// huaWeiService.notificationEquipChargeStatus(orderInfo.getOrderCode());
|
||||||
}
|
// }
|
||||||
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), thirdPartyType)) {
|
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), thirdPartyType)) {
|
||||||
// 海南平台
|
// 海南平台
|
||||||
haiNanChargeService.notificationStationStatus(pileConnectorCode, changedStatus);
|
haiNanChargeService.notificationStationStatus(pileConnectorCode, changedStatus);
|
||||||
@@ -554,6 +555,24 @@ public class CommonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一停止充电
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String commonStopCharge(ThirdPartyCommonStopChargeDTO dto) {
|
||||||
|
OrderBasicInfo orderBasicInfo = dto.getOrderBasicInfo();
|
||||||
|
String thirdPartyType = dto.getThirdPartyType();
|
||||||
|
|
||||||
|
// 判断平台类型
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
|
||||||
|
QueryStartChargeVO vo = huaweiServiceV2.queryStopCharge(orderBasicInfo.getOrderCode());
|
||||||
|
return String.valueOf(vo.getSuccStat());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转换枪口状态
|
* 转换枪口状态
|
||||||
|
|||||||
@@ -382,10 +382,10 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws UnsupportedEncodingException {
|
public static void main(String[] args) throws UnsupportedEncodingException {
|
||||||
String dataSecret = "E6gnWuz0QzBW75CR"; // SPBNJ1Z5EQNmpK08 VTAEKDPVN9CUS7WO huawei: zd4NrLWJ38XCTaqP E6gnWuz0QzBW75CR
|
String dataSecret = "pJahbxk8wG79CMDB"; // SPBNJ1Z5EQNmpK08 VTAEKDPVN9CUS7WO huawei: zd4NrLWJ38XCTaqP E6gnWuz0QzBW75CR 正式:NHsBDtTanA60vTIu pJahbxk8wG79CMDB
|
||||||
String dataSecretIV = "SXejaSUx5yud8UHm"; // peRoTcb2C7zqKeII 83UZFFRRZDYNF5CR huawei: RJJecvNTJ48SGMG7 SXejaSUx5yud8UHm
|
String dataSecretIV = "y259VRq7h8RyFXmT"; // peRoTcb2C7zqKeII 83UZFFRRZDYNF5CR huawei: RJJecvNTJ48SGMG7 SXejaSUx5yud8UHm 正式:2uyE2Cgu4nVf6egc y259VRq7h8RyFXmT
|
||||||
String signSecret = "sRjCDeokckFGpYpA"; // sRjCDeokckFGpYpA
|
String signSecret = "sRjCDeokckFGpYpA"; // sRjCDeokckFGpYpA
|
||||||
String dataString = "GZlmSIZOVzT+Yvpc2PmvNmwKXhaqSnsNdCUS61pq9BxES7v9FWNrUvqk3OsAUMPvjCwmYeskIglHXw0OFfYGZ1bXxAzHymzsqfehZ10WoNs=";
|
String dataString = "ESOi5BHD3GIr3bEN8VTQsvSyj6P8nICQF0+sk8pqaGJ/z9Y4bJK+UPLBYNZze7De5GKDsVcM/V8rfx3DG+yDqLkpq4vSNm6LFzpk/U6WQF1Z7n+8NrqTDCEtFTYmiF7qhZPng550UpLg3rU6G9CXQw==";
|
||||||
|
|
||||||
// 解密data
|
// 解密data
|
||||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
|
|||||||
Reference in New Issue
Block a user