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;
|
|
/**
|
* @author zhibing.pu
|
* @Date 2025/6/3 17:16
|
*/
|
@Data
|
@Document(indexName = "up_warn_msg_operation_info")
|
public class UPWarnMsgOperationInfo 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.Text)
|
private String infoId;
|
/**
|
* 报警处理结果
|
* 0x00:处理中
|
* 0x01:已处理完毕
|
*/
|
@Field(type = FieldType.Integer)
|
private int result;
|
/**
|
* 报警处理方式
|
* 0x00: 快速拍照
|
* 0x01: 语音下发
|
* 0x02: 不做处理
|
* 0x03: 其他
|
*/
|
@Field(type = FieldType.Integer)
|
private int method;
|
/**
|
* 报警处理人姓名长度
|
*/
|
@Field(type = FieldType.Integer)
|
private int operatorLength;
|
/**
|
* 报警处理人姓名
|
*/
|
@Field(type = FieldType.Text)
|
private String operator;
|
/**
|
* 报警处理人所属公司名称长度
|
*/
|
@Field(type = FieldType.Integer)
|
private int companyLength;
|
/**
|
* 报警处理人所属公司名称
|
*/
|
@Field(type = FieldType.Text)
|
private String company;
|
|
|
/**
|
* 解析报文
|
*/
|
public UPWarnMsgOperationInfo 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.infoId = Jtt809Util.readGBKString(byteBuf,32);
|
//报警处理结果
|
this.result = byteBuf.readByte();
|
//报警处理方式
|
this.method = byteBuf.readByte();
|
//报警处理人姓名长度
|
this.operatorLength = byteBuf.readByte();
|
//报警处理人姓名
|
this.operator = Jtt809Util.readGBKString(byteBuf,this.operatorLength);
|
//报警处理人所属公司名称长度
|
this.companyLength = byteBuf.readByte();
|
//报警处理人所属公司名称
|
this.company = Jtt809Util.readGBKString(byteBuf,this.companyLength);
|
}catch (Exception e){
|
e.printStackTrace();
|
}
|
return this;
|
}
|
}
|