| | |
| | | package com.ruoyi.dataInterchange.model; |
| | | |
| | | import com.ruoyi.dataInterchange.pojo.BaseModel; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | | import lombok.Data; |
| | | import org.springframework.data.elasticsearch.annotations.Document; |
| | | import org.springframework.data.elasticsearch.annotations.Field; |
| | | import org.springframework.data.elasticsearch.annotations.FieldType; |
| | | |
| | | /** |
| | | * 远程录像回放请求应答 |
| | |
| | | * @Date 2025/3/21 10:04 |
| | | */ |
| | | @Data |
| | | public class UPPlaybackMsgStartupAck { |
| | | @Document(indexName = "up_playback_msg_startup_ack") |
| | | public class UPPlaybackMsgStartupAck extends BaseModel { |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | @Field(type = FieldType.Text) |
| | | private String vehicleNo; |
| | | /** |
| | | * 车牌颜色 |
| | | */ |
| | | @Field(type = FieldType.Integer) |
| | | private Integer vehicleColor; |
| | | /** |
| | | * 子业务类型标识 |
| | | */ |
| | | @Field(type = FieldType.Integer) |
| | | private Integer dataType; |
| | | /** |
| | | * 后续数据长度 |
| | | */ |
| | | @Field(type = FieldType.Integer) |
| | | private Integer dataLength; |
| | | /** |
| | | * 企业视频服务器IP地址 |
| | | */ |
| | | @Field(type = FieldType.Text) |
| | | private String serverIP; |
| | | /** |
| | | * 企业视频服务端口号 |
| | | */ |
| | | private Integer serverPort; |
| | | @Field(type = FieldType.Integer) |
| | | private int serverPort; |
| | | /** |
| | | * 应答结果 |
| | | * 0x00: 成功 |
| | |
| | | * 0x04: 失效口令错误 |
| | | * 0x05: 不满足跨域条件 |
| | | */ |
| | | private Integer result; |
| | | @Field(type = FieldType.Integer) |
| | | private int result; |
| | | |
| | | |
| | | /** |
| | | * 解析报文 |
| | | */ |
| | | public UPPlaybackMsgStartupAck decode(PlaybackMsg playbackMsg) { |
| | | byte[] data = playbackMsg.getData(); |
| | | ByteBuf byteBuf = Unpooled.wrappedBuffer(data); |
| | | this.vehicleNo = playbackMsg.getVehicleNo(); |
| | | this.vehicleColor = playbackMsg.getVehicleColor(); |
| | | this.dataType = playbackMsg.getDataType(); |
| | | this.dataLength = playbackMsg.getDataLength(); |
| | | |
| | | this.serverIP = Jtt809Util.readGBKString(byteBuf, 32); |
| | | this.serverPort = byteBuf.readShort(); |
| | | this.result = byteBuf.readByte(); |
| | | return this; |
| | | } |
| | | } |