feiyu02
7 天以前 594de76ed51fd49fb79b912212bb0052a63e7671
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,10 @@
    @GetMapping("/pollution/trace/history")
    fun fetchHistory(
        @ApiParam("走航任务编号") @RequestParam missionCode: String,
    ) = resPack { dataAnalysisService.fetchHistory(missionCode) }
        @ApiParam("最小污染百分比,用于筛选异常数据点(可选)") @RequestParam(required = false) minPer: Double? = null,
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?,
    ) = resPack { dataAnalysisService.fetchHistory(missionCode, minPer, page, perPage) }
    @ApiOperation(value = "生成走航任务汇总统计")
    @PostMapping("/report/missionSummary")
@@ -52,7 +51,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 +62,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 +79,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 +101,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 +114,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 +132,8 @@
            Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()),
            areaVo,
            analysisOption.removeOtherDistrict,
            analysisOption.removeNoPollutedSource
            analysisOption.removeNoPollutedSource,
            analysisOption.minPer,
        )
    }
@@ -130,7 +141,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 +160,10 @@
            factorTypes,
            Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()),
            Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()),
            areaVo
            areaVo,
            analysisOption.removeOtherDistrict,
            analysisOption.removeNoPollutedSource,
            analysisOption.minPer,
        )
    }
}