From 9a9a27f185bc0cf9dc0001cfc6839e6d13dbccd9 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 08 五月 2025 17:38:30 +0800
Subject: [PATCH] 1. 添加了动态污染溯源相关功能逻辑

---
 src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt |   52 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 41 insertions(+), 11 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 5e5c4ff..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,5 +1,6 @@
 package com.flightfeather.uav.lightshare.web
 
+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
@@ -24,7 +25,7 @@
 @RequestMapping("air/satellite")
 class SatelliteTelemetryController(
     private val satelliteTelemetryService: SatelliteTelemetryService,
-    private val satelliteDataCalculateService: SatelliteDataCalculateService
+    private val satelliteDataCalculateService: SatelliteDataCalculateService,
 ) {
 
     @ApiOperation(value = "鑾峰彇缃戞牸缁勪俊鎭�")
@@ -33,7 +34,7 @@
         @RequestBody areaVo: AreaVo,
         @RequestParam(required = false) type: String?,
         @RequestParam("page", required = false) page: Int?,
-        @RequestParam("per_page", required = false) perPage: Int?
+        @RequestParam("per_page", required = false) perPage: Int?,
     ) = resPack { satelliteTelemetryService.fetchGridGroup(areaVo, type, page, perPage) }
 
     @ApiOperation(value = "鑾峰彇缃戞牸缁勫唴鍏蜂綋缃戞牸淇℃伅")
@@ -48,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")
@@ -65,7 +79,7 @@
         @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
         @ApiParam("閬ユ祴鏁版嵁鏃堕棿")
         @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dateTime: LocalDateTime,
-        @RequestBody gridDataDetail: List<GridDataDetail>
+        @RequestBody gridDataDetail: List<GridDataDetail>,
     ) = resPack {
         satelliteTelemetryService.createGridDataAndDataDetail(groupId, dateTime, gridDataDetail)
     }
@@ -74,7 +88,7 @@
     @ApiOperation(value = "澶氭璧拌埅鏁版嵁杩涜铻嶅悎璁$畻")
     @PostMapping("/grid/data/mix")
     fun mixGridData(
-        @ApiParam("鍘熷鏁版嵁id鏁扮粍") @RequestBody dataIdList: List<Int>
+        @ApiParam("鍘熷鏁版嵁id鏁扮粍") @RequestBody dataIdList: List<Int>,
     ) = resPack { satelliteTelemetryService.mixGridData(dataIdList) }
 
 
@@ -92,7 +106,8 @@
 
     @ApiOperation(value = "涓嬭浇鍗槦閬ユ祴PM2.5缁撴灉鏁版嵁瀵煎叆妯℃澘")
     @GetMapping("/import/grid/data/download/template")
-    fun downloadTemplate(@ApiIgnore response: HttpServletResponse) = satelliteTelemetryService.downloadTemplate(response)
+    fun downloadTemplate(@ApiIgnore response: HttpServletResponse) =
+        satelliteTelemetryService.downloadTemplate(response)
 
     @ApiOperation(value = "瀵煎叆鍗槦閬ユ祴Aod缁撴灉鏁版嵁")
     @PostMapping("/import/grid/aod")
@@ -108,7 +123,8 @@
 
     @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鏁版嵁鐩稿叧**************************************************************/
@@ -139,11 +155,25 @@
 
     /**閬ユ祴浜у搧鍒朵綔鐩稿叧**************************************************************/
     @ApiOperation(value = "鐢熸垚璧拌埅铻嶅悎浜у搧")
-    @GetMapping("/product/underway/build")
+    @PostMapping("/product/underway/build")
     fun buildUnderwayProduct(
-        @ApiParam("璧拌埅浠诲姟缂栧彿") @RequestParam missionCode: String,
+//        @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,
-    ) = resPack { satelliteDataCalculateService.dataFusion(missionCode, groupId) }
+        @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