package com.ruoyi.dataInterchange.model;
|
|
import com.ruoyi.dataInterchange.pojo.BaseModel;
|
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;
|
|
/**
|
* 报警督办应答消息
|
*
|
* @author zhibing.pu
|
* @Date 2025/3/3 14:44
|
*/
|
@Data
|
@Document(indexName = "up_warn_msg_urge_todo_ack")
|
public class UPWarnMsgUrgeTodoAck extends BaseModel {
|
/**
|
* 车牌号
|
*/
|
@Field(type = FieldType.Text)
|
private String vehicleNo;
|
/**
|
* 车牌颜色
|
*/
|
@Field(type = FieldType.Integer)
|
private int vehicleColor;
|
/**
|
* 子业务类型标识
|
*/
|
@Field(type = FieldType.Integer)
|
private int dataType;
|
/**
|
* 后续数据长度
|
*/
|
@Field(type = FieldType.Integer)
|
private int dataLength;
|
/**
|
* 报警督办ID
|
*/
|
@Field(type = FieldType.Integer)
|
private int supervisionId;
|
/**
|
* 报警处理结果
|
* 0x00:处理中
|
* 0x01:已处理完毕
|
* 0x02:不作处理
|
* 0x03:将来处理
|
*/
|
@Field(type = FieldType.Integer)
|
private int result;
|
|
|
/**
|
* 解析报文
|
*/
|
public UPWarnMsgUrgeTodoAck decode(WarnMsg warnMsg) {
|
try {
|
byte[] data = warnMsg.getData();
|
ByteBuf byteBuf = Unpooled.wrappedBuffer(data);
|
this.vehicleNo = warnMsg.getVehicleNo();
|
this.vehicleColor = warnMsg.getVehicleColor();
|
this.dataType = warnMsg.getDataType();
|
this.dataLength = warnMsg.getDataLength();
|
|
//报警督办ID
|
this.supervisionId = byteBuf.readInt();
|
//报警处理结果
|
this.result = byteBuf.readByte();
|
}catch (Exception e){
|
e.printStackTrace();
|
}
|
return this;
|
}
|
}
|