From cc04410259d4ba26c04b3c3278481d260ab77056 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期日, 23 四月 2023 12:49:54 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/controller/show/InquiryController.java |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/show/InquiryController.java b/src/main/java/com/lf/server/controller/show/InquiryController.java
index afc3605..44ee4b2 100644
--- a/src/main/java/com/lf/server/controller/show/InquiryController.java
+++ b/src/main/java/com/lf/server/controller/show/InquiryController.java
@@ -2,17 +2,23 @@
 
 import com.lf.server.annotation.SysLog;
 import com.lf.server.controller.all.BaseQueryController;
+import com.lf.server.entity.all.HttpStatus;
 import com.lf.server.entity.all.ResponseMsg;
 import com.lf.server.entity.all.StaticData;
+import com.lf.server.entity.ctrl.DownloadTileEntity;
 import com.lf.server.entity.ctrl.ShpRecordEntity;
+import com.lf.server.entity.data.DownloadEntity;
 import com.lf.server.entity.data.MetaFileEntity;
 import com.lf.server.entity.sys.UserEntity;
 import com.lf.server.helper.AesHelper;
 import com.lf.server.helper.StringHelper;
+import com.lf.server.helper.WebHelper;
 import com.lf.server.service.all.BaseUploadService;
 import com.lf.server.service.show.InquiryService;
 import com.lf.server.service.sys.TokenService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -64,4 +70,46 @@
             return fail(ex, null);
         }
     }
+
+    @SysLog()
+    @ApiOperation(value = "涓嬭浇鐡︾墖")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "dt", value = "涓嬭浇鐡︾墖瀹炰綋绫�", dataType = "DownloadTileEntity", paramType = "body")
+    })
+    @ResponseBody
+    @PostMapping(value = "/downloadTiles")
+    public ResponseMsg<Object> downloadTiles(@RequestBody DownloadTileEntity dt, HttpServletRequest req, HttpServletResponse res) {
+        try {
+
+
+            return success("");
+        } catch (Exception ex) {
+            return fail(ex, null);
+        }
+    }
+
+    @SysLog()
+    @ApiOperation(value = "涓嬭浇鏂囦欢")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "guid", value = "鏂囦欢GUID", dataType = "String", paramType = "query")
+    })
+    @ResponseBody
+    @GetMapping(value = "/downloadFile")
+    public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) {
+        try {
+            DownloadEntity de = downloadService.selectByGuid(guid);
+            if (null == de) {
+                WebHelper.writeInfo(HttpStatus.NOT_FOUND, "鏂囦欢涓嶅瓨鍦�", res);
+                return;
+            }
+
+            UserEntity ue = tokenService.getCurrentUser(req);
+            downlogService.updateInfos(ue, de, req);
+
+            String filePath = downloadService.getDownloadFilePath(de);
+            WebHelper.download(filePath, de.getName(), res);
+        } catch (Exception ex) {
+            WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res);
+        }
+    }
 }

--
Gitblit v1.9.3