From cf160e28026ed1ed8bea82701d66e79a1085c503 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期四, 15 五月 2025 00:24:39 +0800
Subject: [PATCH] 1. 新增走航动态溯源功能

---
 src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRealTimeException.kt |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRealTimeException.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRealTimeException.kt
index c464995..bfb6b9a 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRealTimeException.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRealTimeException.kt
@@ -2,9 +2,11 @@
 
 import com.flightfeather.uav.biz.FactorFilter
 import com.flightfeather.uav.biz.dataanalysis.BaseExceptionContinuous
+import com.flightfeather.uav.biz.dataanalysis.model.ExceptionTag
 import com.flightfeather.uav.biz.sourcetrace.RealTimeAnalysisConfig
 import com.flightfeather.uav.biz.sourcetrace.model.RealTimeExceptionResult
 import com.flightfeather.uav.domain.entity.BaseRealTimeData
+import com.flightfeather.uav.lightshare.eunm.ExceptionStatusType
 
 // 寮傚父鏁版嵁鐢熸垚鍥炶皟绫�
 typealias NewExceptionCallback = (ex: RealTimeExceptionResult) -> Unit
@@ -15,10 +17,10 @@
  * @date 2025/5/13
  * @author feiyu02
  */
-abstract class BaseRealTimeException(config: RealTimeAnalysisConfig) :
-    BaseExceptionContinuous<RealTimeAnalysisConfig, RealTimeExceptionResult>(config) {
+abstract class BaseRealTimeException<T : ExceptionTag>(config: RealTimeAnalysisConfig, tagClz: Class<T>) :
+    BaseExceptionContinuous<T, RealTimeAnalysisConfig, RealTimeExceptionResult>(config, tagClz) {
 
-    constructor(config: RealTimeAnalysisConfig, callback: NewExceptionCallback) : this(config){
+    constructor(config: RealTimeAnalysisConfig, callback: NewExceptionCallback, tagClz: Class<T>) : this(config, tagClz){
         this.callback = callback
     }
 
@@ -34,19 +36,18 @@
                 // 璧峰鏁版嵁
                 it.endData = data
                 if (it.startData == null) {
-                    it.refreshAfterCheckResult(data)
+                    it.refreshWithNextException(data)
                 }
                 // 鍒ゆ柇鐩搁偦鏁版嵁鏄惁杩炵画鎴栬�呮槸鍚︽弧瓒宠嚜瀹氫箟鎴彇鏉′欢
                 if (!isContinue || needCut(it)) {
                     // 璁板綍寮傚父锛岀粨鏉熷紓甯哥殑瀹炴椂鐘舵�佹挱鎶�
                     recordException(s, it, data)
                 } else {
-                    if (hasException[f] == true) {
-                        it.existException = true
-                        it.exceptionData.add(data)
-                    }
                     // 绉婚櫎浜嗙埗绫诲師鏈夐�昏緫锛屾敼涓哄綋婊¤冻寮傚父鏉′欢鏃讹紝闇�瑕佸疄鏃舵帹閫佹挱鎶ュ紓甯哥殑鐘舵�佸彉鍖栵紝浣嗕笉鎴彇寮傚父
-                    checkResult(s)
+                    if (hasException[f] == true) {
+                        it.addExceptionData(data)
+                        checkResult(s)
+                    }
                 }
             }
         }
@@ -63,11 +64,11 @@
         return RealTimeExceptionResult(start, end, factor, exceptionData, eType)
     }
 
-    override fun onNewException(tag: Tag, factor: FactorFilter.SelectedFactor) {
-        super.onNewException(tag, factor)
+    override fun onNewException(tag: T, factor: FactorFilter.SelectedFactor, exceptionStatus: ExceptionStatusType) {
+        super.onNewException(tag, factor, exceptionStatus)
         callback?.let { func ->
-            val exc = resultList.last()
-            func.invoke(exc)
+            val exc = tag.exceptionResult.last()
+            func.invoke(exc as RealTimeExceptionResult)
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3