| | |
| | | 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 |
| | |
| | | @ApiOperation(value = "走航典型隐患区域统计") |
| | | @PostMapping("/report/clueByRiskArea") |
| | | fun generateClueByRiskArea( |
| | | @ApiParam("开始时间") @RequestParam |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | startTime: LocalDateTime, |
| | | @ApiParam("结束时间") @RequestParam |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | endTime: LocalDateTime, |
| | | @ApiParam("区域") @RequestBody areaVo: AreaVo, |
| | | @ApiParam("区域") @RequestBody analysisOption: AnalysisOption, |
| | | ) = resPack { |
| | | if (analysisOption.startTime == null || analysisOption.endTime == null || analysisOption.area == null) |
| | | throw BizException("参数错误, startTime, endTime, areaVo不能为空") |
| | | val startTime = analysisOption.startTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = analysisOption.endTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val areaVo = analysisOption.area!! |
| | | dataAnalysisService.generateClueByRiskArea( |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | areaVo |
| | | areaVo, |
| | | analysisOption.removeOtherDistrict, |
| | | analysisOption.removeNoPollutedSource |
| | | ) |
| | | } |
| | | |