From cad8d3cdcb6253ef719bb9c85391df7d90d5ac59 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 21 五月 2025 14:44:55 +0800 Subject: [PATCH] 新增公交的接口对接 --- ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPBaseMsgVehicleAddedAck.java | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPBaseMsgVehicleAddedAck.java b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPBaseMsgVehicleAddedAck.java index fab49ac..f4d3df1 100644 --- a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPBaseMsgVehicleAddedAck.java +++ b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPBaseMsgVehicleAddedAck.java @@ -38,15 +38,19 @@ * 解析报文 */ public UPBaseMsgVehicleAddedAck decode(BaseMsg baseMsg) { - byte[] data = baseMsg.getData(); - ByteBuf byteBuf = Unpooled.wrappedBuffer(data); - this.vehicleNo = baseMsg.getVehicleNo(); - this.vehicleColor = baseMsg.getVehicleColor(); - this.dataType = baseMsg.getDataType(); - this.dataLength = baseMsg.getDataLength(); - - //车辆信息 - this.carInfo = Jtt809Util.readGBKString(byteBuf, baseMsg.getDataLength()); + try { + byte[] data = baseMsg.getData(); + ByteBuf byteBuf = Unpooled.wrappedBuffer(data); + this.vehicleNo = baseMsg.getVehicleNo(); + this.vehicleColor = baseMsg.getVehicleColor(); + this.dataType = baseMsg.getDataType(); + this.dataLength = baseMsg.getDataLength(); + + //车辆信息 + this.carInfo = Jtt809Util.readGBKString(byteBuf, baseMsg.getDataLength()); + }catch (Exception e){ + e.printStackTrace(); + } return this; } } -- Gitblit v1.7.1