From 64d3e9657fb45b6415b19e23f483d46a82efe939 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 06 三月 2023 13:56:42 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/controller/sys/ResController.java |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/sys/ResController.java b/src/main/java/com/lf/server/controller/sys/ResController.java
index 1c476e1..47b4970 100644
--- a/src/main/java/com/lf/server/controller/sys/ResController.java
+++ b/src/main/java/com/lf/server/controller/sys/ResController.java
@@ -5,8 +5,10 @@
 import com.lf.server.entity.all.ResponseMsg;
 import com.lf.server.entity.sys.ResEntity;
 import com.lf.server.entity.sys.UserEntity;
+import com.lf.server.helper.StringHelper;
 import com.lf.server.service.all.PermsService;
 import com.lf.server.service.all.UploadAttachService;
+import com.lf.server.service.data.DownloadService;
 import com.lf.server.service.sys.ResService;
 import com.lf.server.service.sys.TokenService;
 import io.swagger.annotations.Api;
@@ -37,10 +39,13 @@
     TokenService tokenService;
 
     @Autowired
-    UploadAttachService uploadAttachService;
+    PermsService permsService;
 
     @Autowired
-    PermsService permsService;
+    DownloadService downloadService;
+
+    @Autowired
+    UploadAttachService uploadAttachService;
 
     private final static String TAB_NAME = "lf.sys_res";
 
@@ -301,7 +306,7 @@
     }
 
     @SysLog()
-    @ApiOperation(value = "鏌ョ湅涓嬭浇鏂囦欢")
+    @ApiOperation(value = "鏌ョ湅鏂囦欢")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "guid", value = "闄勪欢Guid", dataType = "String", paramType = "body")
     })
@@ -309,4 +314,52 @@
     public void downloadForView(String guid, HttpServletResponse res) {
         uploadAttachService.download(guid, true, res);
     }
+
+    @SysLog()
+    @ApiOperation(value = "璇锋眰涓嬭浇")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "guids", value = "闄勪欢Guid鏁扮粍", dataType = "String", paramType = "body", allowMultiple = true, example = "e5b6ae0889b88111f13a4b6e048348db,fa4f299e901a0c46e634f8fcc8185c0c")
+    })
+    @ResponseBody
+    @PostMapping(value = "/downloadReq")
+    public ResponseMsg<Object> downloadReqForGuids(String[] guids, HttpServletRequest req, HttpServletResponse res) {
+        try {
+            if (null == guids || guids.length == 0) {
+                return fail("Guid鏁扮粍涓虹┖");
+            }
+
+            UserEntity ue = tokenService.getCurrentUser(req);
+            String guid = uploadAttachService.downloadReqForGuids(ue, guids);
+
+            return success("");
+        } catch (Exception ex) {
+            return fail(ex, null);
+        }
+    }
+
+    @SysLog()
+    @ApiOperation(value = "璇锋眰涓嬭浇")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "tab", value = "琛ㄥ悕", dataType = "String", paramType = "body", example = "bd.b_borehole"),
+            @ApiImplicitParam(name = "guids", value = "闄勪欢Guid鏁扮粍", dataType = "String", paramType = "body", allowMultiple = true, example = "08e5b4ad-93b8-46f6-adaa-46a6274af4ce,6f94f4f8-6e8d-44e7-8803-3d068d34983f")
+    })
+    @ResponseBody
+    @PostMapping(value = "/downloadReq")
+    public ResponseMsg<Object> downloadReqForTabGuids(String tab, String[] guids, HttpServletRequest req, HttpServletResponse res) {
+        try {
+            if (StringHelper.isEmpty(tab)) {
+                return fail("琛ㄥ悕涓虹┖");
+            }
+            if (null != guids && guids.length == 0) {
+                guids = null;
+            }
+
+            UserEntity ue = tokenService.getCurrentUser(req);
+            String guid = uploadAttachService.downloadReqForTabGuids(ue, tab, guids);
+
+            return success(guid);
+        } catch (Exception ex) {
+            return fail(ex, null);
+        }
+    }
 }

--
Gitblit v1.9.3