puzhibing
2025-04-25 0dcba4fd1cb536ab426622e31213d8a0194449ff
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/model/UPExgMsgHistoryLocation.java
@@ -56,18 +56,22 @@
    * 解析报文
    */
   public UPExgMsgHistoryLocation 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.gnssCnt = byteBuf.readByte();
      List<GnssData> gnssData = new ArrayList<>();
      for (int i = 0; i < this.gnssCnt; i++) {
         gnssData.add(new GnssData().decode(byteBuf));
      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.gnssCnt = byteBuf.readByte();
         List<GnssData> gnssData = new ArrayList<>();
         for (int i = 0; i < this.gnssCnt; i++) {
            gnssData.add(new GnssData().decode(byteBuf));
         }
         this.gnssData = gnssData;
      }catch (Exception e){
         e.printStackTrace();
      }
      this.gnssData = gnssData;
      return this;
   }
}