From 297512bc22b179b7038d96a1ff033eceaed38c4b Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 07 三月 2025 19:44:31 +0800
Subject: [PATCH] 新增加809对接逻辑

---
 ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPExgMsgReportDriverInfoAck.java |   63 ++++++++++++++++++-------------
 1 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPExgMsgReportDriverInfoAck.java b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPExgMsgReportDriverInfoAck.java
index e1aaeda..a01879d 100644
--- a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPExgMsgReportDriverInfoAck.java
+++ b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPExgMsgReportDriverInfoAck.java
@@ -1,68 +1,79 @@
 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;
+	}
 }

--
Gitblit v1.7.1