From e5cb65e56ca20f10aa581edfd26e13a114b590f4 Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期三, 17 五月 2023 15:16:44 +0800 Subject: [PATCH] 合并了一个方法 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventController.java | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventController.java index 6e78170..30227a5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventController.java @@ -18,6 +18,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -64,9 +65,13 @@ */ // @PreAuthorize("@ss.hasPermi('system:property:export')") @Log(title = "瀹跺涵澶т簨浠惰褰�", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, ZfEvent zfEvent) { - List<ZfEvent> list = zfEventService.selectByCondition(zfEvent); + @PostMapping("/export/{ids}") + public void export(HttpServletResponse response, ZfEvent zfEvent,@PathVariable Long[] ids) { + List<ZfEvent> list = new ArrayList<>(); + if(ids.length!=0) + list = zfEventService.selectByIds(ids); + else + list = zfEventService.selectByCondition(zfEvent); log.info("瀵煎嚭璁板綍涓�:{}", list); ExcelUtil<ZfEvent> util = new ExcelUtil<>(ZfEvent.class); util.exportExcel(response, list, "瀹跺涵澶т簨浠惰褰曟暟鎹�"); @@ -77,7 +82,7 @@ */ // @PreAuthorize("@ss.hasPermi('system:property:export')") @Log(title = "瀹跺涵澶т簨浠惰褰�", businessType = BusinessType.EXPORT) - @PostMapping("/export1") + @PostMapping("/export1/{ids}") public void export1(HttpServletResponse response, @PathVariable Long[] ids) { List<ZfEvent> list = zfEventService.selectByIds(ids); log.info("瀵煎嚭璁板綍涓�:{}", list); -- Gitblit v1.9.1