From f1ea263462d1f3f10a886fb083536a38b03a1ceb Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 14 五月 2025 17:33:04 +0800
Subject: [PATCH] 1. 新增动态污染溯源的数据异常判断逻辑 2. 新增动态污染溯源websocket连接功能

---
 src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuous.kt |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuous.kt b/src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuous.kt
index 52f9cac..0c2e28a 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuous.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuous.kt
@@ -105,21 +105,23 @@
                 }
                 // 鍒ゆ柇鐩搁偦鏁版嵁鏄惁杩炵画骞朵笖鏄惁婊¤冻寮傚父鍒ゆ柇
                 if (!isContinue || needCut(it)) {
-                    checkResult(s)
                     // 鏁版嵁涓嶈繛缁椂锛岃褰曞紓甯告儏鍐�
-                    if (it.eIndex - it.sIndex >= durationCount) {
-                        it.refreshAfterCheckResult(data)
-                    }
+                    recordException(s, it, data)
+//                    checkResult(s)
+//                    if (it.eIndex - it.sIndex >= durationCount) {
+//                        it.refreshAfterCheckResult(data)
+//                    }
                 } else {
                     if (hasException[f] == true) {
                         it.existException = true
                         it.exceptionData.add(data)
                     } else {
                         // 寮傚父涓嶅啀閲嶅鍑虹幇鏃讹紝璁板綍寮傚父鎯呭喌
-                        checkResult(s)
-                        if (it.eIndex - it.sIndex >= durationCount) {
-                            it.refreshAfterCheckResult(data)
-                        }
+                        recordException(s, it, data)
+//                        checkResult(s)
+//                        if (it.eIndex - it.sIndex >= durationCount) {
+//                            it.refreshAfterCheckResult(data)
+//                        }
                     }
                 }
             }
@@ -131,6 +133,13 @@
         checkResult()
     }
 
+    fun recordException(factor: FactorFilter.SelectedFactor, tag: Tag, data: BaseRealTimeData) {
+        checkResult(factor)
+        if (tag.eIndex - tag.sIndex >= durationCount) {
+            tag.refreshAfterCheckResult(data)
+        }
+    }
+
     /**
      * 妫�鏌ヨ繛缁紓甯哥粨鏉熸椂锛屾槸鍚︾鍚堝紓甯稿瓨鍌ㄦ潯浠�
      */
@@ -139,20 +148,12 @@
         if (factor != null && tag != null) {
             if (tag.existException && judgeExceptionCount(tag)) {
                 onNewException(tag, factor)
-//                tag.startData?.let {
-//                    resultList.add(newResult(it, lastData, factor, tag.exceptionData))
-//                }
-//                tag.existException = false
             }
         } else {
             config.factorFilter.selectedList.forEach { f ->
                 val tag1 = tagMap[f.main] ?: return@forEach
                 if (tag1.existException && judgeExceptionCount(tag1)) {
                     onNewException(tag1, f)
-//                    tag1.startData?.let {
-//                        resultList.add(newResult(it, lastData, f, tag1.exceptionData))
-//                    }
-//                    tag1.existException = false
                 }
             }
         }

--
Gitblit v1.9.3