From d649f734c44541641158aec2d6b10d630f5a0827 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 25 十二月 2025 17:25:16 +0800
Subject: [PATCH] 2025.12.19 1. 动态溯源相关分析逻辑调整; 2. 走航报告接口参数调整;
---
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 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 0483664..073926b 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
@@ -3,7 +3,6 @@
import com.flightfeather.uav.biz.FactorFilter
import com.flightfeather.uav.biz.dataanalysis.model.ExceptionTag
import com.flightfeather.uav.biz.dataanalysis.model.ExceptionType
-import com.flightfeather.uav.biz.sourcetrace.config.RTExcWindLevelConfig
import com.flightfeather.uav.common.utils.DateUtil
import com.flightfeather.uav.domain.entity.BaseRealTimeData
import com.flightfeather.uav.domain.entity.avg
@@ -31,8 +30,8 @@
constructor(dataIndexList: List<Int>, factorType: FactorType){
this.dataIndexList = dataIndexList
this.factorType = factorType
- val first = getFirstDataValue()?.toDouble()
- val last = getLastDataValue()?.toDouble()
+ val first = firstDataValue()?.toDouble()
+ val last = lastDataValue()?.toDouble()
if (first != null && last != null) {
per = round((last - first) / first * 100) / 100
rate = round((last - first) / DEFAULT_PERIOD * 100) / 100
@@ -52,26 +51,26 @@
* 鑾峰彇寮傚父鏁版嵁鐨勭涓�涓暟鎹�
* !!!!绗竴涓暟鎹叾瀹炴槸棣栦釜寮傚父鏁版嵁鐨勫墠涓�涓暟鎹��!!!!
*/
- fun getFirstData(): BaseRealTimeData? {
+ fun firstData(): BaseRealTimeData? {
return dataIndexList?.firstOrNull()?.let {
val i = if (it > 0) it - 1 else it
historyDataList[i].toBaseRealTimeData(BaseRealTimeData::class.java)
}
}
- fun getFirstDataValue(): Float? {
- return getFirstData()?.getByFactorType(factorType)
+ fun firstDataValue(): Float? {
+ return firstData()?.getByFactorType(factorType)
}
/**
* 鑾峰彇寮傚父鏁版嵁鐨勬渶鍚庝竴涓暟鎹�
*/
- fun getLastData(): BaseRealTimeData? {
+ fun lastData(): BaseRealTimeData? {
return dataIndexList?.lastOrNull()?.let {
historyDataList[it].toBaseRealTimeData(BaseRealTimeData::class.java)
}
}
- fun getLastDataValue(): Float? {
- return getLastData()?.getByFactorType(factorType)
+ fun lastDataValue(): Float? {
+ return lastData()?.getByFactorType(factorType)
}
}
@@ -105,7 +104,7 @@
/**
* 鑾峰彇寮傚父鏁版嵁
*/
- fun getExceptionData(): List<BaseRealTimeData>? {
+ fun exceptionData(): List<BaseRealTimeData>? {
return dataIndexList?.map { historyDataList[it].toBaseRealTimeData(BaseRealTimeData::class.java) }
}
@@ -113,7 +112,7 @@
* 鑾峰彇寮傚父鏁版嵁鍒嗘鎯呭喌
* 灏嗚繛缁殑寮傚父鏁版嵁鍒嗕负涓�缁�
*/
- fun getExceptionDataGroup(): List<List<Int>> {
+ fun exceptionDataGroup(): List<List<Int>> {
val res = mutableListOf<MutableList<Int>>()
var curGroup = mutableListOf<Int>()
var lastIndex = -2
@@ -202,7 +201,7 @@
min = s.second
max = s.third
- excGroup = getExceptionDataGroup().map { ExcGroup(it, e.first.main) }
+ excGroup = exceptionDataGroup().map { ExcGroup(it, e.first.main) }
avgPer = excGroup?.mapNotNull { it.per }?.average()
avgRate = excGroup?.mapNotNull { it.rate }?.average()
}
@@ -232,16 +231,16 @@
return factors
}
- fun getExceptionAvgData(): BaseRealTimeData {
- val exceptionDataList = statisticMap.flatMap { it.value.getExceptionData() ?: emptyList() }
+ fun exceptionAvgData(): BaseRealTimeData {
+ val exceptionDataList = statisticMap.flatMap { it.value.exceptionData() ?: emptyList() }
val avgData = exceptionDataList.avg()
return avgData
}
/**
* 鑾峰彇寮傚父鏁版嵁涓績鍧愭爣锛堝紓甯告暟鎹腑缁忓害绾害鐨勫钩鍧囧�硷級
*/
- fun getExceptionCenter(): Pair<Double, Double>? {
- val avgData = getExceptionAvgData()
+ fun exceptionCenter(): Pair<Double, Double>? {
+ val avgData = exceptionAvgData()
val wgs84Lng = avgData.longitude?.toDouble()
val wgs84Lat = avgData.latitude?.toDouble()
return if (wgs84Lng == null || wgs84Lat == null) null else Pair(wgs84Lng, wgs84Lat)
--
Gitblit v1.9.3