From 66dd65d84fccde41127914ee1aa0aaaaf231b5eb Mon Sep 17 00:00:00 2001 From: "YAS\\29473" <2947326429@qq.com> Date: Thu, 22 May 2025 14:26:27 +0800 Subject: [PATCH] update --- .../RemoteStartChargingRequestHandler.java | 2 +- .../server/yunkuaichong/NettyServerHandler.java | 1 - .../yunkuaichong/impl/YKCBusinessServiceImpl.java | 10 +--------- .../strategy/ykc/RemoteStartChargingStrategy.java | 9 ++++----- .../service/impl/LianLianPlatformServiceImpl.java | 12 ++++++------ 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/RemoteStartChargingRequestHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/RemoteStartChargingRequestHandler.java index e0fb91d23..7c33969e0 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/RemoteStartChargingRequestHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/RemoteStartChargingRequestHandler.java @@ -47,7 +47,7 @@ public class RemoteStartChargingRequestHandler extends AbstractYkcHandler { @Override public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext channel) { - log.info("[===远程启动充电命令回复===] start"); + // log.info("[===远程启动充电命令回复===] param:{}, channel:{}", JSON.toJSONString(ykcDataProtocol), channel.toString()); // 消息体 byte[] msgBody = ykcDataProtocol.getMsgBody(); diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerHandler.java index a8ac8f3a6..a049504ee 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerHandler.java @@ -144,7 +144,6 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { BytesUtil.binary(ykcDataProtocol.getBytes(), 16)); } // 处理数据 - log.info("开始处理数据"); byte[] response = ykcService.process(ykcDataProtocol, ctx); if (Objects.nonNull(response)) { // 响应客户端 diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/service/yunkuaichong/impl/YKCBusinessServiceImpl.java b/jsowell-netty/src/main/java/com/jsowell/netty/service/yunkuaichong/impl/YKCBusinessServiceImpl.java index a9a6fe64a..9e079bf77 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/service/yunkuaichong/impl/YKCBusinessServiceImpl.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/service/yunkuaichong/impl/YKCBusinessServiceImpl.java @@ -53,23 +53,15 @@ public class YKCBusinessServiceImpl implements YKCBusinessService { @Override 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)) { // 校验不通过,丢弃消息 return null; } // 获取帧类型 String frameType = YKCUtils.frameType2Str(ykcDataProtocol.getFrameType()); - log.info("获取帧类型:{}" , frameType); + // 获取业务处理handler AbstractYkcHandler invokeStrategy = YKCOperateFactory.getInvokeStrategy(frameType); // 老逻辑 - log.info("获取业务处理handler:{}" , invokeStrategy); // AbstractYkcStrategy invokeStrategy = ykcOperateFactoryV2.getInvokeStrategy(frameType); // 新逻辑 return invokeStrategy.supplyProcess(ykcDataProtocol, ctx); } diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/strategy/ykc/RemoteStartChargingStrategy.java b/jsowell-netty/src/main/java/com/jsowell/netty/strategy/ykc/RemoteStartChargingStrategy.java index ef0e6aa89..9efb50731 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/strategy/ykc/RemoteStartChargingStrategy.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/strategy/ykc/RemoteStartChargingStrategy.java @@ -105,7 +105,7 @@ public class RemoteStartChargingStrategy implements AbstractYkcStrategy { } // orderBasicInfoService.updateOrderBasicInfo(orderInfo); log.info("远程启动充电命令回复-交易流水号:{}, 桩编码:{}, 枪号:{}, 启动结果(00-失败, 01-成功):{}, 失败原因:{}", transactionCode, pileSn, connectorCode, startResult, failedReasonMsg); - log.info("[===远程启动充电命令回复===] 2222222"); + // 异步推送第三方平台 CompletableFuture.runAsync(() -> { OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode); @@ -114,9 +114,8 @@ public class RemoteStartChargingStrategy implements AbstractYkcStrategy { } try { // 启动结果回复 -// commonService.commonPushStartChargeResult(orderInfo); - commonService.commonPushStartChargeResultV2(orderInfo); - log.info("异步推送第三方平台订单信息成功"); + commonService.commonPushStartChargeResult(orderInfo); + } catch (Exception e) { e.printStackTrace(); } @@ -124,7 +123,7 @@ public class RemoteStartChargingStrategy implements AbstractYkcStrategy { if (StringUtils.equals(startResult, Constants.DOUBLE_ZERO)) { try { Thread.sleep(500); - commonService.commonPushOrderInfoV2(orderInfo); + commonService.commonPushOrderInfo(orderInfo); } catch (Exception e) { log.error("统一推送第三方平台订单信息error, ", e); } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java index 1393b40ea..a5cc39b6f 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java @@ -333,9 +333,9 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { // 如果是希晓运营商,则把equipmentOwnerID换成希晓 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); - } + }*/ List pileList = pileBasicInfoService.getPileListForLianLian(stationId); if (CollectionUtils.isNotEmpty(pileList)) { @@ -606,9 +606,9 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { // 如果是希晓运营商,则把equipmentOwnerID换成希晓 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); - } + }*/ String payment = StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment()); info.setPayment(payment); if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) { @@ -966,10 +966,10 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { // 远大 orderInfo.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA); } - if (MerchantUtils.isZhiHeMerchant(orderBasicInfo.getMerchantId())) { +/* if (MerchantUtils.isZhiHeMerchant(orderBasicInfo.getMerchantId())) { logger.info("订单号:{} 为之禾运营商订单", orderBasicInfo.getOrderCode()); orderInfo.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE); - } + }*/ // 支付方式 if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) { // 微信支付