From 360af284c3656f9f3df16f0dcda36a0d25453b18 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Tue, 20 Aug 2024 18:06:35 +0800
Subject: [PATCH] 机场设备和无人机设备推送,图片、文件上传类型区分举证、航点和航测

---
 src/main/java/com/dji/sample/patches/controller/PatchesController.java |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/main/java/com/dji/sample/patches/controller/PatchesController.java b/src/main/java/com/dji/sample/patches/controller/PatchesController.java
index 4f410ba..15deb45 100644
--- a/src/main/java/com/dji/sample/patches/controller/PatchesController.java
+++ b/src/main/java/com/dji/sample/patches/controller/PatchesController.java
@@ -74,6 +74,7 @@
                                                         @RequestParam(name = "dkmj", required = false) Double dkmj,
                                                         @RequestParam(name = "isPush",required = false) Integer isPush
                                                         ) {
+        fileService.getNoaddFile();
         //调用service分页查询
         PatchesParam param = PatchesParam.builder()
                 .page(page)
@@ -153,7 +154,7 @@
         CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM);
         String creator = customClaim.getUsername();
         MultipartFile file = timerUtil.getFile(waylineName, lotInfos, lat, lon);
-        waylineFileService.importKmzFile(file, workspaceId, creator, patchesId, isTemp);
+        waylineFileService.importKmzFile(file, workspaceId, creator, patchesId, isTemp,1);
         WaylineFileEntity entity = waylineFileService.selectByName(waylineName);
         Map<String, String> infoMap = new HashMap<>();
         URL url = null;
@@ -177,7 +178,7 @@
 //            timerUtil.mytask5();
 //            timerUtil.mytask6();
 //            timerUtil.mytask7();
-
+            timerUtil.GtdbOperation();
         } catch (Exception e) {
             throw new RuntimeException("db存储发送出现异常" + e);
         }
@@ -198,14 +199,14 @@
         executor.shutdown();
         return ResponseResult.success();
     }
-
-    @PostMapping("/way")
-    public void getway(@RequestParam("file") MultipartFile file,
-                       @RequestParam String workspaceId,
-                       @RequestParam String waylineName,
-                       @RequestParam String username) {
-        waylineFileService.importKmzFileBack(file, workspaceId, username);
-    }
+//
+//    @PostMapping("/way")
+//    public void getway(@RequestParam("file") MultipartFile file,
+//                       @RequestParam String workspaceId,
+//                       @RequestParam String waylineName,
+//                       @RequestParam String username) {
+//        waylineFileService.importKmzFileBack(file, workspaceId, username);
+//    }
 
     /**
      * 根据图斑的地块编号获取相对应音视频
@@ -257,7 +258,7 @@
         CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM);
         String creator = customClaim.getUsername();
         MultipartFile multipartFile = shpToDataSourceService.insertGeo(file, workspaceId, waylineName, airportLat, airportLon, creator);
-        waylineFileService.importKmzFileBack(multipartFile, workspaceId, creator);
+        waylineFileService.importKmzFileBack(multipartFile, workspaceId, creator,1);
         WaylineFileEntity entity = waylineFileService.selectByName(waylineName);
         Map<String, String> infoMap = new HashMap<>();
         URL url = null;
@@ -272,9 +273,10 @@
     }
 
     @GetMapping("/getExcel")
-    public ResponseEntity<byte[]> exportExcel(@RequestParam String workspaceId) {
-        List<LotInfo> lotInfos = getPatchesService.listLotinfo(workspaceId);
+    public ResponseEntity<byte[]> exportExcel(@RequestParam String ids) {
+//        List<LotInfo> lotInfos = getPatchesService.listLotinfo(workspaceId);
         try {
+            List<LotInfo> lotInfos = getPatchesService.getLotInfosByIDs(ids);
             ByteArrayInputStream excelStream = ExcelUtil.exportLotInfoToExcel(lotInfos);
             byte[] excelData = excelStream.readAllBytes();
             excelStream.close();
@@ -287,7 +289,7 @@
             return new ResponseEntity<>(excelData, headers, HttpStatus.OK);
         } catch (IOException e) {
             e.printStackTrace();
-            return new ResponseEntity<>(("Failed to generate Excel file.").getBytes(), HttpStatus.INTERNAL_SERVER_ERROR);
+            return new ResponseEntity<>(("生成excel失败.").getBytes(), HttpStatus.INTERNAL_SERVER_ERROR);
         }
     }
 }

--
Gitblit v1.9.3