From eb3dd00b0b7fcda477229d518d250f9c842b790b Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 21 十月 2025 17:45:44 +0800
Subject: [PATCH] 2025.10.21 1. 走航季度报告相关数据计算逻辑调整
---
src/test/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuousTest.kt | 85 ++++++++++++++++++++++++++++--------------
1 files changed, 56 insertions(+), 29 deletions(-)
diff --git a/src/test/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuousTest.kt b/src/test/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuousTest.kt
index 450871f..dff3477 100644
--- a/src/test/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuousTest.kt
+++ b/src/test/kotlin/com/flightfeather/uav/biz/dataanalysis/BaseExceptionContinuousTest.kt
@@ -26,7 +26,7 @@
BaseRealTimeData().apply { id = 3 },
endData!!
)
- historyData = mutableListOf()
+// historyData = mutableListOf()
exceptionExisted = true
exceptionCreated = false
// exceptionResult =
@@ -103,33 +103,38 @@
@Test
fun checkDelayedExceptions() {
- taskList().forEach { exc ->
- val e = exceptions()
- exc.remainingExceptions.add(RemainException(listOf(e[3], e[5]), listOf(FactorType.VOC, FactorType.PM25, FactorType.CO)))
- exc.remainingExceptions.add(RemainException(listOf(e[1]), listOf(FactorType.VOC, FactorType.CO)))
- exc.remainingExceptions.add(RemainException(listOf(e[3]), listOf(FactorType.PM10, FactorType.PM25)))
+ val res = listOf(FactorFilter.SelectedFactor(FactorType.PM25) to exceptionTag)
+ val c = listOf(FactorType.PM25, FactorType.PM10, FactorType.VOC)
+ val r = RemainException(res, c)
+ println(r)
+// taskList().forEach { exc ->
+// val e = exceptions()
+// exc.remainingExceptions.add(RemainException(listOf(e[3], e[5]), listOf(FactorType.VOC, FactorType.PM25, FactorType.CO)))
+// exc.remainingExceptions.add(RemainException(listOf(e[1]), listOf(FactorType.VOC, FactorType.CO)))
+// exc.remainingExceptions.add(RemainException(listOf(e[3]), listOf(FactorType.PM10, FactorType.PM25)))
+//
+// exc.latestExceptions.clear()
+// exc.latestExceptions.addAll(exceptions())
+//
+// exc.removeSingleFactor(BaseRealTimeData())
+//
+// val resList = exc.result.map {
+// it.pollutedData?.statisticMap?.entries?.map { e -> e.key }
+// }
+// assertContentEquals(
+// listOf(listOf(FactorType.NO2), listOf(FactorType.O3)),
+// resList,
+// "寮傚父缁撴灉搴旇閮芥槸涓嶅湪缁勫悎涓殑寮傚父"
+// )
+//
+// val resList2 = exc.latestExceptions.map { it.first.main }
+// assertContentEquals(
+// listOf(FactorType.CO, FactorType.PM25, FactorType.PM10, FactorType.VOC),
+// resList2,
+// "鍓╀綑鐨勫簲璇ユ槸涓嶅湪缁勫悎涓殑寮傚父"
+// )
+// }
- exc.latestExceptions.clear()
- exc.latestExceptions.addAll(exceptions())
-
- exc.removeSingleFactor(BaseRealTimeData())
-
- val resList = exc.result.map {
- it.pollutedData?.statisticMap?.entries?.map { e -> e.key }
- }
- assertContentEquals(
- listOf(listOf(FactorType.NO2), listOf(FactorType.O3)),
- resList,
- "寮傚父缁撴灉搴旇閮芥槸涓嶅湪缁勫悎涓殑寮傚父"
- )
-
- val resList2 = exc.latestExceptions.map { it.first.main }
- assertContentEquals(
- listOf(FactorType.CO, FactorType.PM25, FactorType.PM10, FactorType.VOC),
- resList2,
- "鍓╀綑鐨勫簲璇ユ槸涓嶅湪缁勫悎涓殑寮傚父"
- )
- }
}
@Test
@@ -140,11 +145,33 @@
FactorFilter.SelectedFactor(FactorType.CO),
)
val factorList2 = listOf(
- FactorFilter.SelectedFactor(FactorType.CO),
FactorFilter.SelectedFactor(FactorType.PM25),
FactorFilter.SelectedFactor(FactorType.PM10),
)
- println(factorList == factorList2)
+
+ val factorList3 = listOf(
+ FactorFilter.SelectedFactor(FactorType.PM25),
+ FactorFilter.SelectedFactor(FactorType.VOC),
+ )
+
+ val comb = listOf(
+ listOf(
+ FactorFilter.SelectedFactor(FactorType.PM10),
+ FactorFilter.SelectedFactor(FactorType.PM25),
+ FactorFilter.SelectedFactor(FactorType.CO),
+ ),
+ listOf(
+ FactorFilter.SelectedFactor(FactorType.PM25),
+ FactorFilter.SelectedFactor(FactorType.PM10),
+ ),
+ listOf(
+ FactorFilter.SelectedFactor(FactorType.VOC),
+ FactorFilter.SelectedFactor(FactorType.PM25),
+ )
+ )
+
+ val i = comb.indexOf(factorList)
+ println(i)
}
@Test
--
Gitblit v1.9.3