From 20b8d870efbbb89564b599561fc69202ba41223f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 10 四月 2026 13:36:42 +0800
Subject: [PATCH] 2026.4.10 1. 修复采样时间超过当前时间的数据依旧能存入数据库的bug

---
 src/main/kotlin/com/flightfeather/uav/socket/decoder/DataUnitDecoder.kt |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/socket/decoder/DataUnitDecoder.kt b/src/main/kotlin/com/flightfeather/uav/socket/decoder/DataUnitDecoder.kt
index 6b848c4..5b454b2 100644
--- a/src/main/kotlin/com/flightfeather/uav/socket/decoder/DataUnitDecoder.kt
+++ b/src/main/kotlin/com/flightfeather/uav/socket/decoder/DataUnitDecoder.kt
@@ -5,7 +5,6 @@
 import com.flightfeather.uav.socket.eunm.FactorType
 import org.slf4j.LoggerFactory
 import java.text.SimpleDateFormat
-import java.util.*
 
 /**
  * uav 绗簩灞傛暟鎹崟鍏冭В鐮佸櫒
@@ -24,15 +23,11 @@
     fun getAirConfirmData(b: List<String>, deviceCode: String?): List<AirTypeData> {
         val resultList = mutableListOf<AirTypeData>()
         b.forEach {
-            FactorType.getByIndex(it.toInt(16))?.let { f->
+            FactorType.getByValue(it.toInt(16))?.let { f->
                 resultList.add(AirTypeData(f))
             }
         }
-        if (!types.containsKey(deviceCode)) {
-            types[deviceCode] = mutableListOf()
-        }
-        types[deviceCode]?.clear()
-        types[deviceCode]?.addAll(resultList)
+        types[deviceCode] = resultList
 
         return resultList
     }

--
Gitblit v1.9.3