mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 打印日志
This commit is contained in:
@@ -69,8 +69,9 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
public boolean push(byte[] msg, String pileSn, Enum<YKCFrameTypeCode> frameTypeCode) {
|
||||
// 通过桩编号获取channel
|
||||
Channel channel = PileChannelEntity.getChannelByPileSn(pileSn);
|
||||
String value = ((YKCFrameTypeCode) frameTypeCode).getValue();
|
||||
if (Objects.isNull(channel)) {
|
||||
log.error("push命令[{}]失败, 桩号:{}无法获取到长连接, 请检查充电桩连接状态!", ((YKCFrameTypeCode) frameTypeCode).getValue(), pileSn);
|
||||
log.error("push命令[{}]失败, 桩号:{}无法获取到长连接, 请检查充电桩连接状态!", value, pileSn);
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
@@ -108,12 +109,12 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
public void operationComplete(ChannelFuture channelFuture) throws Exception {
|
||||
// 检查操作的状态
|
||||
if (channelFuture.isSuccess()) {
|
||||
log.info("push结果【成功】, remoteAddress:{}, channelId:{}, 报文:{}, ", channel.remoteAddress(), channel.id(), wholeMsg);
|
||||
log.info("push结果【成功】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}, ", channel.remoteAddress(), channel.id(), value, wholeMsg);
|
||||
} else {
|
||||
// 如果发生错误,则访问描述原因的Throwable
|
||||
Throwable cause = channelFuture.cause();
|
||||
// cause.printStackTrace();
|
||||
log.info("push结果【失败】, remoteAddress:{}, channelId:{}, 报文:{}", channel.remoteAddress(), channel.id(), wholeMsg);
|
||||
log.info("push结果【失败】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}", channel.remoteAddress(), channel.id(), value, wholeMsg);
|
||||
log.error("push发送命令失败", cause);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user