From 05ffa1a7f490e1e81d6fbf1ee948db50b1fff6fc Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 14 二月 2023 16:02:52 +0800
Subject: [PATCH] 修改depcode、dircode值

---
 src/main/java/com/lf/server/controller/sys/ReportController.java |   39 ++++++++++++++++++++++++++-------------
 1 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/sys/ReportController.java b/src/main/java/com/lf/server/controller/sys/ReportController.java
index 37918ec..1ac223a 100644
--- a/src/main/java/com/lf/server/controller/sys/ReportController.java
+++ b/src/main/java/com/lf/server/controller/sys/ReportController.java
@@ -5,6 +5,7 @@
 import com.lf.server.entity.all.ResponseMsg;
 import com.lf.server.entity.sys.ReportEntity;
 import com.lf.server.entity.sys.UserEntity;
+import com.lf.server.helper.StringHelper;
 import com.lf.server.service.all.UploadAttachService;
 import com.lf.server.service.sys.ReportService;
 import com.lf.server.service.sys.TokenService;
@@ -61,19 +62,6 @@
             List<ReportEntity> rs = reportService.selectByPage(name, pageSize, pageSize * (pageIndex - 1));
 
             return success(count, rs);
-        } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
-        }
-    }
-
-    @SysLog()
-    @ApiOperation(value = "鏌ヨ鎵�鏈�")
-    @GetMapping(value = "/selectAll")
-    public ResponseMsg<List<ReportEntity>> selectAll() {
-        try {
-            List<ReportEntity> list = reportService.selectAll();
-
-            return success(list);
         } catch (Exception ex) {
             return fail(ex.getMessage(), null);
         }
@@ -193,4 +181,29 @@
     public void download(String guid, HttpServletResponse res) {
         uploadAttachService.download(guid, res);
     }
+
+    @SysLog()
+    @ApiOperation(value = "涓嬭浇鎶ュ憡")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "鎶ュ憡ID", dataType = "Integer", paramType = "7")
+    })
+    @GetMapping(value = "/downloadReport")
+    public void downloadReport(Integer id, HttpServletRequest req, HttpServletResponse res) {
+        try {
+            if (null == id || id < 1) {
+                return;
+            }
+
+            ReportEntity re = reportService.selectById(id);
+            if (null == re || StringHelper.isEmpty(re.getGuid()) || StringHelper.isEmpty(re.getType()) || StringHelper.isEmpty(re.getCode())) {
+                return;
+            }
+
+            UserEntity ue = tokenService.getCurrentUser(req);
+
+            reportService.createReport(ue, re, res);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+        }
+    }
 }

--
Gitblit v1.9.3