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/service/all/UploadAttachService.java |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/lf/server/service/all/UploadAttachService.java b/src/main/java/com/lf/server/service/all/UploadAttachService.java
index 045c7da..ec0a2f4 100644
--- a/src/main/java/com/lf/server/service/all/UploadAttachService.java
+++ b/src/main/java/com/lf/server/service/all/UploadAttachService.java
@@ -1,6 +1,5 @@
 package com.lf.server.service.all;
 
-import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.lf.server.controller.all.BaseController;
 import com.lf.server.entity.all.*;
@@ -43,8 +42,6 @@
     private final static Map<String, String> ATTACH_TABS = new HashMap<>();
 
     private final static Log log = LogFactory.getLog(UploadAttachService.class);
-
-    private static final String NO_FILE = JSON.toJSONString(new ResponseMsg<String>(HttpStatus.NOT_FOUND, "鏂囦欢鎵句笉鍒�"));
 
     /**
      * 鑾峰彇琛ㄥ悕
@@ -148,13 +145,13 @@
     public void download(String guid, boolean inline, HttpServletResponse res) {
         try {
             if (StringHelper.isEmpty(guid)) {
-                WebHelper.writeStr2Page(res, NO_FILE);
+                WebHelper.writeStr2Page(res, StaticData.NO_FILE);
                 return;
             }
 
             AttachEntity entity = attachService.selectByGuid(guid);
             if (entity == null) {
-                WebHelper.writeStr2Page(res, NO_FILE);
+                WebHelper.writeStr2Page(res, StaticData.NO_FILE);
                 return;
             }
 
@@ -407,4 +404,33 @@
 
         return entity;
     }
+
+    /**
+     * 璇锋眰涓嬭浇
+     */
+    public String downloadReqForGuids(UserEntity ue, String[] guids) {
+        List<AttachEntity> list = attachService.selectByGuids(guids);
+
+        return downloadReq(ue, list);
+    }
+
+    /**
+     * 璇锋眰涓嬭浇
+     */
+    public String downloadReqForTabGuids(UserEntity ue, String tab, String[] guids) {
+        List<AttachEntity> list = attachService.selectByTabGuids(tab, guids);
+
+        return downloadReq(ue, list);
+    }
+
+    /**
+     * 璇锋眰涓嬭浇
+     */
+    protected String downloadReq(UserEntity ue, List<AttachEntity> list) {
+        if (null == list || list.isEmpty()) {
+            return null;
+        }
+
+        return "";
+    }
 }

--
Gitblit v1.9.3