From fd74ab1958c336d1087037c516dfa3e8b8d3d61e Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 06 八月 2025 11:13:26 +0800 Subject: [PATCH] 修改bug --- ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/DOWNWarnMsgUrgeTodoReq.java | 39 +++++++++++++++++++++++++++++---------- 1 files changed, 29 insertions(+), 10 deletions(-) diff --git a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/DOWNWarnMsgUrgeTodoReq.java b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/DOWNWarnMsgUrgeTodoReq.java index 80b2a81..8315a6b 100644 --- a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/DOWNWarnMsgUrgeTodoReq.java +++ b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/DOWNWarnMsgUrgeTodoReq.java @@ -5,6 +5,7 @@ import io.netty.buffer.Unpooled; import lombok.Data; +import java.io.UnsupportedEncodingException; import java.time.LocalDateTime; import java.time.ZoneOffset; @@ -79,17 +80,15 @@ public DOWNWarnMsgUrgeTodoReq build(UPWarnMsgAdptInfo upWarnMsgAdptInfo) { this.vehicleNo = upWarnMsgAdptInfo.getVehicleNo(); this.vehicleColor = upWarnMsgAdptInfo.getVehicleColor(); - this.dataType = upWarnMsgAdptInfo.getDataType(); - this.dataLength = upWarnMsgAdptInfo.getDataLength(); this.warnSrc = upWarnMsgAdptInfo.getWarnSrc(); this.warnType = upWarnMsgAdptInfo.getWarnType(); this.warnTime = upWarnMsgAdptInfo.getWarnTime(); - this.supervisionId = upWarnMsgAdptInfo.getInfoId(); + this.supervisionId = Integer.valueOf(upWarnMsgAdptInfo.getInfoId()); this.supervisionEndTime = LocalDateTime.now().plusDays(7).toEpochSecond(ZoneOffset.UTC); this.supervisionLevel = 0x01; - this.supervisor = "admin"; - this.supervisorTel = ""; - this.supervisorEmail = ""; + this.supervisor = "谢茜"; + this.supervisorTel = "18808258011"; + this.supervisorEmail = "1360001080@qq.com"; return this; } @@ -99,7 +98,12 @@ */ public byte[] encode() { ByteBuf byteBuf = Unpooled.buffer(120); - byte[] bytes1 = this.getVehicleNo().getBytes(); + byte[] bytes1 = new byte[0]; + try { + bytes1 = this.getVehicleNo().getBytes("GBK"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } for (int i = 0; i < 21; i++) { if (i < bytes1.length) { byteBuf.writeByte(bytes1[i]); @@ -116,7 +120,12 @@ byteBuf.writeInt(this.getSupervisionId()); byteBuf.writeLong(this.getSupervisionEndTime()); byteBuf.writeByte(this.getSupervisionLevel()); - byte[] bytes2 = this.getSupervisor().getBytes(); + byte[] bytes2 = new byte[0]; + try { + bytes2 = this.getSupervisor().getBytes("GBK"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } for (int i = 0; i < 16; i++) { if (i < bytes2.length) { byteBuf.writeByte(bytes2[i]); @@ -124,7 +133,12 @@ byteBuf.writeByte(0x00); } } - byte[] bytes3 = this.getSupervisorTel().getBytes(); + byte[] bytes3 = new byte[0]; + try { + bytes3 = this.getSupervisorTel().getBytes("GBK"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } for (int i = 0; i < 20; i++) { if (i < bytes3.length) { byteBuf.writeByte(bytes3[i]); @@ -132,7 +146,12 @@ byteBuf.writeByte(0x00); } } - byte[] bytes4 = this.getSupervisorEmail().getBytes(); + byte[] bytes4 = new byte[0]; + try { + bytes4 = this.getSupervisorEmail().getBytes("GBK"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } for (int i = 0; i < 32; i++) { if (i < bytes4.length) { byteBuf.writeByte(bytes4[i]); -- Gitblit v1.7.1