feiyu02
昨天 e923f06d572c9a0e3b1eb2c54471af02c9d95bcf
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt
@@ -20,18 +20,6 @@
 */
class PollutedClue() : BaseExceptionResult() {
//    constructor(
//        tag: ExceptionTag, factor: FactorFilter.SelectedFactor, eType: ExceptionType, config: RTExcWindLevelConfig,
//        windLevelCondition: RTExcWindLevelConfig.WindLevelCondition?,
//    ) : this() {
//        if (tag.exceptionData.isEmpty()) return
//        deviceCode = tag.startData?.deviceCode
//        pollutedData = PollutedData(
//            tag.startData!!, tag.endData, factor, tag.exceptionData, tag.historyData, eType, windLevelCondition
//        )
//        pollutedArea = PollutedArea(tag.historyData, tag.exceptionData, config, windLevelCondition)
//    }
    constructor(
        exceptions: List<Pair<FactorFilter.SelectedFactor, ExceptionTag>>,
        eType: ExceptionType,
@@ -45,6 +33,7 @@
        var exceptionData = mutableListOf<BaseRealTimeData>()
        var historyData = mutableListOf<BaseRealTimeData>()
        exceptions.forEach { e ->
            // 将采样时间最早的作为开始数据
            if (startData == null) {
                startData = e.second.startData
            } else {
@@ -53,6 +42,7 @@
                }
            }
            // 将采样时间最晚的作为结束数据
            if (endData == null) {
                endData = e.second.endData
            } else {
@@ -61,6 +51,7 @@
                }
            }
            // 将所有异常数据去重合并
            if (exceptionData.isEmpty()) {
                exceptionData = e.second.exceptionData
            } else {
@@ -71,6 +62,7 @@
                }
            }
            // 将所有历史数据去重合并
            if (historyData.isEmpty()) {
                historyData = e.second.historyData
            } else {
@@ -81,21 +73,18 @@
                }
            }
        }
        // 按照采样时间升序排列
        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
        )
        pollutedArea = PollutedArea(historyData, exceptionData, config, windLevelCondition)
    }
    /**
     * 6. 展示数据变化情况,上升速率等等
     */
    /**
     * @see [MsgType]