| | |
| | | package com.flightfeather.uav.biz.dataanalysis |
| | | |
| | | import com.flightfeather.uav.biz.FactorFilter |
| | | import com.flightfeather.uav.biz.dataanalysis.exceptiontype.ExceptionDataExceed |
| | | import com.flightfeather.uav.biz.dataanalysis.exceptiontype.ExceptionSlideAverage |
| | | import com.flightfeather.uav.biz.dataanalysis.exceptiontype.ExceptionValueMutation |
| | | import com.flightfeather.uav.biz.dataanalysis.model.DataAnalysisConfig |
| | |
| | | import com.flightfeather.uav.domain.repository.RealTimeDataRep |
| | | import com.flightfeather.uav.domain.repository.SegmentInfoRep |
| | | import com.flightfeather.uav.socket.eunm.UWDeviceType |
| | | import org.springframework.stereotype.Component |
| | | import java.time.LocalDateTime |
| | | import java.time.ZoneId |
| | | import java.time.format.DateTimeFormatter |
| | | |
| | | /** |
| | | * 数据异常分析控制器 |
| | | */ |
| | | @Component |
| | | class ExceptionAnalysisController( |
| | | private val realTimeDataRep: RealTimeDataRep, |
| | | private val locationRoadNearby: LocationRoadNearby, |
| | |
| | | private fun initTask(config: DataAnalysisConfig) { |
| | | taskList.clear() |
| | | taskList.apply { |
| | | add(ExceptionDataExceed(config)) |
| | | // add(ExceptionDataExceed(config)) |
| | | add(ExceptionValueMutation(config)) |
| | | add(ExceptionSlideAverage(config)) |
| | | } |
| | | } |
| | | |
| | | fun run(mission: Mission, factorFilter: FactorFilter): List<ExceptionResult> { |
| | | fun execute(mission: Mission, factorFilter: FactorFilter): List<ExceptionResult> { |
| | | running = true |
| | | val config = DataAnalysisConfig(mission, ExceptionSetting(), factorFilter) |
| | | initTask(config) |
| | |
| | | // 查询异常周边可能污染源 |
| | | nearBy(r, config) |
| | | // 查询时段所在路段 |
| | | road(r) |
| | | // road(r) |
| | | // 将数据转换为通用格式 |
| | | r.dataVoList = r.dataList.map { e-> e.toDataVo() } |
| | | } |
| | | // 存储分析结果 |
| | | result.addAll(it.resultList) |
| | |
| | | running = false |
| | | return result |
| | | } |
| | | |
| | | // private fun |
| | | |
| | | private fun nearBy(r: ExceptionResult, config: DataAnalysisConfig) { |
| | | if (r.longitude != null && r.latitude != null) { |
| | |
| | | } |
| | | r.relatedSceneId = idList |
| | | r.relatedSceneName = nameList |
| | | r.relatedSceneList = sceneList |
| | | } |
| | | } |
| | | } |