From 9d4ca2e7bdfc0d634b0cc27c7fbe23740f4bb398 Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期五, 27 十二月 2024 15:43:30 +0800 Subject: [PATCH] 1. 新增aod数据索引,aod详细数据实体类,mapper,service 2. 新增卫星遥测数据网格数据pm2.5、aod数据导入,模板下载 3. FileExchange.kt 新增转换pm2.5和aod数据方法 --- src/main/kotlin/com/flightfeather/uav/lightshare/web/SatelliteTelemetryController.kt | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 46 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..f5b6175 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,45 @@ @ApiParam("缃戞牸缁刬d") @RequestParam(required = false) groupId: Int?, @ApiParam("缃戞牸鍗曞厓鏍糹d") @RequestParam(required = false) cellId: Int?, ) = resPack { satelliteTelemetryService.fetchGridDataDetail(dataId, groupId, cellId) } + + + @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