From 357c5a3c4659f1fe9e46e8c20827ab757c5d3929 Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期四, 14 十二月 2023 15:27:34 +0800
Subject: [PATCH] 增加数据请求配置表和异常分析配置表的接口

---
 src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionAnalysisController.kt |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionAnalysisController.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionAnalysisController.kt
index 36ba506..e80308d 100644
--- a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionAnalysisController.kt
+++ b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionAnalysisController.kt
@@ -1,5 +1,6 @@
 package com.flightfeather.monitor.analysis.dust
 
+import com.flightfeather.monitor.analysis.dust.exception.*
 import com.flightfeather.monitor.domain.ds1.entity.DustExceptionData
 import com.flightfeather.monitor.domain.ds1.repository.DustExceptionDataRep
 import com.flightfeather.monitor.domain.ds1.repository.DustExceptionSettingRep
@@ -23,7 +24,7 @@
     private val dustSiteStatusRep: DustSiteStatusRep,
 ) {
 
-    private var running = false
+    var running = false
 
     private val taskList = mutableListOf<BaseDustExceptionAnalysis>()
 
@@ -39,6 +40,7 @@
                 add(ExceptionValueMutation(it))
                 add(ExceptionDataLowValue(it))
                 add(ExceptionDataExceed(it))
+                add(ExceptionValidRate(it))
             }
         }
     }
@@ -97,15 +99,15 @@
 
     fun debugRun() {
         val result = mutableListOf<DustExceptionData>()
-        val date = LocalDate.of(2023, 7, 2)
+        val date = LocalDate.of(2023, 11, 22)
         taskList.forEach { it.init() }
         // 杞鏁版嵁锛岃绠楀悇涓紓甯�
-        val list = dustSiteDataRep.select("YZT0JS0150043", date)
+        val list = dustSiteDataRep.select("SHKJ0JS0150917", date)
         list.takeIf { it.isNotEmpty() }?.forEach { d ->
-            d?.let { taskList[0].onNextData(d) }
+            d?.let { taskList.forEach { it.onNextData(d) } }
         }
         // 鍚勪釜寮傚父鍒嗘瀽鍒嗗埆缁撴潫
-        taskList[0].onDone()
+        taskList.forEach { it.onDone() }
         // 瀛樺偍鍒嗘瀽缁撴灉
         taskList.forEach { result.addAll(it.resultList) }
         println(result)

--
Gitblit v1.9.3