update 将 0x19 中推送停止充电结果逻辑放到 0x3B 中

This commit is contained in:
Lemon
2024-01-11 09:51:39 +08:00
parent 3bc7522428
commit 4dbdaa3828
4 changed files with 74 additions and 29 deletions

View File

@@ -138,34 +138,36 @@ public class ChargeEndHandler extends AbstractHandler{
}
orderBasicInfoService.updateOrderBasicInfo(orderInfo);
try {
// 查询该站点是否已对接互联互通平台,如果对接则发送充电结束
// 通过站点id查询相关配置信息
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
relation.setStationId(Long.parseLong(orderInfo.getStationId()));
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
// ThirdPartySettingInfo info = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
if (Objects.isNull(relationInfo)) {
return null;
}
// 联联平台
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), relationInfo.getThirdPartyType())) {
// 推送停止充电结果
lianLianService.pushStopChargeResult(orderInfo.getOrderCode());
}
// 新电途平台
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), relationInfo.getThirdPartyType())) {
// 推送停止充电结果
xdtService.notificationStopChargeResult(orderInfo.getOrderCode());
}
// 甬城泊车平台
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), relationInfo.getThirdPartyType())) {
ycbcService.pushStopChargeResult(orderInfo.getOrderCode());
}
// 以下推送停止充电信息逻辑已全部放到 0x3B 帧中 --2024年1月11日
} catch (Exception e) {
log.error("联联平台推送停止充电结果异常", e);
}
// try {
// // 查询该站点是否已对接互联互通平台,如果对接则发送充电结束
// // 通过站点id查询相关配置信息
// ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
// relation.setStationId(Long.parseLong(orderInfo.getStationId()));
// ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
// // ThirdPartySettingInfo info = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
// if (Objects.isNull(relationInfo)) {
// return null;
// }
// // 联联平台
// if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), relationInfo.getThirdPartyType())) {
// // 推送停止充电结果
// lianLianService.pushStopChargeResult(orderInfo.getOrderCode());
// }
// // 新电途平台
// if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), relationInfo.getThirdPartyType())) {
// // 推送停止充电结果
// xdtService.notificationStopChargeResult(orderInfo.getOrderCode());
// }
// // 甬城泊车平台
// if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), relationInfo.getThirdPartyType())) {
// ycbcService.pushStopChargeResult(orderInfo.getOrderCode());
// }
//
// } catch (Exception e) {
// log.error("联联平台推送停止充电结果异常", e);
// }
}

View File

@@ -699,6 +699,8 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
lianLianService.pushOrderInfo(orderBasicInfo.getOrderCode());
// 推送充电订单信息
lianLianService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
// 推送停止充电结果
lianLianService.pushStopChargeResult(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
// 中电联
@@ -713,6 +715,8 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
// 新电途平台
// 推送订单信息
xdtService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
// 推送停止充电结果
xdtService.notificationStopChargeResult(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
@@ -721,6 +725,8 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
log.info("甬城泊车平台 推送充电订单信息 param:{}", orderBasicInfo.getOrderCode());
String result = ycbcService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
log.info("甬城泊车平台 推送充电订单信息 result:{}", result);
// 推送停止充电结果
ycbcService.pushStopChargeResult(orderBasicInfo.getOrderCode());
}
}
// 调用相关接口

View File

@@ -0,0 +1,37 @@
package com.jsowell.thirdparty.huawei;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO;
import java.io.UnsupportedEncodingException;
import java.util.Map;
/**
* TODO
*
* @author Lemon
* @Date 2024/1/11 9:06:52
*/
public interface HuaWeiService {
/**
* 获取令牌
* @param dto
* @return
*/
public String ZDLGetToken(ZDLGetTokenDTO dto);
/**
* 生成token
* @param dto
* @return
*/
Map<String, String> generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException;
/**
* 校验签名
* @param dto
*/
Map<String, String> checkoutSign(CommonParamsDTO dto);
}

View File

@@ -255,8 +255,8 @@ public class LianLianServiceImpl implements LianLianService {
String dataSecret = "KnGhAb88GtUEPb0j"; // SPBNJ1Z5EQNmpK08 VTAEKDPVN9CUS7WO
String dataSecretIV = "XZ4wURhuo2y8s4ZS"; // peRoTcb2C7zqKeII 83UZFFRRZDYNF5CR
String signSecret = "sRjCDeokckFGpYpA"; // sRjCDeokckFGpYpA
String dataString = "8fbtEjMo7IMQt1vNuVEgENBjZXvxVMjCBfZvlwWVQlIb9qj1yq8ciqmoTLbvxgCj/FrzAnQIwiVXZi170Rh7mnZtFmYNqKck0Y2K4sp0pvgxCFzw4wxqpbro/wgrqjDt7N3gIS+aHsJBw/U\n" +
"O1CQaQGQJPVoEKohmiKl84sRLXqtjPJycNon4VydOVFBlwjSRTmWTO2jqXApaNfsg2vALdtoLe/b65q6P1TPGCUpJrpM=";
String dataString = "pZLkdIJdqGhgVcTEhSQXv7VBj9jRQ+Cjy49RPHeuFkFZreXmtD20J/yVyOKw2GtC5rt7NT20dANzPKIw4GVYrqsBsSaGKZuFTbn7KKf//Jdj5CgBNtGgS5H6wD6F41zHnGegmo\n" +
"hhWPW7WcVBow3CL87rGOaqnOWyLXLh9FlOs9WLtZdIbC47n8agmp7Pcx99Bu7n8e5+lUz1s7NZCsJoknrUl4EhONzGgKu8Hos2W34n7AOM3IzTR/oHBVJtg0cjvnj0zKbweGmTWbIWrY3sJQ==";
// 解密data
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());