From 61871594dfa0a5ac2c4d895d9ec4034feba57094 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 12 九月 2025 17:20:53 +0800
Subject: [PATCH] 2025.9.5 1. 新增走航任务统计功能

---
 src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt b/src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt
index e0f3799..0fa5483 100644
--- a/src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt
+++ b/src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt
@@ -143,6 +143,26 @@
     }
 }
 
+fun GridDataDetail.getByFactorType(type: FactorType?): Float? {
+    return when (type) {
+        NO2 -> no2
+        CO -> co
+        H2S -> h2s
+        SO2 -> so2
+        O3 -> o3
+        PM25 -> pm25
+        PM10 -> pm10
+        TEMPERATURE -> temperature
+        HUMIDITY -> humidity
+        VOC -> voc
+        NOI -> noi
+        WIND_SPEED -> windSpeed
+        WIND_DIRECTION -> windDirection
+        NO -> no
+        else -> null
+    }
+}
+
 fun List<GridDataDetail>.avg(): GridDataDetail {
     //椋庡悜閲囩敤鍗曚綅鐭㈤噺娉曟眰鍙栧潎鍊�
     var u = .0//涓滆タ鏂逛綅鍒嗛噺鎬诲拰

--
Gitblit v1.9.3