mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
添加临时日志
This commit is contained in:
@@ -47,6 +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();
|
||||
@@ -104,7 +105,6 @@ public class RemoteStartChargingRequestHandler extends AbstractYkcHandler {
|
||||
}
|
||||
// orderBasicInfoService.updateOrderBasicInfo(orderInfo);
|
||||
log.info("远程启动充电命令回复-交易流水号:{}, 桩编码:{}, 枪号:{}, 启动结果(00-失败, 01-成功):{}, 失败原因:{}", transactionCode, pileSn, connectorCode, startResult, failedReasonMsg);
|
||||
log.info("[===远程启动充电命令回复===] 111111111");
|
||||
// 异步推送第三方平台
|
||||
CompletableFuture.runAsync(() -> {
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
||||
|
||||
@@ -144,6 +144,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
|
||||
BytesUtil.binary(ykcDataProtocol.getBytes(), 16));
|
||||
}
|
||||
// 处理数据
|
||||
log.info("开始处理数据");
|
||||
byte[] response = ykcService.process(ykcDataProtocol, ctx);
|
||||
if (Objects.nonNull(response)) {
|
||||
// 响应客户端
|
||||
|
||||
@@ -53,14 +53,23 @@ 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user