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/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt
index 3dc2e05..5dd3328 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt
@@ -84,7 +84,7 @@
avgPer = calPer(f.main)
avgRate = calRate(f.main)
- val s = dataSummary(exceptionData, f.main)
+ val s = dataSummary(dataList, f.main)
avg = s.first
min = s.second
max = s.third
@@ -110,7 +110,7 @@
var times: Int? = null
var historyDataList = mutableListOf<DataVo>()
- // 寮傚父鐩戞祴鏁版嵁
+ // 寮傚父鐩戞祴鏁版嵁锛屽寘鍚崟姝ゅ紓甯镐腑鎵�鏈夊彂鐢熶簡寮傚父鐨勬暟鎹�硷紙鍙兘涓嶆槸鏃堕棿杩炵画鐨勬暟鎹級
var dataList: MutableList<BaseRealTimeData> = mutableListOf()
var dataVoList: MutableList<DataVo> = mutableListOf()
@@ -127,8 +127,8 @@
var total = .0
for (i in 0 until list.size - 1) {
- val p = list[i].getByFactorType(factorType)!!
- val n = list[i + 1].getByFactorType(factorType)!!
+ val p = list[i].getByFactorType(factorType) ?: .0f
+ val n = list[i + 1].getByFactorType(factorType) ?: .0f
total += (n - p) / p
}
return total / (list.size - 1)
@@ -140,8 +140,8 @@
var total = .0
for (i in 0 until list.size - 1) {
- val p = list[i].getByFactorType(factorType)!!
- val n = list[i + 1].getByFactorType(factorType)!!
+ val p = list[i].getByFactorType(factorType) ?: .0f
+ val n = list[i + 1].getByFactorType(factorType) ?: .0f
total += (n - p) / 4
}
return total / (list.size - 1)
--
Gitblit v1.9.3