From 8eb584869b4fd4de0f51c93f2616f12e51df9193 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 18 十二月 2025 17:48:29 +0800
Subject: [PATCH] 2025.12.18 1. 动态溯源相关分析逻辑调整; 2. 走航报告接口参数调整;

---
 src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedArea.kt |   52 +++++++++++++++++++++++++++++++++-------------------
 1 files changed, 33 insertions(+), 19 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedArea.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedArea.kt
index 9993a86..127622c 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedArea.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedArea.kt
@@ -1,5 +1,7 @@
 package com.flightfeather.uav.biz.sourcetrace.model
 
+import com.flightfeather.uav.biz.FactorFilter
+import com.flightfeather.uav.biz.dataanalysis.model.ExceptionTag
 import com.flightfeather.uav.biz.sourcetrace.config.RTExcWindLevelConfig
 import com.flightfeather.uav.common.net.AMapService
 import com.flightfeather.uav.common.utils.MapUtil
@@ -20,18 +22,32 @@
      */
 
     constructor(
-        historyData: List<BaseRealTimeData>,
-        exceptionData: List<BaseRealTimeData>,
+        pollutedData: PollutedData,
         config: RTExcWindLevelConfig,
         windLevelCondition: RTExcWindLevelConfig.WindLevelCondition?,
-    ) : this() {
+    ) : this(){
         distanceType = windLevelCondition?.distanceType
         distanceRange = distanceType?.disRange
         distanceDes = distanceType?.des
-        windLevelCondition?.let { sourceTrace(historyData, exceptionData, config, it) }
+        windLevelCondition?.let { sourceTrace(pollutedData, config, it) }
     }
 
+    // 鎵�灞炶闀�
+    var township:String? = null
+    // 鏍煎紡鍖栧湴鍧�
     var address: String? = null
+    // 鎵�鍦ㄩ亾璺悕绉�
+    var street:String? = null
+    // 鎵�鍦ㄩ亾璺笂鐨勬渶杩戦棬鐗屽彿
+    var streetNumber:String? = null
+    // 澶勪簬璇ラ棬鐗屽彿鐨勬柟鍚�
+    var direction:String? = null
+    // 澶勪簬璇ラ棬鐗屽彿鐨勬柟鍚戣窛绂�
+    var distance: String? = null
+    // 鎵�澶勬渶杩戜氦鍙夎矾鍙g殑鏂瑰悜鍜岃窛绂�
+    var roadinter:String? = null
+    // 鎵�澶勬渶杩戜氦鍙夎矾鍙g殑璺濈
+    var distance2: String? = null
 
     // 姹℃煋鑼冨洿鎵囧舰鍖哄煙(缁忕含搴﹀杈瑰舰)
     var polygon: List<Pair<Double, Double>>? = null
@@ -49,19 +65,13 @@
      * 鍙嶅悜婧簮
      */
     private fun sourceTrace(
-        historyData: List<BaseRealTimeData>,
-        exceptionData: List<BaseRealTimeData>,
+        pollutedData: PollutedData,
         config: RTExcWindLevelConfig,
         windLevelCondition: RTExcWindLevelConfig.WindLevelCondition,
     ) {
-        val avgData = if (exceptionData.size == 1) {
-            exceptionData.first()
-        } else {
-            exceptionData.avg()
-        }
 
+        val avgData = pollutedData.getExceptionAvgData()
         val pair = avgData.longitude!!.toDouble() to avgData.latitude!!.toDouble()
-
         polygon = calSector(
             avgData.windDirection?.toDouble() ?: .0,
             pair,
@@ -72,7 +82,7 @@
             MapUtil.wgs84ToGcj02(it)
         }
 
-        closePolygon = closeSourceTrace(historyData, pair).map {
+        closePolygon = closeSourceTrace(pair).map {
             // 灏嗗潗鏍囪浆鎹负gcj02锛堢伀鏄熷潗鏍囩郴锛夛紝鍥犱负姹℃煋婧愬満鏅俊鎭兘涓烘鍧愭爣绯�
             MapUtil.wgs84ToGcj02(it)
         }
@@ -80,8 +90,15 @@
         if (config.isSearchAddress) {
             try {
                 val address = AMapService.reGeo(MapUtil.wgs84ToGcj02(pair))
-                this.address = address.district + address.township + address.street
-//                Thread.sleep(100)
+                this.township = address.province + address.district + address.township
+                this.address = address.address
+                this.street = address.street
+                this.streetNumber = address.streetNumber
+                this.direction = address.direction
+                this.distance = address.distance
+                this.roadinter = address.roadinter
+                this.distance2 = address.distance2
+                Thread.sleep(100)
             } catch (e: Exception) {
                 e.printStackTrace()
             }
@@ -139,10 +156,7 @@
         return result
     }
 
-    private fun closeSourceTrace(
-        historyData: List<BaseRealTimeData>,
-        center: Pair<Double, Double>,
-    ): List<Pair<Double, Double>> {
+    private fun closeSourceTrace(center: Pair<Double, Double>): List<Pair<Double, Double>> {
         val result = mutableListOf<Pair<Double, Double>>()
         var startDeg = 0
         while (startDeg <= 360) {

--
Gitblit v1.9.3