From 8c6e742562d0c8647e0ee8deff01a3eb176d677b Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 02 九月 2025 17:30:47 +0800 Subject: [PATCH] 2025.9.2 1. 新增走航任务统计功能(待完成) --- src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt | 82 +++++++++++++++++++++++++++-------------- 1 files changed, 54 insertions(+), 28 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 f1f7957..ea3ca27 100644 --- a/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt +++ b/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt @@ -8,6 +8,8 @@ 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.* /** @@ -38,55 +40,79 @@ @PostMapping("/report/missionSummary") fun generateMissionSummary( @ApiParam("寮�濮嬫椂闂�") @RequestParam - @JsonFormat(pattern = "YYYY-MM-DD HH:mm:ss") - @DateTimeFormat(pattern = "YYYY-MM-DD HH:mm:ss") - startTime: Date, + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + startTime: LocalDateTime, @ApiParam("缁撴潫鏃堕棿") @RequestParam - @JsonFormat(pattern = "YYYY-MM-DD HH:mm:ss") - @DateTimeFormat(pattern = "YYYY-MM-DD HH:mm:ss") - endTime: Date, + @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, - ) = resPack { dataAnalysisService.generateMissionSummary(startTime, endTime, areaVo) } + ) = resPack { + dataAnalysisService.generateMissionSummary( + Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), + Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), + areaVo + ) + } @ApiOperation(value = "鐢熸垚璧拌埅浠诲姟娓呭崟") @PostMapping("/report/missionList") fun generateMissionList( @ApiParam("寮�濮嬫椂闂�") @RequestParam - @JsonFormat(pattern = "YYYY-MM-DD HH:mm:ss") - @DateTimeFormat(pattern = "YYYY-MM-DD HH:mm:ss") - startTime: Date, + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + startTime: LocalDateTime, @ApiParam("缁撴潫鏃堕棿") @RequestParam - @JsonFormat(pattern = "YYYY-MM-DD HH:mm:ss") - @DateTimeFormat(pattern = "YYYY-MM-DD HH:mm:ss") - endTime: Date, + @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, - ) = resPack { dataAnalysisService.generateMissionList(startTime, endTime, areaVo) } + ) = resPack { + dataAnalysisService.generateMissionList( + Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), + Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), + areaVo + ) + } @ApiOperation(value = "鐢熸垚璧拌埅浠诲姟璇︽儏") @PostMapping("/report/missionDetail") fun generateMissionDetail( @ApiParam("寮�濮嬫椂闂�") @RequestParam - @JsonFormat(pattern = "YYYY-MM-DD HH:mm:ss") - @DateTimeFormat(pattern = "YYYY-MM-DD HH:mm:ss") - startTime: Date, + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + startTime: LocalDateTime, @ApiParam("缁撴潫鏃堕棿") @RequestParam - @JsonFormat(pattern = "YYYY-MM-DD HH:mm:ss") - @DateTimeFormat(pattern = "YYYY-MM-DD HH:mm:ss") - endTime: Date, + @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, - ) = resPack { dataAnalysisService.generateMissionDetail(startTime, endTime, areaVo) } + ) = resPack { + dataAnalysisService.generateMissionDetail( + Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), + Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), + areaVo + ) + } @ApiOperation(value = "璧拌埅鍏稿瀷闅愭偅鍖哄煙缁熻") @PostMapping("/report/clueByRiskArea") fun generateClueByRiskArea( @ApiParam("寮�濮嬫椂闂�") @RequestParam - @JsonFormat(pattern = "YYYY-MM-DD HH:mm:ss") - @DateTimeFormat(pattern = "YYYY-MM-DD HH:mm:ss") - startTime: Date, + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + startTime: LocalDateTime, @ApiParam("缁撴潫鏃堕棿") @RequestParam - @JsonFormat(pattern = "YYYY-MM-DD HH:mm:ss") - @DateTimeFormat(pattern = "YYYY-MM-DD HH:mm:ss") - endTime: Date, + @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, - ) = resPack { dataAnalysisService.generateClueByRiskArea(startTime, endTime, areaVo) } + ) = resPack { + dataAnalysisService.generateClueByRiskArea( + Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), + Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), + areaVo + ) + } } \ No newline at end of file -- Gitblit v1.9.3