| | |
| | | package com.ruoyi.dataInterchange.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import io.netty.buffer.ByteBuf; |
| | | import lombok.Data; |
| | | import org.springframework.data.elasticsearch.annotations.Field; |
| | | import org.springframework.data.elasticsearch.annotations.FieldType; |
| | | |
| | | /** |
| | | * 车辆定位信息 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/2/24 11:56 |
| | | */ |
| | |
| | | * 1:已加密 |
| | | * 0:未加密 |
| | | */ |
| | | @JsonProperty("ENCRYPT") |
| | | private Integer encrypt; |
| | | @Field(type = FieldType.Integer) |
| | | private int encrypt; |
| | | /** |
| | | * 车辆定位信息数据长度 |
| | | * 日月年 |
| | | */ |
| | | @JsonProperty("DATA_LENGTH") |
| | | private Integer dataLength; |
| | | @Field(type = FieldType.Integer) |
| | | private int date; |
| | | /** |
| | | * 车辆定位信息内容 |
| | | * 时分秒 |
| | | */ |
| | | @JsonProperty("GNSS_DATA") |
| | | private Object gnssData; |
| | | @Field(type = FieldType.Integer) |
| | | private int time; |
| | | /** |
| | | * 监控平台唯一编码,由平台所在地行政区划代码和平台编号组成 |
| | | * 经度 |
| | | */ |
| | | @JsonProperty("PLATFORM_ID1") |
| | | private String platformId1; |
| | | @Field(type = FieldType.Integer) |
| | | private int lon; |
| | | /** |
| | | * 报警状态,二进制表示,0表示正常,1表示报警 |
| | | * 纬度 |
| | | */ |
| | | @JsonProperty("ALARM1") |
| | | private Integer alarm1; |
| | | @Field(type = FieldType.Integer) |
| | | private int lat; |
| | | /** |
| | | * 市级监管平台唯一编码,由平台所在地行政区划代码和平台编号组成;未填写时,全填0;无市级平台应由省级平台全填1 |
| | | * 速度 |
| | | */ |
| | | @JsonProperty("PLATFORM_ID2") |
| | | private String platformId2; |
| | | @Field(type = FieldType.Integer) |
| | | private int vec1; |
| | | /** |
| | | * 报警状态,二进制表示,0表示正常,1表示报警 |
| | | * 行驶记录速度 |
| | | */ |
| | | @JsonProperty("ALARM2") |
| | | private Integer alarm2; |
| | | @Field(type = FieldType.Integer) |
| | | private int vec2; |
| | | /** |
| | | * 省级监管平台唯一编码,由平台所在地行政区划代码和平台编号组成;未填写时,全填0 |
| | | * 车辆当前总里程数 |
| | | */ |
| | | @JsonProperty("PLATFORM_ID3") |
| | | private String platformId3; |
| | | @Field(type = FieldType.Integer) |
| | | private int vec3; |
| | | /** |
| | | * 报警状态,二进制表示,0表示正常,1表示报警 |
| | | * 方向 |
| | | */ |
| | | @JsonProperty("ALARM3") |
| | | private Integer alarm3; |
| | | @Field(type = FieldType.Integer) |
| | | private int direction; |
| | | /** |
| | | * 海拔高度 |
| | | */ |
| | | @Field(type = FieldType.Integer) |
| | | private int altitude; |
| | | /** |
| | | * 车辆状态 |
| | | */ |
| | | @Field(type = FieldType.Integer) |
| | | private int state; |
| | | /** |
| | | * 报警状态 |
| | | */ |
| | | @Field(type = FieldType.Integer) |
| | | private int alarm; |
| | | |
| | | /** |
| | | * 解析报文 |
| | | */ |
| | | public GnssData decode(ByteBuf byteBuf) { |
| | | this.encrypt = byteBuf.readByte(); |
| | | this.date = byteBuf.readInt(); |
| | | ByteBuf byteBuf1 = byteBuf.readBytes(3); |
| | | StringBuilder t = new StringBuilder(); |
| | | for (int i = 0; i < 3; i++) { |
| | | t.append(byteBuf1.getByte(i)); |
| | | } |
| | | this.time = Integer.valueOf(t.toString()); |
| | | this.lon = byteBuf.readInt(); |
| | | this.lat = byteBuf.readInt(); |
| | | this.vec1 = byteBuf.readShort(); |
| | | this.vec2 = byteBuf.readShort(); |
| | | this.vec3 = byteBuf.readInt(); |
| | | this.direction = byteBuf.readShort(); |
| | | this.altitude = byteBuf.readShort(); |
| | | this.state = byteBuf.readInt(); |
| | | this.alarm = byteBuf.readInt(); |
| | | return this; |
| | | } |
| | | } |