| | |
| | | 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.* |
| | | |
| | |
| | | @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") |
| | |
| | | dataAnalysisService.generateMissionSummary( |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | areaVo |
| | | areaVo, |
| | | analysisOption.removeOtherDistrict, |
| | | analysisOption.removeNoPollutedSource, |
| | | analysisOption.minPer, |
| | | ) |
| | | } |
| | | |
| | |
| | | @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") |
| | |
| | | dataAnalysisService.generateMissionList( |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | areaVo |
| | | areaVo, |
| | | analysisOption.removeOtherDistrict, |
| | | analysisOption.removeNoPollutedSource, |
| | | analysisOption.minPer, |
| | | ) |
| | | } |
| | | |
| | |
| | | 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, |
| | | ) |
| | | } |
| | | |
| | |
| | | @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") |
| | |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | areaVo, |
| | | analysisOption.removeOtherDistrict, |
| | | analysisOption.removeNoPollutedSource |
| | | analysisOption.removeNoPollutedSource, |
| | | analysisOption.minPer, |
| | | ) |
| | | } |
| | | |
| | |
| | | @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") |
| | |
| | | factorTypes, |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | areaVo |
| | | areaVo, |
| | | analysisOption.removeOtherDistrict, |
| | | analysisOption.removeNoPollutedSource, |
| | | analysisOption.minPer, |
| | | ) |
| | | } |
| | | } |