feiyu02
2025-08-05 176d7d8283e66ccf63878c9ab823e900df94b748
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt
@@ -45,6 +45,7 @@
        var exceptionData = mutableListOf<BaseRealTimeData>()
        var historyData = mutableListOf<BaseRealTimeData>()
        exceptions.forEach { e ->
            // 将采样时间最早的作为开始数据
            if (startData == null) {
                startData = e.second.startData
            } else {
@@ -53,6 +54,7 @@
                }
            }
            // 将采样时间最晚的作为结束数据
            if (endData == null) {
                endData = e.second.endData
            } else {
@@ -61,6 +63,7 @@
                }
            }
            // 将所有异常数据去重合并
            if (exceptionData.isEmpty()) {
                exceptionData = e.second.exceptionData
            } else {
@@ -71,6 +74,7 @@
                }
            }
            // 将所有历史数据去重合并
            if (historyData.isEmpty()) {
                historyData = e.second.historyData
            } else {
@@ -81,10 +85,12 @@
                }
            }
        }
        // 按照采样时间升序排列
        exceptionData.sortBy { it.dataTime }
        historyData.sortBy { it.dataTime }
        val factorList = exceptions.map { it.first }
        // 获取去重后的监测因子类型
        val factorList = exceptions.map { it.first }.distinct()
        pollutedData = PollutedData(
            startData!!, endData, factorList, exceptionData, historyData, eType, windLevelCondition
        )