From ed8c7a5effd0d423ce1118b680ecdca6fe732609 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 02 七月 2025 16:43:13 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.11.205:9000/r/P2022036_Service

---
 src/main/java/com/lf/server/controller/sys/ResController.java |   70 ++--------------------------------
 1 files changed, 5 insertions(+), 65 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 c9c0ae9..fe7ae85 100644
--- a/src/main/java/com/lf/server/controller/sys/ResController.java
+++ b/src/main/java/com/lf/server/controller/sys/ResController.java
@@ -3,10 +3,8 @@
 import com.lf.server.annotation.SysLog;
 import com.lf.server.controller.all.BaseController;
 import com.lf.server.entity.all.ResponseMsg;
-import com.lf.server.entity.ctrl.DownloadReqEntity;
 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;
@@ -153,10 +151,8 @@
                 entity.setCreateUser(ue.getId());
             }
 
+            permsService.clearPermsCache();
             int count = resService.insertRes(entity);
-            if (count > 0) {
-                permsService.clearResCache();
-            }
 
             return success(count);
         } catch (Exception ex) {
@@ -179,10 +175,8 @@
                 }
             }
 
+            permsService.clearPermsCache();
             int count = resService.insertRess(list);
-            if (count > 0) {
-                permsService.clearResCache();
-            }
 
             return success(count);
         } catch (Exception ex) {
@@ -198,10 +192,8 @@
     @GetMapping(value = "/deleteRes")
     public ResponseMsg<Integer> deleteRes(int id) {
         try {
+            permsService.clearPermsCache();
             int count = resService.deleteRes(id);
-            if (count > 0) {
-                permsService.clearResCache();
-            }
 
             return success(count);
         } catch (Exception ex) {
@@ -221,10 +213,8 @@
                 return fail("id鏁扮粍涓嶈兘涓虹┖", -1);
             }
 
+            permsService.clearPermsCache();
             int count = resService.deleteRess(ids);
-            if (count > 0) {
-                permsService.clearResCache();
-            }
 
             return success(count);
         } catch (Exception ex) {
@@ -246,10 +236,8 @@
                 entity.setUpdateUser(ue.getId());
             }
 
+            permsService.clearPermsCache();
             int count = resService.updateRes(entity);
-            if (count > 0) {
-                permsService.clearResCache();
-            }
 
             return success(count);
         } catch (Exception ex) {
@@ -314,53 +302,5 @@
     @GetMapping(value = "/downloadForView")
     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 = "/downloadReqForGuids")
-    public ResponseMsg<Object> downloadReqForGuids(@RequestBody DownloadReqEntity dre, HttpServletRequest req, HttpServletResponse res) {
-        try {
-            if (null == dre || null == dre.getGuids() || dre.getGuids().isEmpty()) {
-                return fail("Guid鏁扮粍涓虹┖");
-            }
-
-            UserEntity ue = tokenService.getCurrentUser(req);
-            String guid = uploadAttachService.downloadReqForGuids(ue, dre.getGuids());
-
-            return success(guid);
-        } 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 = "/downloadReqForTabGuids")
-    public ResponseMsg<Object> downloadReqForTabGuids(@RequestBody DownloadReqEntity dre, HttpServletRequest req, HttpServletResponse res) {
-        try {
-            if (null == dre || StringHelper.isEmpty(dre.getTab())) {
-                return fail("琛ㄥ悕涓虹┖");
-            }
-            if (null != dre.getGuids() && dre.getGuids().size() == 0) {
-                dre.setIds(null);
-            }
-
-            UserEntity ue = tokenService.getCurrentUser(req);
-            String guid = uploadAttachService.downloadReqForTabGuids(ue, dre.getTab(), dre.getGuids());
-
-            return success(guid);
-        } catch (Exception ex) {
-            return fail(ex, null);
-        }
     }
 }

--
Gitblit v1.9.3