package com.ruoyi.dataInterchange.model;
|
|
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBufUtil;
|
import io.netty.buffer.Unpooled;
|
import lombok.Data;
|
|
/**
|
* 上报车辆电子运单请求
|
* @author zhibing.pu
|
* @Date 2025/3/3 11:06
|
*/
|
@Data
|
public class DOWNExgMsgTakeEwaybillReq {
|
/**
|
* 车牌号
|
*/
|
private String vehicleNo;
|
/**
|
* 车牌颜色
|
*/
|
private int vehicleColor;
|
/**
|
* 子业务类型标识
|
*/
|
private int dataType;
|
/**
|
* 后续数据长度
|
*/
|
private int dataLength;
|
|
|
/**
|
* 编码报文
|
*/
|
public byte[] encode() {
|
ByteBuf byteBuf = Unpooled.buffer(28);
|
byte[] bytes1 = this.getVehicleNo().getBytes();
|
for (byte b : bytes1) {
|
byteBuf.writeByte(b);
|
}
|
byteBuf.writeByte(this.getVehicleColor());
|
byteBuf.writeByte(this.getDataType());
|
byteBuf.writeInt(this.getDataLength());
|
byte[] bytes = ByteBufUtil.getBytes(byteBuf);
|
byteBuf.release();
|
return bytes;
|
}
|
}
|