From 38d72198bfcced01ed9513b978163e5cd1d84625 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 21 七月 2025 15:31:41 +0800
Subject: [PATCH] 2025.7.21 1. 修改动态溯源异常判断逻辑

---
 src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt
index 65fc3a8..83bb5c7 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt
@@ -32,7 +32,7 @@
         this.sceneInfoRep = sceneInfoRep
         this.sourceTraceRep = sourceTraceRep
         this.config = if (factorFilter != null) {
-            RTExcWindLevelConfig(factorFilter, emptyList())
+            RTExcWindLevelConfig(factorFilter)
         } else {
             RTExcWindLevelConfig(
                 FactorFilter.builder()
@@ -43,12 +43,14 @@
                     .withMain(FactorType.O3)
                     .withMain(FactorType.PM25)
                     .withMain(FactorType.PM10)
-                    .withMain(FactorType.VOC)
-                    .create(),
-                listOf(
-                    listOf(FactorType.PM25, FactorType.PM10),
-                    listOf(FactorType.VOC, FactorType.CO),
-                )
+//                    .withMain(FactorType.VOC)
+                    .withCombination(
+                        listOf(
+                            listOf(FactorType.PM25, FactorType.PM10),
+                            listOf(FactorType.VOC, FactorType.CO),
+                        )
+                    )
+                    .create()
             )
         }
         pollutedSummary = PollutedSummary(config) { summaryCallback(it) }
@@ -61,6 +63,8 @@
     private val sceneInfoRep: SceneInfoRep
     private val sourceTraceRep: SourceTraceRep
     private val config: RTExcWindLevelConfig
+    private val timer = Timer()
+    private var timerTask: TimerTask? = null
 
     private val taskList = mutableListOf<BaseExceptionAnalysis<RTExcWindLevelConfig, PollutedClue>>()
 
@@ -90,23 +94,27 @@
      * 璁$畻鏂扮殑涓�鏉″疄鏃惰蛋鑸暟鎹�
      */
     fun addOneData(data: BaseRealTimeData) {
+//        println("====================>")
         // 璁$畻寮傚父
         taskList.forEach { it.onNextData(data) }
         pollutedSummary.refreshLatestMonitorData(data)
         // 闄愬畾鏃堕棿鍐呮病鏈夋柊鏁版嵁浼犲叆锛屽垯缁撴潫褰撳墠鐨勮绠�
+        dealOnTimeout()
     }
 
     /**
      * 瓒呮椂澶勭悊锛岃緝闀挎椂闂存病鏈夋柊鏁版嵁杩涘叆锛岃繘琛屽垵濮嬪寲鎿嶄綔
      */
     private fun dealOnTimeout() {
-        val timer = Timer(true)
-        timer.schedule(object : TimerTask() {
+//        val timer = Timer()
+        timerTask?.cancel()
+        timer.purge()
+        timerTask = object : TimerTask() {
             override fun run() {
-                TODO("Not yet implemented")
+                initTask()
             }
-        }, 60 * 1000)
-        timer.cancel()
+        }
+        timer.schedule(timerTask, 2 * 60 * 60 * 1000)
     }
 
     // 鏁版嵁绐佸彉寮傚父鍥炶皟

--
Gitblit v1.9.3