| | |
| | | @RequestMapping("air/analysis") |
| | | class DataAnalysisController(private val dataAnalysisService: DataAnalysisService) { |
| | | |
| | | @Deprecated("该接口已废弃,使用/report/missionSummary/one接口") |
| | | @ApiOperation(value = "污染溯源分析") |
| | | @GetMapping("/pollution/trace") |
| | | fun pollutionTrace( |
| | | @ApiParam("走航任务编号") @RequestParam missionCode: String, |
| | | // @RequestParam("page", required = false) page: Int?, |
| | | // @RequestParam("per_page", required = false) perPage: Int?, |
| | | ) = resPack { dataAnalysisService.pollutionTrace(missionCode) } |
| | | |
| | | @ApiOperation(value = "获取历史污染溯源结果") |
| | |
| | | @ApiOperation(value = "生成走航任务汇总统计") |
| | | @PostMapping("/report/missionSummary") |
| | | fun generateMissionSummary( |
| | | @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, area不能为空") |
| | | val startTime = analysisOption.startTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = analysisOption.endTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val areaVo = analysisOption.area!! |
| | | |
| | | dataAnalysisService.generateMissionSummary( |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | |
| | | @ApiOperation(value = "生成走航任务清单") |
| | | @PostMapping("/report/missionList") |
| | | fun generateMissionList( |
| | | @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, area不能为空") |
| | | val startTime = analysisOption.startTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = analysisOption.endTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val areaVo = analysisOption.area!! |
| | | |
| | | dataAnalysisService.generateMissionList( |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | |
| | | @ApiOperation(value = "生成走航任务详情") |
| | | @PostMapping("/report/missionDetail") |
| | | fun generateMissionDetail( |
| | | @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("数据颗粒度", allowableValues = "SECOND, MINUTE, HOUR") @RequestParam(required = false) |
| | | granularity: String?, |
| | | @ApiParam("区域") @RequestBody areaVo: AreaVo, |
| | | @ApiParam("分析选项") @RequestBody analysisOption: AnalysisOption, |
| | | ) = resPack { |
| | | if (analysisOption.startTime == null || analysisOption.endTime == null || analysisOption.area == null) |
| | | throw BizException("参数错误, startTime, endTime, area不能为空") |
| | | val startTime = analysisOption.startTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = analysisOption.endTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val areaVo = analysisOption.area!! |
| | | val granularity = analysisOption.granularity |
| | | |
| | | dataAnalysisService.generateMissionDetail( |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | |
| | | @ApiOperation(value = "走航典型隐患区域统计") |
| | | @PostMapping("/report/clueByRiskArea") |
| | | fun generateClueByRiskArea( |
| | | @ApiParam("区域") @RequestBody analysisOption: AnalysisOption, |
| | | @ApiParam("分析选项") @RequestBody analysisOption: AnalysisOption, |
| | | ) = resPack { |
| | | if (analysisOption.startTime == null || analysisOption.endTime == null || analysisOption.area == null) |
| | | throw BizException("参数错误, startTime, endTime, areaVo不能为空") |
| | | throw BizException("参数错误, startTime, endTime, area不能为空") |
| | | val startTime = analysisOption.startTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = analysisOption.endTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val areaVo = analysisOption.area!! |
| | |
| | | @ApiOperation(value = "叠加融合分析") |
| | | @PostMapping("/report/gridFusion") |
| | | fun generateGridFusion( |
| | | @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("需要统计的监测因子", example = "NO2, CO") @RequestParam |
| | | factorTypes: String, |
| | | @ApiParam("区域") @RequestBody areaVo: AreaVo, |
| | | @ApiParam("分析选项") @RequestBody analysisOption: AnalysisOption, |
| | | ) = resPack { |
| | | if (analysisOption.startTime == null || analysisOption.endTime == null || analysisOption.area == null || analysisOption.factorTypes == null) |
| | | throw BizException("参数错误, startTime, endTime, area, factorTypes不能为空") |
| | | val startTime = analysisOption.startTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = analysisOption.endTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val areaVo = analysisOption.area!! |
| | | val factorTypes = analysisOption.factorTypes!!.map { FactorType.valueOf(it) } |
| | | |
| | | dataAnalysisService.generateGridFusion( |
| | | factorTypes.split(",").map { FactorType.valueOf(it) }, |
| | | factorTypes, |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | areaVo |