From 0ddfab15b32dc054464d75c695999fa76c3b9b78 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 03 一月 2025 17:33:50 +0800
Subject: [PATCH] 1. 卫星遥测数据的融合

---
 src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 51 insertions(+), 1 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 2ac67d6..d0c2811 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt
@@ -6,8 +6,12 @@
 import io.swagger.annotations.Api
 import io.swagger.annotations.ApiOperation
 import io.swagger.annotations.ApiParam
+import org.springframework.format.annotation.DateTimeFormat
 import org.springframework.web.bind.annotation.*
+import org.springframework.web.multipart.MultipartFile
+import springfox.documentation.annotations.ApiIgnore
 import java.time.LocalDateTime
+import javax.servlet.http.HttpServletResponse
 
 /**
  * 鍗槦閬ユ祴
@@ -38,7 +42,7 @@
     fun fetchGridData(
         @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
         @ApiParam("閬ユ祴鏁版嵁鏃堕棿")
-        @RequestParam(required = false) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?,
+        @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?,
         @ApiParam("閬ユ祴鏁版嵁绫诲瀷", allowableValues = "0锛氬師濮嬪崼鏄熼仴娴嬫暟鎹紱1锛氳瀺鍚堟暟鎹�") @RequestParam(required = false) type: Int?,
     ) = resPack { satelliteTelemetryService.fetchGridData(groupId, dataTime, type) }
 
@@ -49,4 +53,50 @@
         @ApiParam("缃戞牸缁刬d") @RequestParam(required = false) groupId: Int?,
         @ApiParam("缃戞牸鍗曞厓鏍糹d") @RequestParam(required = false) cellId: Int?,
     ) = resPack { satelliteTelemetryService.fetchGridDataDetail(dataId, groupId, cellId) }
+
+    @ApiOperation(value = "澶氭璧拌埅鏁版嵁杩涜铻嶅悎璁$畻")
+    @PostMapping("/grid/data/mix")
+    fun mixGridData(
+        @ApiParam("鍘熷鏁版嵁id鏁扮粍") @RequestBody dataIdList: List<Int>
+    ) = resPack { satelliteTelemetryService.mixGridData(dataIdList) }
+
+    @ApiOperation(value = "瀵煎叆鍗槦閬ユ祴PM2.5缁撴灉鏁版嵁")
+    @PostMapping("/import/grid/data")
+    fun importGridData(
+        @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
+        @ApiParam("閬ユ祴鏁版嵁鏃堕棿")
+        @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dateTime: LocalDateTime,
+        @ApiParam("瑕嗙洊鏃ф暟鎹� 0: 涓嶈鐩� 1: 瑕嗙洊") @RequestParam update: Boolean,
+        @RequestParam("excel") file: MultipartFile,
+    ) = resPack {
+        satelliteTelemetryService.importGridData(groupId, dateTime, update, file)
+    }
+
+    @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) }
+
+    @ApiOperation(value = "瀵煎叆鍗槦閬ユ祴Aod缁撴灉鏁版嵁")
+    @PostMapping("/import/grid/aod")
+    fun importGridAOD(
+        @ApiParam("缃戞牸缁刬d") @RequestParam groupId: Int,
+        @ApiParam("閬ユ祴鏁版嵁鏃堕棿")
+        @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dateTime: LocalDateTime,
+        @ApiParam("瑕嗙洊鏃ф暟鎹� 0: 涓嶈鐩� 1: 瑕嗙洊") @RequestParam update: Boolean,
+        @RequestParam("excel") file: MultipartFile,
+    ) = resPack {
+        satelliteTelemetryService.importGridAOD(groupId, dateTime, update, file)
+    }
+
+    @ApiOperation(value = "涓嬭浇鍗槦閬ユ祴Aod缁撴灉鏁版嵁瀵煎叆妯℃澘")
+    @GetMapping("/import/grid/aod/download/template")
+    fun downloadAODTemplate(@ApiIgnore response: HttpServletResponse) = satelliteTelemetryService.downloadAODTemplate(response)
 }
\ No newline at end of file

--
Gitblit v1.9.3