mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-13 06:20:07 +08:00
update
This commit is contained in:
@@ -47,7 +47,7 @@ public class RemoteStartChargingRequestHandler extends AbstractYkcHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext channel) {
|
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext channel) {
|
||||||
log.info("[===远程启动充电命令回复===] start");
|
|
||||||
// log.info("[===远程启动充电命令回复===] param:{}, channel:{}", JSON.toJSONString(ykcDataProtocol), channel.toString());
|
// log.info("[===远程启动充电命令回复===] param:{}, channel:{}", JSON.toJSONString(ykcDataProtocol), channel.toString());
|
||||||
// 消息体
|
// 消息体
|
||||||
byte[] msgBody = ykcDataProtocol.getMsgBody();
|
byte[] msgBody = ykcDataProtocol.getMsgBody();
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
|
|||||||
BytesUtil.binary(ykcDataProtocol.getBytes(), 16));
|
BytesUtil.binary(ykcDataProtocol.getBytes(), 16));
|
||||||
}
|
}
|
||||||
// 处理数据
|
// 处理数据
|
||||||
log.info("开始处理数据");
|
|
||||||
byte[] response = ykcService.process(ykcDataProtocol, ctx);
|
byte[] response = ykcService.process(ykcDataProtocol, ctx);
|
||||||
if (Objects.nonNull(response)) {
|
if (Objects.nonNull(response)) {
|
||||||
// 响应客户端
|
// 响应客户端
|
||||||
|
|||||||
@@ -53,23 +53,15 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx) {
|
public byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx) {
|
||||||
log.info("收到一条YKC协议数据, 帧类型:{}, 长度:{}, 序列号:{}, 加密标识:{}, 帧名称:{}, 报文:{}",
|
|
||||||
YKCUtils.frameType2Str(ykcDataProtocol.getFrameType()),
|
|
||||||
ykcDataProtocol.getLength(),
|
|
||||||
ykcDataProtocol.getSerialNumber(),
|
|
||||||
ykcDataProtocol.getEncryptFlag(),
|
|
||||||
YKCUtils.frameType2Str(ykcDataProtocol.getFrameType()),
|
|
||||||
ykcDataProtocol.getMsgBody());
|
|
||||||
if (!YKCUtils.checkMsg(ykcDataProtocol)) {
|
if (!YKCUtils.checkMsg(ykcDataProtocol)) {
|
||||||
// 校验不通过,丢弃消息
|
// 校验不通过,丢弃消息
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// 获取帧类型
|
// 获取帧类型
|
||||||
String frameType = YKCUtils.frameType2Str(ykcDataProtocol.getFrameType());
|
String frameType = YKCUtils.frameType2Str(ykcDataProtocol.getFrameType());
|
||||||
log.info("获取帧类型:{}" , frameType);
|
|
||||||
// 获取业务处理handler
|
// 获取业务处理handler
|
||||||
AbstractYkcHandler invokeStrategy = YKCOperateFactory.getInvokeStrategy(frameType); // 老逻辑
|
AbstractYkcHandler invokeStrategy = YKCOperateFactory.getInvokeStrategy(frameType); // 老逻辑
|
||||||
log.info("获取业务处理handler:{}" , invokeStrategy);
|
|
||||||
// AbstractYkcStrategy invokeStrategy = ykcOperateFactoryV2.getInvokeStrategy(frameType); // 新逻辑
|
// AbstractYkcStrategy invokeStrategy = ykcOperateFactoryV2.getInvokeStrategy(frameType); // 新逻辑
|
||||||
return invokeStrategy.supplyProcess(ykcDataProtocol, ctx);
|
return invokeStrategy.supplyProcess(ykcDataProtocol, ctx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public class RemoteStartChargingStrategy implements AbstractYkcStrategy {
|
|||||||
}
|
}
|
||||||
// orderBasicInfoService.updateOrderBasicInfo(orderInfo);
|
// orderBasicInfoService.updateOrderBasicInfo(orderInfo);
|
||||||
log.info("远程启动充电命令回复-交易流水号:{}, 桩编码:{}, 枪号:{}, 启动结果(00-失败, 01-成功):{}, 失败原因:{}", transactionCode, pileSn, connectorCode, startResult, failedReasonMsg);
|
log.info("远程启动充电命令回复-交易流水号:{}, 桩编码:{}, 枪号:{}, 启动结果(00-失败, 01-成功):{}, 失败原因:{}", transactionCode, pileSn, connectorCode, startResult, failedReasonMsg);
|
||||||
log.info("[===远程启动充电命令回复===] 2222222");
|
|
||||||
// 异步推送第三方平台
|
// 异步推送第三方平台
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
||||||
@@ -114,9 +114,8 @@ public class RemoteStartChargingStrategy implements AbstractYkcStrategy {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// 启动结果回复
|
// 启动结果回复
|
||||||
// commonService.commonPushStartChargeResult(orderInfo);
|
commonService.commonPushStartChargeResult(orderInfo);
|
||||||
commonService.commonPushStartChargeResultV2(orderInfo);
|
|
||||||
log.info("异步推送第三方平台订单信息成功");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -124,7 +123,7 @@ public class RemoteStartChargingStrategy implements AbstractYkcStrategy {
|
|||||||
if (StringUtils.equals(startResult, Constants.DOUBLE_ZERO)) {
|
if (StringUtils.equals(startResult, Constants.DOUBLE_ZERO)) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
commonService.commonPushOrderInfoV2(orderInfo);
|
commonService.commonPushOrderInfo(orderInfo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("统一推送第三方平台订单信息error, ", e);
|
log.error("统一推送第三方平台订单信息error, ", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -333,9 +333,9 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
// 如果是希晓运营商,则把equipmentOwnerID换成希晓
|
// 如果是希晓运营商,则把equipmentOwnerID换成希晓
|
||||||
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
|
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
|
||||||
}
|
}
|
||||||
if (MerchantUtils.isZhiHeMerchant(String.valueOf(pileStationInfo.getMerchantId()))) {
|
/* if (MerchantUtils.isZhiHeMerchant(String.valueOf(pileStationInfo.getMerchantId()))) {
|
||||||
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
|
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
|
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
|
||||||
if (CollectionUtils.isNotEmpty(pileList)) {
|
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||||
@@ -606,9 +606,9 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
// 如果是希晓运营商,则把equipmentOwnerID换成希晓
|
// 如果是希晓运营商,则把equipmentOwnerID换成希晓
|
||||||
info.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
|
info.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
|
||||||
}
|
}
|
||||||
if (MerchantUtils.isZhiHeMerchant(String.valueOf(pileStationInfo.getMerchantId()))) {
|
/* if (MerchantUtils.isZhiHeMerchant(String.valueOf(pileStationInfo.getMerchantId()))) {
|
||||||
info.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
|
info.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
|
||||||
}
|
}*/
|
||||||
String payment = StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment());
|
String payment = StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment());
|
||||||
info.setPayment(payment);
|
info.setPayment(payment);
|
||||||
if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) {
|
if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) {
|
||||||
@@ -966,10 +966,10 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
// 远大
|
// 远大
|
||||||
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA);
|
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA);
|
||||||
}
|
}
|
||||||
if (MerchantUtils.isZhiHeMerchant(orderBasicInfo.getMerchantId())) {
|
/* if (MerchantUtils.isZhiHeMerchant(orderBasicInfo.getMerchantId())) {
|
||||||
logger.info("订单号:{} 为之禾运营商订单", orderBasicInfo.getOrderCode());
|
logger.info("订单号:{} 为之禾运营商订单", orderBasicInfo.getOrderCode());
|
||||||
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
|
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
|
||||||
}
|
}*/
|
||||||
// 支付方式
|
// 支付方式
|
||||||
if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) {
|
if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) {
|
||||||
// 微信支付
|
// 微信支付
|
||||||
|
|||||||
Reference in New Issue
Block a user