From 37d47c6a7ab0f454b948b68c987146b261117993 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期日, 13 七月 2025 22:47:21 +0800
Subject: [PATCH] 2025.7.13 动态溯源逻辑调整

---
 src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt |   74 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt
index 9893656..c87812e 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt
@@ -1,10 +1,80 @@
 package com.flightfeather.uav.biz.sourcetrace.model
 
+import com.flightfeather.uav.biz.FactorFilter
+import com.flightfeather.uav.biz.dataanalysis.BaseExceptionResult
+import com.flightfeather.uav.biz.dataanalysis.model.ExceptionTag
+import com.flightfeather.uav.biz.dataanalysis.model.ExceptionType
+import com.flightfeather.uav.biz.sourcetrace.config.RTExcWindLevelConfig
+import com.flightfeather.uav.common.utils.DateUtil
+import com.flightfeather.uav.common.utils.MapUtil
+import com.flightfeather.uav.domain.entity.BaseRealTimeData
+import com.flightfeather.uav.domain.entity.SceneInfo
+import com.flightfeather.uav.domain.repository.SceneInfoRep
+import com.flightfeather.uav.socket.sender.MsgType
+
 /**
  * 姹℃煋绾跨储
- * 鏍规嵁
+ * 閫氳繃姹℃煋鏁版嵁[PollutedData],姹℃煋鍖哄煙[PollutedArea],姹℃煋鏉ユ簮[PollutedSource]锛屽舰鎴愪竴鏉℃薄鏌撴函婧愮嚎绱�
  * @date 2025/5/27
  * @author feiyu02
  */
-class PollutedClue {
+class PollutedClue() : BaseExceptionResult(){
+
+//    constructor(
+//        start: BaseRealTimeData,
+//        end: BaseRealTimeData?,
+//        factor: FactorFilter.SelectedFactor,
+//        exceptionData: List<BaseRealTimeData>,
+//        eType: ExceptionType,
+//        config: RTExcWindLevelConfig,
+//        windLevelCondition: RTExcWindLevelConfig.WindLevelCondition?,
+//    ) : this() {
+//        if (exceptionData.isEmpty()) return
+//        pollutedData = PollutedData(start, end, factor, exceptionData, eType, windLevelCondition)
+//        pollutedArea = PollutedArea(exceptionData, config, windLevelCondition)
+//    }
+
+    constructor(
+        tag: ExceptionTag, factor: FactorFilter.SelectedFactor, eType: ExceptionType, config: RTExcWindLevelConfig,
+        windLevelCondition: RTExcWindLevelConfig.WindLevelCondition?,
+    ) : this()
+//            this(
+//        tag.startData!!, tag.endData, factor, tag.exceptionData, eType, config,
+//        windLevelCondition
+//    )
+    {
+        if (tag.exceptionData.isEmpty()) return
+        deviceCode = tag.startData?.deviceCode
+        pollutedData = PollutedData(
+            tag.startData!!, tag.endData, factor, tag.exceptionData, tag.historyData, eType, windLevelCondition
+        )
+        pollutedArea = PollutedArea(tag.historyData, tag.exceptionData, config, windLevelCondition)
+    }
+
+    /**
+     * 6. 灞曠ず鏁版嵁鍙樺寲鎯呭喌锛屼笂鍗囬�熺巼绛夌瓑
+     */
+
+    /**
+     * @see [MsgType]
+     */
+    var msgType: Int? = null
+
+    var deviceCode: String? = null
+
+    var pollutedData: PollutedData? = null
+
+    var pollutedArea: PollutedArea? = null
+
+    var pollutedSource: PollutedSource? = null
+
+    /**
+     * 鏌ユ壘绯荤粺鍐呴儴婧簮鑼冨洿鍐呯殑姹℃煋浼佷笟
+     */
+    fun searchScenes(sceneInfoRep: SceneInfoRep) {
+        if (pollutedArea == null || pollutedData == null) return
+        pollutedSource = PollutedSource().also {
+            it.searchScenes(pollutedArea!!, sceneInfoRep, pollutedData!!)
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3