feiyu02
2025-12-25 d649f734c44541641158aec2d6b10d630f5a0827
src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt
@@ -1,17 +1,13 @@
package com.flightfeather.uav.lightshare.web
import com.fasterxml.jackson.annotation.JsonFormat
import com.flightfeather.uav.common.exception.BizException
import com.flightfeather.uav.lightshare.bean.AnalysisOption
import com.flightfeather.uav.lightshare.bean.AreaVo
import com.flightfeather.uav.lightshare.service.DataAnalysisService
import com.flightfeather.uav.socket.eunm.FactorType
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.format.annotation.DateTimeFormat
import org.springframework.web.bind.annotation.*
import java.time.LocalDateTime
import java.time.ZoneId
import java.util.*
@@ -36,7 +32,8 @@
    @GetMapping("/pollution/trace/history")
    fun fetchHistory(
        @ApiParam("走航任务编号") @RequestParam missionCode: String,
    ) = resPack { dataAnalysisService.fetchHistory(missionCode) }
        @ApiParam("最小污染百分比,用于筛选异常数据点(可选)") @RequestParam(required = false) minPer: Double? = null,
    ) = resPack { dataAnalysisService.fetchHistory(missionCode, minPer) }
    @ApiOperation(value = "生成走航任务汇总统计")
    @PostMapping("/report/missionSummary")
@@ -52,7 +49,10 @@
        dataAnalysisService.generateMissionSummary(
            Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()),
            Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()),
            areaVo
            areaVo,
            analysisOption.removeOtherDistrict,
            analysisOption.removeNoPollutedSource,
            analysisOption.minPer,
        )
    }
@@ -60,7 +60,8 @@
    @GetMapping("/report/missionSummary/one")
    fun generateOneMissionSummary(
        @ApiParam("任务编号") @RequestParam missionCode: String,
    ) = resPack { dataAnalysisService.generateMissionSummary(missionCode) }
        @ApiParam("最小污染百分比,用于筛选异常数据点(可选)") @RequestParam(required = false) minPer: Double? = null,
    ) = resPack { dataAnalysisService.generateMissionSummary(missionCode, minPer) }
    @ApiOperation(value = "生成走航任务清单")
    @PostMapping("/report/missionList")
@@ -76,7 +77,10 @@
        dataAnalysisService.generateMissionList(
            Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()),
            Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()),
            areaVo
            areaVo,
            analysisOption.removeOtherDistrict,
            analysisOption.removeNoPollutedSource,
            analysisOption.minPer,
        )
    }
@@ -95,7 +99,10 @@
        dataAnalysisService.generateMissionDetail(
            Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()),
            Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()),
            areaVo,granularity
            areaVo,granularity,
            analysisOption.removeOtherDistrict,
            analysisOption.removeNoPollutedSource,
            analysisOption.minPer,
        )
    }
@@ -105,7 +112,8 @@
        @ApiParam("任务编号") @RequestParam missionCode: String,
        @ApiParam("数据颗粒度", allowableValues = "SECOND, MINUTE, HOUR") @RequestParam(required = false)
        granularity: String?,
    ) = resPack { dataAnalysisService.generateMissionDetail(missionCode, granularity) }
        @ApiParam("最小污染百分比,用于筛选异常数据点(可选)") @RequestParam(required = false) minPer: Double? = null,
    ) = resPack { dataAnalysisService.generateMissionDetail(missionCode, granularity, minPer) }
    @ApiOperation(value = "走航典型隐患区域统计")
    @PostMapping("/report/clueByRiskArea")
@@ -122,7 +130,8 @@
            Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()),
            areaVo,
            analysisOption.removeOtherDistrict,
            analysisOption.removeNoPollutedSource
            analysisOption.removeNoPollutedSource,
            analysisOption.minPer,
        )
    }
@@ -130,7 +139,8 @@
    @GetMapping("/report/clueByRiskArea/one")
    fun generateOneClueByRiskArea(
        @ApiParam("任务编号") @RequestParam missionCode: String,
    ) = resPack { dataAnalysisService.generateClueByRiskArea(missionCode) }
        @ApiParam("最小污染百分比,用于筛选异常数据点(可选)") @RequestParam(required = false) minPer: Double? = null,
    ) = resPack { dataAnalysisService.generateClueByRiskArea(missionCode, minPer) }
    @ApiOperation(value = "叠加融合分析")
    @PostMapping("/report/gridFusion")
@@ -148,7 +158,10 @@
            factorTypes,
            Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()),
            Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()),
            areaVo
            areaVo,
            analysisOption.removeOtherDistrict,
            analysisOption.removeNoPollutedSource,
            analysisOption.minPer,
        )
    }
}