From 4a976d3763be8a7bed743faf24abf2718ae18e31 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期三, 15 十月 2025 17:34:14 +0800 Subject: [PATCH] 2025.10.15 1. 走航季度报告相关数据计算逻辑调整 --- src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt | 45 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt index d6057bb..07b27c3 100644 --- a/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt +++ b/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt @@ -1,6 +1,8 @@ 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 @@ -57,6 +59,12 @@ ) } + @ApiOperation(value = "鐢熸垚璧拌埅浠诲姟姹囨�荤粺璁�") + @GetMapping("/report/missionSummary/one") + fun generateOneMissionSummary( + @ApiParam("浠诲姟缂栧彿") @RequestParam missionCode: String, + ) = resPack { dataAnalysisService.generateMissionSummary(missionCode) } + @ApiOperation(value = "鐢熸垚璧拌埅浠诲姟娓呭崟") @PostMapping("/report/missionList") fun generateMissionList( @@ -88,35 +96,50 @@ @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, ) = resPack { dataAnalysisService.generateMissionDetail( Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), - areaVo + areaVo,granularity ) } + + @ApiOperation(value = "鐢熸垚璧拌埅浠诲姟璇︽儏") + @GetMapping("/report/missionDetail/one") + fun generateOneMissionDetail( + @ApiParam("浠诲姟缂栧彿") @RequestParam missionCode: String, + @ApiParam("鏁版嵁棰楃矑搴�", allowableValues = "SECOND, MINUTE, HOUR") @RequestParam(required = false) + granularity: String?, + ) = resPack { dataAnalysisService.generateMissionDetail(missionCode, granularity) } @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 ) } + @ApiOperation(value = "璧拌埅鍏稿瀷闅愭偅鍖哄煙缁熻") + @GetMapping("/report/clueByRiskArea/one") + fun generateOneClueByRiskArea( + @ApiParam("浠诲姟缂栧彿") @RequestParam missionCode: String, + ) = resPack { dataAnalysisService.generateClueByRiskArea(missionCode) } + @ApiOperation(value = "鍙犲姞铻嶅悎鍒嗘瀽") @PostMapping("/report/gridFusion") fun generateGridFusion( -- Gitblit v1.9.3