Pu Zhibing
2025-03-07 297512bc22b179b7038d96a1ff033eceaed38c4b
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPExgMsgTakeEwayBillAck.java
@@ -1,53 +1,67 @@
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:20
 */
@Data
public class UPExgMsgTakeEwayBillAck {
@Document(indexName = "up_exg_msg_take_ewaybill_ack")
public class UPExgMsgTakeEwayBillAck 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("EWAYBILL_LENGTH")
   private Integer ewaybillLength;
   @Field(type = FieldType.Integer)
   private int ewayBillLength;
   /**
    * 电子运单数据内容
    */
   @JsonProperty("EWAYBILL_INFO")
   private Object ewaybillInfo;
   @Field(type = FieldType.Text)
   private String ewayBillInfo;
   /**
    * 解析报文
    */
   public UPExgMsgTakeEwayBillAck 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.ewayBillLength = byteBuf.readInt();
      this.ewayBillInfo = Jtt809Util.readGBKString(byteBuf, this.ewayBillLength);
      return this;
   }
}