package com.flightfeather.uav.biz.report
|
|
import com.flightfeather.uav.biz.sourcetrace.model.PollutedClue
|
import com.flightfeather.uav.domain.entity.Mission
|
import com.flightfeather.uav.domain.entity.SceneInfo
|
import com.flightfeather.uav.lightshare.bean.FactorStatistics
|
import com.flightfeather.uav.socket.eunm.FactorType
|
import com.flightfeather.uav.socket.sender.MsgType
|
|
/**
|
* 走航溯源清单
|
* 包含时段内的走航任务汇总清单以及每次走航的数据汇总清单
|
* @date 2025/8/25 11:02
|
* @author feiyu
|
*/
|
class MissionInventory {
|
|
// 走航清单信息
|
class MissionInfo : Mission() {
|
// 首要污染物
|
var mainFactor: String? = null
|
|
// 监测异常因子
|
var abnormalFactors: List<FactorType>? = null
|
|
// 溯源问题场景数
|
var sceneCount: Int = 0
|
}
|
|
// 走航详情信息
|
class MissionDetail : Mission() {
|
var keyScene: List<SceneInfo>? = null
|
var dataStatistics: List<FactorStatistics>? = null
|
}
|
|
/**
|
* 输出走航清单
|
*/
|
fun missionList(missionClues: List<Pair<Mission?, List<PollutedClue?>>>): List<MissionInfo> {
|
|
val missionMap = mutableMapOf<String, MissionInfo>()
|
missionClues.forEach { (mission, clue) ->
|
mission ?: return@forEach
|
clue ?: return@forEach
|
val missionInfo = missionMap[mission.missionCode] ?: MissionInfo().apply {
|
missionMap[mission.missionCode] = this
|
}
|
val abnormalFactors = mutableListOf<FactorType>()
|
var sceneCount = 0
|
clue.forEach {
|
if (it?.msgType == MsgType.PolClue.value) {
|
it.pollutedData?.statisticMap?.keys?.forEach { k->
|
if (!abnormalFactors.contains(k)) {
|
abnormalFactors.add(k)
|
}
|
}
|
}
|
}
|
// 计算每个走航任务的所有异常因子
|
|
// 计算每个走航任务的首要污染物
|
|
// 计算每个走航任务的溯源场景数量
|
}
|
return mutableListOf()
|
}
|
}
|