From 35b0088fa28dab8a28758dcbcc056620c1ea5e2c Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期五, 30 五月 2025 11:02:35 +0800 Subject: [PATCH] 修改公交公司的事件订阅功能 --- ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPConnectReq.java | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPConnectReq.java b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPConnectReq.java index 712dc7f..0955f77 100644 --- a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPConnectReq.java +++ b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPConnectReq.java @@ -1,10 +1,12 @@ package com.ruoyi.dataInterchange.model; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; +import io.netty.buffer.ByteBuf; import lombok.Data; /** - * 住链路登录请求 + * 主链路登录请求 + * * @author zhibing.pu * @Date 2025/2/24 10:43 */ @@ -13,26 +15,35 @@ /** * 用户名 */ - @JsonProperty("USERID") - private String userId; + private int userId; /** * 密码 */ - @JsonProperty("PASSWORD") private String password; - /** - * 下级平台接入码,上级平台给下级平台分配的唯一标识号 - */ - @JsonProperty("MSG_GNSSCENTERID") - private String msgGnsscenterid; /** * 下级平台提供对应的从链路服务端IP地址 */ - @JsonProperty("DOWN_LINK_IP") private String downLinkIp; /** * 下级平台提供对应的从链路服务端端口号 */ - @JsonProperty("DOWN_LINK_PORT") - private String downLinkPort; + private int downLinkPort; + + + /** + * 解析登录报文 + */ + public UPConnectReq decode(ByteBuf byteBuf) { + try { + this.userId = byteBuf.readInt(); + this.password = Jtt809Util.readGBKString(byteBuf, 8); + this.downLinkIp = Jtt809Util.readGBKString(byteBuf, 32); + this.downLinkPort = byteBuf.readUnsignedShort(); + }catch (Exception e){ + e.printStackTrace(); + } + return this; + } + + } -- Gitblit v1.7.1