feiyu02
2025-06-03 0bfd1f3b422677ddfed45f13fc034f17f049b9d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.flightfeather.uav.biz.sourcetrace.model
 
import com.flightfeather.uav.biz.FactorFilter
import com.flightfeather.uav.biz.dataanalysis.BaseExceptionResult
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.common.utils.MapUtil
import com.flightfeather.uav.domain.entity.BaseRealTimeData
import com.flightfeather.uav.domain.entity.SceneInfo
import com.flightfeather.uav.domain.repository.SceneInfoRep
 
/**
 * 污染线索
 * 通过污染数据[PollutedData],污染区域[PollutedArea],污染来源[PollutedSource],形成一条污染溯源线索
 * @date 2025/5/27
 * @author feiyu02
 */
class PollutedClue() : BaseExceptionResult() {
 
    constructor(
        start: BaseRealTimeData,
        end: BaseRealTimeData?,
        factor: FactorFilter.SelectedFactor,
        exceptionData: List<BaseRealTimeData>,
        eType: ExceptionType,
        config: RTExcWindLevelConfig,
        windLevelCondition: RTExcWindLevelConfig.WindLevelCondition
    ) : this() {
        this.factor = factor
        if (exceptionData.isEmpty()) return
        pollutedData = PollutedData(start, end, factor, exceptionData, eType, windLevelCondition)
        pollutedArea = PollutedArea(exceptionData, config, windLevelCondition)
    }
 
    /**
     * 6. 展示数据变化情况,上升速率等等
     */
 
    var pollutedData: PollutedData? = null
 
    var pollutedArea: PollutedArea? = null
 
    var pollutedSource: PollutedSource? = null
 
    private var factor: FactorFilter.SelectedFactor? = null
 
    /**
     * 查找系统内部溯源范围内的污染企业
     */
    fun searchScenes(sceneInfoRep: SceneInfoRep) {
        if (pollutedArea == null || factor == null) return
        pollutedSource = PollutedSource().also { it.searchScenes(pollutedArea!!, sceneInfoRep, factor!!) }
    }
}