| | |
| | | package com.ruoyi.dataInterchange.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | 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:14 |
| | | */ |
| | | @Data |
| | | public class UPExgMsgReportDriverInfoAck { |
| | | @Document(indexName = "up_exg_msg_report_driver_info_ack") |
| | | public class UPExgMsgReportDriverInfoAck extends BaseModel { |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | @JsonProperty("VEHICLE_NO") |
| | | @Field(type = FieldType.Text) |
| | | private String vehicleNo; |
| | | /** |
| | | * 车牌颜色 |
| | | */ |
| | | @JsonProperty("VEHICLE_COLOR") |
| | | private String vehicleColor; |
| | | @Field(type = FieldType.Integer) |
| | | private int vehicleColor; |
| | | /** |
| | | * 子业务类型标识 |
| | | */ |
| | | @JsonProperty("DATA_TYPE") |
| | | private String dataType; |
| | | @Field(type = FieldType.Integer) |
| | | private int dataType; |
| | | /** |
| | | * 后续数据长度 |
| | | */ |
| | | @JsonProperty("DATA_LENGTH") |
| | | private Integer dataLength; |
| | | /** |
| | | * 对应上报驾驶员身份请求消息源子业务类型标识 |
| | | */ |
| | | @JsonProperty("SOURCE_DATA_TYPE") |
| | | private Integer sourceDataType; |
| | | /** |
| | | * 对应上报驾驶员身份请求消息源报文序列号 |
| | | */ |
| | | @JsonProperty("SOURCE_MSG_SN") |
| | | private Integer sourceMsgSn; |
| | | @Field(type = FieldType.Integer) |
| | | private int dataLength; |
| | | /** |
| | | * 驾驶员姓名 |
| | | */ |
| | | @JsonProperty("DRIVER_NAME") |
| | | @Field(type = FieldType.Text) |
| | | private String driverName; |
| | | /** |
| | | * 驾驶证编号 |
| | | */ |
| | | @JsonProperty("DRIVER_ID") |
| | | @Field(type = FieldType.Text) |
| | | private String driverId; |
| | | /** |
| | | * 从业资格证号 |
| | | */ |
| | | @JsonProperty("LICENCE") |
| | | @Field(type = FieldType.Text) |
| | | private String licence; |
| | | /** |
| | | * 发证机构名称 |
| | | */ |
| | | @JsonProperty("ORG_NAME") |
| | | @Field(type = FieldType.Text) |
| | | private String orgName; |
| | | |
| | | |
| | | /** |
| | | * 证件有效期,时分秒均用0表示 |
| | | * 解析报文 |
| | | */ |
| | | @JsonProperty("VALID_TIME") |
| | | private String validTime; |
| | | public UPExgMsgReportDriverInfoAck decode(UPExgMsg exgMsg) { |
| | | 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.driverName = Jtt809Util.readGBKString(byteBuf, 16); |
| | | this.driverId = Jtt809Util.readGBKString(byteBuf, 20); |
| | | this.licence = Jtt809Util.readGBKString(byteBuf, 40); |
| | | this.orgName = Jtt809Util.readGBKString(byteBuf, 200); |
| | | return this; |
| | | } |
| | | } |