From eb3dd00b0b7fcda477229d518d250f9c842b790b Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 21 十月 2025 17:45:44 +0800
Subject: [PATCH] 2025.10.21 1. 走航季度报告相关数据计算逻辑调整
---
src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt | 109 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 93 insertions(+), 16 deletions(-)
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt
index d0c2811..70ec683 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt
@@ -1,7 +1,9 @@
package com.flightfeather.uav.lightshare.web
-import com.fasterxml.jackson.annotation.JsonFormat
+import com.flightfeather.uav.domain.entity.GridData
+import com.flightfeather.uav.domain.entity.GridDataDetail
import com.flightfeather.uav.lightshare.bean.AreaVo
+import com.flightfeather.uav.lightshare.service.SatelliteDataCalculateService
import com.flightfeather.uav.lightshare.service.SatelliteTelemetryService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
@@ -21,15 +23,19 @@
@Api(tags = ["鍗槦閬ユ祴API鎺ュ彛"])
@RestController
@RequestMapping("air/satellite")
-class SatelliteTelemetryController(private val satelliteTelemetryService: SatelliteTelemetryService) {
+class SatelliteTelemetryController(
+ private val satelliteTelemetryService: SatelliteTelemetryService,
+ private val satelliteDataCalculateService: SatelliteDataCalculateService,
+) {
@ApiOperation(value = "鑾峰彇缃戞牸缁勪俊鎭�")
@PostMapping("/grid/group")
fun fetchGridGroup(
@RequestBody areaVo: AreaVo,
+ @RequestParam(required = false) type: String?,
@RequestParam("page", required = false) page: Int?,
- @RequestParam("per_page", required = false) perPage: Int?
- ) = resPack { satelliteTelemetryService.fetchGridGroup(areaVo, page, perPage) }
+ @RequestParam("per_page", required = false) perPage: Int?,
+ ) = resPack { satelliteTelemetryService.fetchGridGroup(areaVo, type, page, perPage) }
@ApiOperation(value = "鑾峰彇缃戞牸缁勫唴鍏蜂綋缃戞牸淇℃伅")
@GetMapping("/grid/cell")
@@ -43,8 +49,21 @@
@ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
@ApiParam("閬ユ祴鏁版嵁鏃堕棿")
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?,
- @ApiParam("閬ユ祴鏁版嵁绫诲瀷", allowableValues = "0锛氬師濮嬪崼鏄熼仴娴嬫暟鎹紱1锛氳瀺鍚堟暟鎹�") @RequestParam(required = false) type: Int?,
+ @ApiParam("閬ユ祴鏁版嵁绫诲瀷", allowableValues = "0锛氬師濮嬪崼鏄熼仴娴嬫暟鎹紱1锛氳瀺鍚堟暟鎹�")
+ @RequestParam(required = false) type: Int?,
) = resPack { satelliteTelemetryService.fetchGridData(groupId, dataTime, type) }
+
+ @ApiOperation(value = "鑾峰彇缃戞牸缁勪笅鐨勫崼鏄熼仴娴嬫暟鎹�")
+ @PostMapping("/grid/data2")
+ fun fetchGridData2(
+ @ApiParam("缃戞牸鏁版嵁") @RequestBody gridData: GridData,
+ ) = resPack { satelliteTelemetryService.fetchGridData(gridData) }
+
+ @ApiOperation(value = "鍒犻櫎缃戞牸鏁版嵁")
+ @DeleteMapping("/grid/data/delete")
+ fun deleteGridData(
+ @ApiParam("鏁版嵁id") @RequestParam dataId: Int,
+ ) = resPack { satelliteTelemetryService.deleteGridData(dataId) }
@ApiOperation(value = "鑾峰彇缃戞牸缁勪笅鐨勫崼鏄熼仴娴嬪叿浣撴暟鎹�")
@GetMapping("/grid/data/detail")
@@ -54,11 +73,24 @@
@ApiParam("缃戞牸鍗曞厓鏍糹d") @RequestParam(required = false) cellId: Int?,
) = resPack { satelliteTelemetryService.fetchGridDataDetail(dataId, groupId, cellId) }
+ @ApiOperation(value = "淇濆瓨鎷熷悎鐢熸垚鐨勫崼鏄熼仴娴婸M2.5缁撴灉鏁版嵁")
+ @PostMapping("/grid/data/create")
+ fun createGridDataAndDataDetail(
+ @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
+ @ApiParam("閬ユ祴鏁版嵁鏃堕棿")
+ @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dateTime: LocalDateTime,
+ @RequestBody gridDataDetail: List<GridDataDetail>,
+ ) = resPack {
+ satelliteTelemetryService.createGridDataAndDataDetail(groupId, dateTime, gridDataDetail)
+ }
+
+
@ApiOperation(value = "澶氭璧拌埅鏁版嵁杩涜铻嶅悎璁$畻")
@PostMapping("/grid/data/mix")
fun mixGridData(
- @ApiParam("鍘熷鏁版嵁id鏁扮粍") @RequestBody dataIdList: List<Int>
+ @ApiParam("鍘熷鏁版嵁id鏁扮粍") @RequestBody dataIdList: List<Int>,
) = resPack { satelliteTelemetryService.mixGridData(dataIdList) }
+
@ApiOperation(value = "瀵煎叆鍗槦閬ユ祴PM2.5缁撴灉鏁版嵁")
@PostMapping("/import/grid/data")
@@ -74,15 +106,8 @@
@ApiOperation(value = "涓嬭浇鍗槦閬ユ祴PM2.5缁撴灉鏁版嵁瀵煎叆妯℃澘")
@GetMapping("/import/grid/data/download/template")
- fun downloadTemplate(@ApiIgnore response: HttpServletResponse) = satelliteTelemetryService.downloadTemplate(response)
-
- @ApiOperation(value = "鑾峰彇缃戞牸缁勪笅鐨勫崼鏄熼仴娴媋od鏁版嵁")
- @GetMapping("/grid/aod")
- fun fetchGridAod(
- @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
- @ApiParam("閬ユ祴鏁版嵁鏃堕棿")
- @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?,
- ) = resPack { satelliteTelemetryService.fetchGridAod(groupId, dataTime) }
+ fun downloadTemplate(@ApiIgnore response: HttpServletResponse) =
+ satelliteTelemetryService.downloadTemplate(response)
@ApiOperation(value = "瀵煎叆鍗槦閬ユ祴Aod缁撴灉鏁版嵁")
@PostMapping("/import/grid/aod")
@@ -98,5 +123,57 @@
@ApiOperation(value = "涓嬭浇鍗槦閬ユ祴Aod缁撴灉鏁版嵁瀵煎叆妯℃澘")
@GetMapping("/import/grid/aod/download/template")
- fun downloadAODTemplate(@ApiIgnore response: HttpServletResponse) = satelliteTelemetryService.downloadAODTemplate(response)
+ fun downloadAODTemplate(@ApiIgnore response: HttpServletResponse) =
+ satelliteTelemetryService.downloadAODTemplate(response)
+
+
+ /**AOD鏁版嵁鐩稿叧**************************************************************/
+ @ApiOperation(value = "鑾峰彇缃戞牸缁勪笅鐨勫崼鏄熼仴娴媋od鏁版嵁")
+ @GetMapping("/grid/aod")
+ fun fetchGridAod(
+ @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
+ @ApiParam("閬ユ祴鏁版嵁鏃堕棿")
+ @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?,
+ ) = resPack { satelliteTelemetryService.fetchGridAod(groupId, dataTime) }
+
+// @ApiOperation(value = "鑾峰彇缃戞牸缁勪笅鐨勫崼鏄熼仴娴婣OD鏁版嵁")
+// @GetMapping("/aod/data")
+// fun fetchGridAOD(
+// @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
+// @ApiParam("AOD鏁版嵁鏃堕棿")
+// @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?,
+// ) = resPack { satelliteTelemetryService.fetchGridAOD(groupId, dataTime) }
+
+ @ApiOperation(value = "鑾峰彇缃戞牸缁勪笅鐨勫崼鏄熼仴娴婣OD鍏蜂綋鏁版嵁")
+ @GetMapping("/aod/data/detail")
+ fun fetchGridAODDetail(
+ @ApiParam("AOD鏁版嵁id") @RequestParam aodId: Int,
+ @ApiParam("缃戞牸缁刬d") @RequestParam(required = false) groupId: Int?,
+ @ApiParam("缃戞牸鍗曞厓鏍糹d") @RequestParam(required = false) cellId: Int?,
+ ) = resPack { satelliteTelemetryService.fetchGridAODDetail(aodId, groupId, cellId) }
+
+
+ /**閬ユ祴浜у搧鍒朵綔鐩稿叧**************************************************************/
+ @ApiOperation(value = "鐢熸垚璧拌埅铻嶅悎浜у搧")
+ @PostMapping("/product/underway/build")
+ fun buildUnderwayProduct(
+// @ApiParam("璧拌埅浠诲姟缂栧彿") @RequestParam missionCode: String,
+// @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
+ @ApiParam("缃戞牸鏁版嵁") @RequestBody gridData: GridData,
+ ) = resPack { satelliteDataCalculateService.dataFusion(gridData) }
+
+ @ApiOperation(value = "杩涜璧拌埅铻嶅悎浜у搧鐨勮瀺鍚堝垎鏋�")
+ @PostMapping("/product/underway/mix")
+ fun mixGridData(
+ @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
+ @ApiParam("闇�瑕佽瀺鍚堢殑鏁版嵁id") @RequestBody dataIdList: List<Int>,
+ ) = resPack { satelliteDataCalculateService.mixUnderwayGridData(groupId, dataIdList) }
+
+ @ApiOperation(value = "鐢熸垚璧拌埅鐑姏鍥�")
+ @PostMapping("/product/underway/heatmap/build")
+ fun buildUnderwayHeatmap(
+ @ApiParam("浣跨敤鐨勭綉鏍肩粍id") @RequestParam groupId: Int,
+ @ApiParam("鎼滅储缃戞牸璺濈") @RequestParam searchLength: Int,
+ @ApiParam("浣跨敤鐨勮蛋鑸綉鏍兼暟鎹�") @RequestBody gridDataDetailList: List<GridDataDetail>,
+ ) = resPack { satelliteDataCalculateService.buildHeatmap(groupId, gridDataDetailList, searchLength) }
}
\ No newline at end of file
--
Gitblit v1.9.3