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/2/24 15:20
|
*/
|
@Data
|
@Document(indexName = "up_exg_msg_take_ewaybill_ack")
|
public class UPExgMsgTakeEwayBillAck 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;
|
/**
|
* 电子运单数据体长度
|
*/
|
@Field(type = FieldType.Integer)
|
private int ewayBillLength;
|
/**
|
* 电子运单数据内容
|
*/
|
@Field(type = FieldType.Text)
|
private String ewayBillInfo;
|
|
|
/**
|
* 解析报文
|
*/
|
public UPExgMsgTakeEwayBillAck decode(UPExgMsg exgMsg) {
|
try {
|
byte[] data = exgMsg.getData();
|
ByteBuf byteBuf = Unpooled.wrappedBuffer(data);
|
this.vehicleNo = exgMsg.getVehicleNo();
|
this.vehicleColor = exgMsg.getVehicleColor();
|
this.dataType = exgMsg.getDataType();
|
this.dataLength = exgMsg.getDataLength();
|
this.ewayBillLength = byteBuf.readInt();
|
this.ewayBillInfo = Jtt809Util.readGBKString(byteBuf, this.ewayBillLength);
|
}catch (Exception e){
|
e.printStackTrace();
|
}
|
return this;
|
}
|
}
|