From 3d4eeb82dd61f8951616dece2425e870116bc23d Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 04 四月 2025 15:56:37 +0800 Subject: [PATCH] 提交最终版本和配置线上环境 --- ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPWarnMsgAdptInfo.java | 55 +++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 43 insertions(+), 12 deletions(-) diff --git a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPWarnMsgAdptInfo.java b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPWarnMsgAdptInfo.java index 6647870..8f7756c 100644 --- a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPWarnMsgAdptInfo.java +++ b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPWarnMsgAdptInfo.java @@ -1,7 +1,7 @@ package com.ruoyi.dataInterchange.model; -import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.dataInterchange.pojo.BaseModel; +import com.ruoyi.dataInterchange.util.jtt809.common.ByteArrayUtil; import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; @@ -9,8 +9,6 @@ import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; - -import java.text.ParseException; /** * 上报报警信息 @@ -52,6 +50,15 @@ private int warnSrc; /** * 报警类型 + * 0x0001: 超速报警 + * 0x0002: 疲劳驾驶报警 + * 0x0003: 紧急报警 + * 0x0004: 进入指定区域报警 + * 0x0005: 离开指定区域报警 + * 0x0006: 路段堵塞报警 + * 0x0007: 危险路段报警 + * 0x0008: 越界报警 + * 0x0009: 盗警 */ @Field(type = FieldType.Integer) private int warnType; @@ -75,6 +82,35 @@ */ @Field(type = FieldType.Text) private String infoContent; + /** + * 速度 + */ + @Field(type = FieldType.Integer) + private Integer speed; + /** + * 经度 + */ + @Field(type = FieldType.Integer) + private Integer longitude; + /** + * 纬度 + */ + @Field(type = FieldType.Integer) + private Integer latitude; + /** + * 报警处理结果 + * 0x00:处理中 + * 0x01:已处理完毕 + * 0x02:不作处理 + * 0x03:将来处理 + */ + @Field(type = FieldType.Integer) + private int result; + /** + * 报警督办发起时间 + */ + @Field(type = FieldType.Long) + private long pushTime; /** @@ -92,16 +128,11 @@ this.warnSrc = byteBuf.readByte(); //报警类型 this.warnType = byteBuf.readShort(); - String date = byteBuf.readByte() + "-" + byteBuf.readByte() + "-" + byteBuf.readShort() + " " + - byteBuf.readByte() + ":" + byteBuf.readByte() + ":" + byteBuf.readByte(); - long time = 0; - try { - time = DateUtils.parseDate(date, "dd-MM-yyyy HH:mm:ss").getTime(); - } catch (ParseException e) { - e.printStackTrace(); - } + byte[] readableBytes = new byte[8]; + byteBuf.readBytes(readableBytes); + String time = ByteArrayUtil.bytes2HexStr(readableBytes); //报警时间 - this.warnTime = time; + this.warnTime = Long.parseLong(time, 16); //信息ID this.infoId = byteBuf.readInt(); //报警数据长度 -- Gitblit v1.7.1