puzhibing
2025-04-25 0dcba4fd1cb536ab426622e31213d8a0194449ff
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPExgMsgRegister.java
@@ -69,23 +69,27 @@
    * 解析报文
    */
   public UPExgMsgRegister 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.platformId = Jtt809Util.readGBKString(byteBuf, 11);
      //车载终端厂商唯一编码
      this.producerId = Jtt809Util.readGBKString(byteBuf, 11);
      //车载终端型号
      this.terminalModelType = Jtt809Util.readGBKString(byteBuf, 8);
      //车载终端编号
      this.terminalId = Jtt809Util.readGBKString(byteBuf, 7);
      //车载终端SIM卡电话号码
      this.terminalSIMCode = Jtt809Util.readGBKString(byteBuf, 12);
      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.platformId = Jtt809Util.readGBKString(byteBuf, 11);
         //车载终端厂商唯一编码
         this.producerId = Jtt809Util.readGBKString(byteBuf, 11);
         //车载终端型号
         this.terminalModelType = Jtt809Util.readGBKString(byteBuf, 8);
         //车载终端编号
         this.terminalId = Jtt809Util.readGBKString(byteBuf, 7);
         //车载终端SIM卡电话号码
         this.terminalSIMCode = Jtt809Util.readGBKString(byteBuf, 12);
      }catch (Exception e){
         e.printStackTrace();
      }
      return this;
   }
}