liujie
2025-09-08 af4b8add9d103889472a75973847871b7dcdf3c8
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPWarnMsgAdptInfo.java
@@ -1,18 +1,15 @@
package com.ruoyi.dataInterchange.model;
import cn.hutool.core.util.ArrayUtil;
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;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.util.Arrays;
import java.util.List;
/**
 * 上报报警信息
@@ -20,6 +17,7 @@
 * @author zhibing.pu
 * @Date 2025/3/3 14:50
 */
@Slf4j
@Data
@Document(indexName = "up_warn_msg_adpt_info")
public class UPWarnMsgAdptInfo extends BaseModel {
@@ -69,7 +67,7 @@
   /**
    * 报警时间
    */
   @Field(type = FieldType.Integer)
   @Field(type = FieldType.Long)
   private long warnTime;
   /**
    * 信息ID
@@ -97,7 +95,7 @@
   @Field(type = FieldType.Text)
   private String driverNo;
   /**
    * 报警级别
    * 报警级别 0x001:一级报警,0x002: 二级报警
    */
   @Field(type = FieldType.Integer)
   private int level;
@@ -162,6 +160,11 @@
    */
   @Field(type = FieldType.Long)
   private long pushTime;
   /**
    * 抓拍图片
    */
   @Field(type = FieldType.Text)
   private String picUrl;
   
   /**
@@ -216,8 +219,10 @@
         byte[] readableBytes = new byte[8];
         byteBuf.readBytes(readableBytes);
         String time = ByteArrayUtil.bytes2HexStr(readableBytes);
         log.info("报警时间1: {}", time);
         //报警时间
         this.warnTime = Long.parseLong(time, 16);
         log.info("报警时间2: {}", this.warnTime);
         //团标扩展
         //信息ID
         this.infoId = Jtt809Util.readGBKString(byteBuf,32);
@@ -236,17 +241,17 @@
         //纬度
         this.latitude = byteBuf.readInt();
         //海拔高度
         this.altitude = byteBuf.readUnsignedShort();
         this.altitude = byteBuf.readShort();
         //行车速度
         this.speed = byteBuf.readUnsignedShort();
         this.speed = byteBuf.readShort();
         //行驶记录速度
         this.vec2 = byteBuf.readUnsignedShort();
         this.vec2 = byteBuf.readShort();
         //报警状态
         this.status = byteBuf.readByte();
         //方向
         this.direction = byteBuf.readUnsignedShort();
         this.direction = byteBuf.readShort();
         //报警数据长度
         this.infoLength = byteBuf.readUnsignedShort();
         this.infoLength = byteBuf.readShort();
         //报警信息内容
         this.infoContent = Jtt809Util.readGBKString(byteBuf,this.infoLength);
      }catch (Exception e){