feiyu02
2025-07-04 9c797fa0d704ef8ffb65cd1716b8eb694b4c46c3
2025.7.4
1. 新增动态污染溯源新的判定逻辑
已修改13个文件
已添加3个文件
245 ■■■■ 文件已修改
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/AnalysisResult.kt 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/BasePollutedMsg.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/DistanceType.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedSummary.kt 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/repository/SourceTraceRep.kt 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/DataAnalysisService.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImpl.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/socket/UnderwaySocketServer.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/socket/handler/UnderwayWebSocketServerHandler.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/socket/sender/MsgType.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt
@@ -5,11 +5,13 @@
import com.flightfeather.uav.biz.sourcetrace.RealTimeAnalysisConfig
import com.flightfeather.uav.biz.sourcetrace.config.RTExcWindLevelConfig
import com.flightfeather.uav.biz.sourcetrace.exceptiontype.*
import com.flightfeather.uav.biz.sourcetrace.model.AnalysisResult
import com.flightfeather.uav.biz.sourcetrace.model.PollutedClue
import com.flightfeather.uav.biz.sourcetrace.model.PollutedSummary
import com.flightfeather.uav.common.utils.GsonUtils
import com.flightfeather.uav.domain.entity.BaseRealTimeData
import com.flightfeather.uav.domain.repository.SceneInfoRep
import com.flightfeather.uav.domain.repository.SourceTraceRep
import com.flightfeather.uav.socket.eunm.FactorType
import com.flightfeather.uav.socket.sender.MsgType
import com.flightfeather.uav.socket.sender.UnderwayWebSocketSender
@@ -28,11 +30,12 @@
     * æ¯ä¸€åˆ»é’Ÿå¯¹åŽ†å²çº¿ç´¢è¿›è¡Œç»Ÿè®¡ï¼Œæå‡ºä¼šå•†å»ºè®®ï¼ˆç¦»æ±¡æŸ“æºè¾ƒè¿œã€æ±¡æŸ“æºæ•°é‡ã€å‡ºçŽ°æ¬¡æ•°ï¼‰ã€èµ°èˆªè·¯çº¿è°ƒæ•´å»ºè®®ï¼ˆç¦»æ±¡æŸ“æºè¾ƒè¿‘ã€èµ°èˆªè½¨è¿¹æœªæŽ¥è¿‘æº¯æºåœºæ™¯ï¼‰
     */
    constructor(sceneInfoRep: SceneInfoRep, factorFilter: FactorFilter?) {
    constructor(sceneInfoRep: SceneInfoRep, sourceTraceRep: SourceTraceRep, factorFilter: FactorFilter?) {
        this.sceneInfoRep = sceneInfoRep
        this.config = if (factorFilter != null)
        this.sourceTraceRep = sourceTraceRep
        this.config = if (factorFilter != null) {
            RTExcWindLevelConfig(factorFilter)
        else
        } else {
            RTExcWindLevelConfig(
                FactorFilter.builder()
//                    .withMain(FactorType.NO2)
@@ -45,16 +48,16 @@
                    .withMain(FactorType.VOC)
                    .create()
            )
        }
        pollutedSummary = PollutedSummary(config) { summaryCallback(it) }
        newTask()
    }
    constructor(sceneInfoRep: SceneInfoRep) : this(sceneInfoRep, null)
    constructor(sceneInfoRep: SceneInfoRep, sourceTraceRep: SourceTraceRep) : this(sceneInfoRep, sourceTraceRep, null)
    private val pollutedSummary: PollutedSummary
    private val sceneInfoRep: SceneInfoRep
    private val sourceTraceRep: SourceTraceRep
    private val config: RTExcWindLevelConfig
    private val taskList = mutableListOf<BaseExceptionAnalysis<RTExcWindLevelConfig, PollutedClue>>()
@@ -103,9 +106,11 @@
    private fun exceptionCallback(ex: PollutedClue) {
        // æº¯æºæ±¡æŸ“源信息
        ex.searchScenes(sceneInfoRep)
        ex.msgType = MsgType.PolClue.value
        // å¹¿æ’­æ±¡æŸ“溯源异常结果
        UnderwayWebSocketSender.broadcast(MsgType.PolClue.value, ex)
        sourceTraceRep.insert(MsgType.PolClue, ex)
        // è®°å½•污染线索
        pollutedSummary.addClue(ex)
@@ -115,13 +120,17 @@
    private fun dataChangeCallback(ex: PollutedClue) {
        // æº¯æºæ±¡æŸ“源信息
        ex.searchScenes(sceneInfoRep)
        ex.msgType = MsgType.DataChange.value
        // å¹¿æ’­æ•°æ®å˜åŒ–提醒
        UnderwayWebSocketSender.broadcast(MsgType.DataChange.value, ex)
        sourceTraceRep.insert(MsgType.DataChange, ex)
    }
    private fun summaryCallback(ex: PollutedSummary.AnalysisResult) {
    private fun summaryCallback(ex: AnalysisResult) {
        ex.msgType = MsgType.AnaResult.value
        // å¹¿æ’­æ±¡æŸ“溯源异常结果
        UnderwayWebSocketSender.broadcast(MsgType.AnaResult.value, ex)
        sourceTraceRep.insert(ex)
    }
}
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/AnalysisResult.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
package com.flightfeather.uav.biz.sourcetrace.model
import com.flightfeather.uav.biz.dataanalysis.BaseExceptionResult
import com.flightfeather.uav.common.net.AMapService
import com.flightfeather.uav.domain.entity.SceneInfo
import com.flightfeather.uav.socket.sender.MsgType
import java.util.*
/**
 * åˆ†æžç»“æžœ
 * @date 2025/7/4
 * @author feiyu02
 */
class AnalysisResult : BaseExceptionResult() {
    /**
     * @see [MsgType]
     */
    var msgType: Int? = null
    var deviceCode: String? = null
    // æŒ‰ç…§è¢«æ‰«ææ¬¡æ•°é™åºæŽ’列的污染源列表
    var sortedSceneList: List<Pair<SceneInfo?, Int>>? = null
    var time: Date? = null
    var advice: String? = null
    var direction: AMapService.AMapDirection? = null
}
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/BasePollutedMsg.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package com.flightfeather.uav.biz.sourcetrace.model
import com.flightfeather.uav.socket.sender.MsgType
/**
 * åŠ¨æ€æº¯æºä¿¡æ¯
 * @date 2025/7/4
 * @author feiyu02
 * åŒ…含消息的类型为[MsgType]
 * å¯¹åº”的数据结构包括[PollutedClue],[AnalysisResult]
 */
interface BasePollutedMsg
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/DistanceType.kt
@@ -6,7 +6,7 @@
 * @author feiyu02
 */
enum class DistanceType(val des: String, val disRange: Pair<Double, Double>) {
    TYPE1("50ç±³", .0 to 50.0),
    TYPE1("100ç±³", .0 to 100.0),
    TYPE2("50ç±³ - 500ç±³", 50.0 to 500.0),
    TYPE3("50ç±³ - 1公里", 50.0 to 1000.0),
    TYPE4("50ç±³ - 2公里", 50.0 to 2000.0);
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt
@@ -10,6 +10,7 @@
import com.flightfeather.uav.domain.entity.BaseRealTimeData
import com.flightfeather.uav.domain.entity.SceneInfo
import com.flightfeather.uav.domain.repository.SceneInfoRep
import com.flightfeather.uav.socket.sender.MsgType
/**
 * æ±¡æŸ“线索
@@ -17,7 +18,7 @@
 * @date 2025/5/27
 * @author feiyu02
 */
class PollutedClue() : BaseExceptionResult() {
class PollutedClue() : BaseExceptionResult(){
//    constructor(
//        start: BaseRealTimeData,
@@ -36,13 +37,14 @@
    constructor(
        tag: ExceptionTag, factor: FactorFilter.SelectedFactor, eType: ExceptionType, config: RTExcWindLevelConfig,
        windLevelCondition: RTExcWindLevelConfig.WindLevelCondition?,
    ) :this()
    ) : this()
//            this(
//        tag.startData!!, tag.endData, factor, tag.exceptionData, eType, config,
//        windLevelCondition
//    )
    {
        if (tag.exceptionData.isEmpty()) return
        deviceCode = tag.startData?.deviceCode
        pollutedData = PollutedData(
            tag.startData!!, tag.endData, factor, tag.exceptionData, tag.historyData, eType, windLevelCondition
        )
@@ -53,6 +55,13 @@
     * 6. å±•示数据变化情况,上升速率等等
     */
    /**
     * @see [MsgType]
     */
    var msgType: Int? = null
    var deviceCode: String? = null
    var pollutedData: PollutedData? = null
    var pollutedArea: PollutedArea? = null
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt
@@ -6,6 +6,7 @@
import com.flightfeather.uav.common.utils.DateUtil
import com.flightfeather.uav.domain.entity.BaseRealTimeData
import com.flightfeather.uav.lightshare.bean.DataVo
import java.util.Date
/**
 * æ±¡æŸ“数据
@@ -40,8 +41,8 @@
        subFactorName = factor.subs.map { it.des }
        selectedFactor = factor
        startTime = DateUtil.instance.dateToString(start.dataTime, DateUtil.DateStyle.HH_MM_SS)
        endTime = DateUtil.instance.dateToString(end?.dataTime, DateUtil.DateStyle.HH_MM_SS) ?: startTime
        startTime = start.dataTime
        endTime = end?.dataTime
//        startData = start.getByFactorType(factor.main)
//        endData = end?.getByFactorType(factor.main) ?: startData
        startData = start
@@ -73,8 +74,8 @@
    var subFactorName: List<String>? = null
    var selectedFactor: FactorFilter.SelectedFactor? = null
    var startTime: String? = null
    var endTime: String? = null
    var startTime: Date? = null
    var endTime: Date? = null
    var startData: BaseRealTimeData? = null
    var endData: BaseRealTimeData? = null
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedSummary.kt
@@ -2,6 +2,7 @@
import com.flightfeather.uav.biz.sourcetrace.config.RTExcWindLevelConfig
import com.flightfeather.uav.common.net.AMapService
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
@@ -12,7 +13,7 @@
import java.util.TimerTask
// å¼‚常数据生成回调类
typealias NewPolluteSummaryCallback = (ex: PollutedSummary.AnalysisResult) -> Unit
typealias NewPolluteSummaryCallback = (ex: AnalysisResult) -> Unit
/**
 * æ±¡æŸ“情况汇总
@@ -27,17 +28,6 @@
     * 5. æ±¡æŸ“源的被扫描次数
     * æ¯ä¸€åˆ»é’Ÿå¯¹åŽ†å²çº¿ç´¢è¿›è¡Œç»Ÿè®¡ï¼Œæå‡ºä¼šå•†å»ºè®®ï¼ˆç¦»æ±¡æŸ“æºè¾ƒè¿œã€æ±¡æŸ“æºæ•°é‡ã€å‡ºçŽ°æ¬¡æ•°ï¼‰ã€èµ°èˆªè·¯çº¿è°ƒæ•´å»ºè®®ï¼ˆç¦»æ±¡æŸ“æºè¾ƒè¿‘ã€èµ°èˆªè½¨è¿¹æœªæŽ¥è¿‘æº¯æºåœºæ™¯ï¼‰
     */
    /**
     * åˆ†æžç»“æžœ
     */
    inner class AnalysisResult {
        // æŒ‰ç…§è¢«æ‰«ææ¬¡æ•°é™åºæŽ’列的污染源列表
        var sortedSceneList: List<Pair<SceneInfo?, Int>>? = null
        var time: Date? = null
        var advice: String? = null
        var direction: AMapService.AMapDirection? = null
    }
    /**
     * å®žæ—¶ç»Ÿè®¡
@@ -146,7 +136,7 @@
     */
    private fun analysis() {
        if (clueList.isEmpty()) return
        val result = AnalysisResult()
        val result = AnalysisResult().apply { deviceCode = clueList.first().deviceCode }
        // å…±æœ‰å¤šå°‘相关污染源,哪些污染源被扫描次数较多
        val sceneMap = mutableMapOf<String?, Pair<SceneInfo?, Int>>()
        clueList.forEach { c ->
@@ -163,8 +153,8 @@
        // å½“前的走航数据的定位和污染源距离是否是逐渐接近,若走航远离了主要污染源,提示用户调整走航路线
        if (!result.sortedSceneList.isNullOrEmpty()) {
            val sT = clueList.first().pollutedData?.startTime
            val eT = clueList.last().pollutedData?.endTime
            val sT = DateUtil.instance.dateToString(clueList.first().pollutedData?.startTime, DateUtil.DateStyle.HH_MM_SS)
            val eT = DateUtil.instance.dateToString(clueList.last().pollutedData?.endTime, DateUtil.DateStyle.HH_MM_SS)
            val closetScene = result.sortedSceneList?.first()
            // èµ°èˆªè·¯çº¿è°ƒæ•´å»ºè®®
            result.advice =
src/main/kotlin/com/flightfeather/uav/domain/repository/SourceTraceRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,98 @@
package com.flightfeather.uav.domain.repository
import com.flightfeather.uav.biz.dataanalysis.BaseExceptionResult
import com.flightfeather.uav.biz.sourcetrace.model.AnalysisResult
import com.flightfeather.uav.biz.sourcetrace.model.BasePollutedMsg
import com.flightfeather.uav.biz.sourcetrace.model.PollutedClue
import com.flightfeather.uav.biz.sourcetrace.model.PollutedSummary
import com.flightfeather.uav.common.utils.GsonUtils
import com.flightfeather.uav.domain.entity.SourceTraceMsg
import com.flightfeather.uav.domain.mapper.SourceTraceMsgMapper
import com.flightfeather.uav.socket.sender.MsgType
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
import java.util.*
/**
 * åŠ¨æ€æ±¡æŸ“æº¯æºæ•°æ®åº“æ“ä½œ
 * @date 2025/7/4
 * @author feiyu02
 */
@Repository
class SourceTraceRep(private val sourceTraceMsgMapper: SourceTraceMsgMapper) {
    /**
     * æ’入溯源信息和提醒信息
     */
    fun insert(msgType: MsgType, obj: PollutedClue): Int {
        val stm = SourceTraceMsg().apply {
            deviceCode = obj.deviceCode
            factorName = obj.pollutedData?.factorName
            exceptionType = obj.pollutedData?.exceptionType
            startTime = obj.pollutedData?.startTime
            endTime = obj.pollutedData?.endTime
            this.msgType = msgType.value
            content = GsonUtils.gson.toJson(obj)
            createTime = Date()
        }
        return if (fetchOneExist(stm) == null) {
            sourceTraceMsgMapper.insert(stm)
        } else {
            0
        }
    }
    /**
     * æ’入线索信息
     */
    fun insert(res: AnalysisResult): Int {
        val stm = SourceTraceMsg().apply {
            deviceCode = res.deviceCode
            startTime = res.time
            endTime = res.time
            this.msgType = MsgType.AnaResult.value
            content = GsonUtils.gson.toJson(res)
            createTime = Date()
        }
        return if (fetchOneExist(stm) == null) {
            sourceTraceMsgMapper.insert(stm)
        } else {
            0
        }
    }
    fun fetchOneExist(stm: SourceTraceMsg): SourceTraceMsg? {
        val res = sourceTraceMsgMapper.selectByExample(Example(SourceTraceMsg::class.java).apply {
            createCriteria().andEqualTo("deviceCode", stm.deviceCode)
                .andEqualTo("msgType", stm.msgType)
                .andEqualTo("exceptionType", stm.exceptionType)
                .andEqualTo("factorName", stm.factorName)
                .andEqualTo("startTime", stm.startTime)
                .andEqualTo("endTime", stm.endTime)
        })
        return if (res.isEmpty()) null else res[0]
    }
    fun fetchList(deviceCode: String, startTime: Date, endTime: Date): List<BaseExceptionResult?> {
        return sourceTraceMsgMapper.selectByExample(Example(SourceTraceMsg::class.java).apply {
            createCriteria().andEqualTo("deviceCode", deviceCode)
                .andGreaterThanOrEqualTo("startTime", startTime)
                .andLessThanOrEqualTo("endTime", endTime)
            orderBy("id").desc()
        }).map { stm ->
            when (stm?.msgType) {
                MsgType.PolClue.value,
                MsgType.DataChange.value,
                    -> {
                    GsonUtils.gson.fromJson(stm.content, PollutedClue::class.java)
                }
                MsgType.AnaResult.value -> {
                    GsonUtils.gson.fromJson(stm.content, AnalysisResult::class.java)
                }
                else -> null
            }
        }
    }
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/DataAnalysisService.kt
@@ -1,6 +1,8 @@
package com.flightfeather.uav.lightshare.service
import com.flightfeather.uav.biz.dataanalysis.BaseExceptionResult
import com.flightfeather.uav.biz.dataanalysis.model.ExceptionResult
import com.flightfeather.uav.biz.sourcetrace.model.BasePollutedMsg
/**
 *
@@ -14,4 +16,6 @@
     * @param missionCode èµ°èˆªä»»åŠ¡ç¼–å·
     */
    fun pollutionTrace(missionCode: String): List<ExceptionResult>
    fun fetchHistory(missionCode: String): String
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImpl.kt
@@ -1,13 +1,17 @@
package com.flightfeather.uav.lightshare.service.impl
import com.flightfeather.uav.biz.FactorFilter
import com.flightfeather.uav.biz.dataanalysis.BaseExceptionResult
import com.flightfeather.uav.biz.dataanalysis.ExceptionAnalysisController
import com.flightfeather.uav.biz.dataanalysis.model.ExceptionResult
import com.flightfeather.uav.biz.sourcetrace.model.BasePollutedMsg
import com.flightfeather.uav.common.exception.BizException
import com.flightfeather.uav.common.location.LocationRoadNearby
import com.flightfeather.uav.common.utils.GsonUtils
import com.flightfeather.uav.domain.repository.MissionRep
import com.flightfeather.uav.domain.repository.RealTimeDataRep
import com.flightfeather.uav.domain.repository.SegmentInfoRep
import com.flightfeather.uav.domain.repository.SourceTraceRep
import com.flightfeather.uav.lightshare.service.DataAnalysisService
import com.flightfeather.uav.socket.eunm.FactorType
import org.springframework.stereotype.Service
@@ -23,6 +27,7 @@
    private val realTimeDataRep: RealTimeDataRep,
    private val locationRoadNearby: LocationRoadNearby,
    private val segmentInfoRep: SegmentInfoRep,
    private val sourceTraceRep: SourceTraceRep
) : DataAnalysisService {
    override fun pollutionTrace(missionCode: String): List<ExceptionResult> {
@@ -44,4 +49,11 @@
                .create()
        )
    }
    override fun fetchHistory(missionCode: String): String {
        val mission = missionRep.findOne(missionCode) ?: throw BizException("走航任务不存在")
        val res = sourceTraceRep.fetchList(mission.deviceCode, mission.startTime, mission.endTime)
        return GsonUtils.gson.toJson(res)
    }
}
src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt
@@ -25,4 +25,10 @@
//        @RequestParam("per_page", required = false) perPage: Int?,
    ) = resPack { dataAnalysisService.pollutionTrace(missionCode) }
    @ApiOperation(value = "获取历史污染溯源结果")
    @GetMapping("/pollution/trace/history")
    fun fetchHistory(
        @ApiParam("走航任务编号") @RequestParam missionCode: String,
    ) = resPack { dataAnalysisService.fetchHistory(missionCode) }
}
src/main/kotlin/com/flightfeather/uav/socket/UnderwaySocketServer.kt
@@ -1,6 +1,7 @@
package com.flightfeather.uav.socket
import com.flightfeather.uav.domain.repository.SceneInfoRep
import com.flightfeather.uav.domain.repository.SourceTraceRep
import com.flightfeather.uav.socket.handler.ServerHandler
import com.flightfeather.uav.socket.handler.UnderwayWebSocketServerHandler
import com.flightfeather.uav.socket.processor.BaseProcessor
@@ -26,7 +27,8 @@
 * *******************************************************************************/
@Component
class UnderwaySocketServer(
    private val sceneInfoRep: SceneInfoRep
    private val sceneInfoRep: SceneInfoRep,
    private val sourceTraceRep: SourceTraceRep
) {
    private val bossGroup = NioEventLoopGroup()
@@ -99,7 +101,7 @@
                ?.addLast(HttpServerCodec())
                ?.addLast(HttpObjectAggregator(65535))
                ?.addLast(WebSocketServerProtocolHandler("/ws"))
                ?.addLast(UnderwayWebSocketServerHandler(sceneInfoRep))
                ?.addLast(UnderwayWebSocketServerHandler(sceneInfoRep, sourceTraceRep))
        }
    })
}
src/main/kotlin/com/flightfeather/uav/socket/handler/UnderwayWebSocketServerHandler.kt
@@ -4,6 +4,7 @@
import com.flightfeather.uav.common.utils.GsonUtils
import com.flightfeather.uav.domain.entity.BaseRealTimeData
import com.flightfeather.uav.domain.repository.SceneInfoRep
import com.flightfeather.uav.domain.repository.SourceTraceRep
import com.flightfeather.uav.lightshare.bean.DataVo
import com.flightfeather.uav.socket.sender.UnderwayWebSocketSender
import io.netty.channel.ChannelHandlerContext
@@ -14,9 +15,9 @@
 * @date 2025/5/13
 * @author feiyu02
 */
class UnderwayWebSocketServerHandler(sceneInfoRep: SceneInfoRep) : BaseHandler() {
class UnderwayWebSocketServerHandler(sceneInfoRep: SceneInfoRep, sourceTraceRep: SourceTraceRep) : BaseHandler() {
    private val sourceTraceController = SourceTraceController(sceneInfoRep)
    private val sourceTraceController = SourceTraceController(sceneInfoRep, sourceTraceRep)
    override var tag: String = "UAV-WS"
src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt
@@ -5,6 +5,7 @@
import com.flightfeather.uav.model.epw.EPWDataPrep
import com.flightfeather.uav.domain.repository.AirDataRep
import com.flightfeather.uav.domain.repository.SceneInfoRep
import com.flightfeather.uav.domain.repository.SourceTraceRep
import com.flightfeather.uav.socket.bean.AirDataPackage
import com.flightfeather.uav.socket.decoder.AirDataDecoder
import com.flightfeather.uav.socket.decoder.DataPackageDecoder
@@ -25,6 +26,7 @@
class UnderwayProcessor(
    private val airDataRep: AirDataRep,
    private val sceneInfoRep: SceneInfoRep,
    private val sourceTraceRep: SourceTraceRep
) : BaseProcessor() {
    companion object {
@@ -53,7 +55,7 @@
            saveToDataBase(packageData)?.takeIf { it.isNotEmpty() }?.get(0)?.let {
                // æ¯å°è®¾å¤‡æœ‰å„自单独的异常数据处理器
                if (!sourceTraceMap.containsKey(it.deviceCode)) {
                    sourceTraceMap[it.deviceCode] = SourceTraceController(sceneInfoRep)
                    sourceTraceMap[it.deviceCode] = SourceTraceController(sceneInfoRep, sourceTraceRep)
                }
                // å°†èµ°èˆªæ•°æ®ä¼ å…¥å¼‚常处理器
                sourceTraceMap[it.deviceCode]?.addOneData(it)
src/main/kotlin/com/flightfeather/uav/socket/sender/MsgType.kt
@@ -12,7 +12,7 @@
    /**
     * æ±¡æŸ“分析结果
     * @see [PollutedSummary.AnalysisResult]
     * @see [AnalysisResult]
     */
    AnaResult(2),
src/main/resources/generator/generatorConfig.xml
@@ -52,7 +52,7 @@
        </javaClientGenerator>
        <!-- è¦ç”Ÿæˆçš„表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<!--        <table tableName="air_real_time_data" domainObjectName="RealTimeData" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <table tableName="mission" domainObjectName="Mission" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
<!--        <table tableName="mission" domainObjectName="Mission" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="el_minutevalue" domainObjectName="ElectricMinuteValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="el_company_device" domainObjectName="CompanyDevice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="co_complaint" domainObjectName="Complaint" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
@@ -70,5 +70,6 @@
<!--        <table tableName="grid_cell" domainObjectName="GridCell" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="grid_data" domainObjectName="GridData" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="grid_data_detail" domainObjectName="GridDataDetail" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <table tableName="source_trace_msg" domainObjectName="SourceTraceMsg" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
    </context>
</generatorConfiguration>