From eb3dd00b0b7fcda477229d518d250f9c842b790b Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 21 十月 2025 17:45:44 +0800
Subject: [PATCH] 2025.10.21 1. 走航季度报告相关数据计算逻辑调整
---
src/main/kotlin/com/flightfeather/uav/biz/mission/MissionUtil.kt | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/src/main/kotlin/com/flightfeather/uav/biz/mission/MissionUtil.kt b/src/main/kotlin/com/flightfeather/uav/biz/mission/MissionUtil.kt
index be6523c..2b49150 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/mission/MissionUtil.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/mission/MissionUtil.kt
@@ -56,4 +56,37 @@
// 杩斿洖涔¢晣鍜岃閬撳悕绉扮粍鍚�
return address.township
}
+
+ /**
+ * 鏁版嵁娓呮礂
+ * 1. 淇鐢变簬纭欢璁惧鍗¢】瀵艰嚧鐨勬暟鎹噰鏍锋椂闂翠笉鍙橀棶棰橈紝閲囩敤鑷姩绱姞鏁版嵁鍛ㄦ湡鐨勬柟寮忎慨鏀归噰鏍锋椂闂�
+ * @param data 鍘熷鏁版嵁鍒楄〃
+ * @param period 鏁版嵁鍛ㄦ湡锛屽崟浣嶏細绉�
+ * @return 娓呮礂鍚庨渶瑕佷慨鏀圭殑鏁版嵁鍒楄〃
+ */
+ fun dataClean(dataList: List<BaseRealTimeData>, period: Long): List<BaseRealTimeData> {
+ val cleanedData = mutableListOf<BaseRealTimeData>()
+ var errorData: BaseRealTimeData? = null
+ dataList.forEachIndexed { index, data ->
+ if (index == 0) {
+ return@forEachIndexed
+ }
+ val lastOne = dataList[index - 1]
+ if (errorData == null) {
+ if (data.dataTime!!.time == lastOne.dataTime!!.time) {
+ data.dataTime?.time = lastOne.dataTime?.time!!.plus(period * 1000)
+ cleanedData.add(data)
+ errorData = lastOne
+ }
+ } else {
+ if (data.dataTime!!.time == errorData!!.dataTime!!.time) {
+ data.dataTime?.time = lastOne.dataTime?.time!!.plus(period * 1000)
+ cleanedData.add(data)
+ } else {
+ errorData = null
+ }
+ }
+ }
+ return cleanedData
+ }
}
--
Gitblit v1.9.3