From 230eab518bc9ab3eec4370dab8367876d72e562e Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期三, 17 五月 2023 15:11:31 +0800 Subject: [PATCH] 添加了ids --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventController.java | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 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 264df42..61c542e 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 @@ -9,6 +9,8 @@ import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.domain.ZfEvent; +import com.ruoyi.domain.excel.ZfEquipmentExcelBean; +import com.ruoyi.domain.excel.ZfEventExcelBean; import com.ruoyi.service.ZfEventService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; @@ -17,6 +19,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; +import java.util.Collections; import java.util.List; import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; @@ -45,6 +48,16 @@ return zfEventService.selectDataList(zfEvent, pageNum, pageSize); } + /** + * 鑾峰彇瀵煎叆妯℃澘 + */ + @PostMapping("/model") + public void getExportModel(HttpServletResponse response){ + List<ZfEventExcelBean> list = Collections.singletonList(new ZfEventExcelBean()); + ExcelUtil<ZfEventExcelBean> util = new ExcelUtil<>(ZfEventExcelBean.class); + util.exportExcel(response,list,"瀹跺ぇ浜嬭瀵煎叆妯℃澘"); + } + /** * 瀵煎嚭瀹跺涵澶т簨浠惰褰曞垪琛� @@ -59,11 +72,21 @@ util.exportExcel(response, list, "瀹跺涵澶т簨浠惰褰曟暟鎹�"); } + /** + * 瀵煎嚭瀹跺涵澶т簨浠惰褰曞垪琛� + */ +// @PreAuthorize("@ss.hasPermi('system:property:export')") + @Log(title = "瀹跺涵澶т簨浠惰褰�", businessType = BusinessType.EXPORT) + @PostMapping("/export1/{ids}") + public void export1(HttpServletResponse response, @PathVariable Long[] ids) { + List<ZfEvent> list = zfEventService.selectByIds(ids); + log.info("瀵煎嚭璁板綍涓�:{}", list); + ExcelUtil<ZfEvent> util = new ExcelUtil<>(ZfEvent.class); + util.exportExcel(response, list, "瀹跺涵澶т簨浠惰褰曟暟鎹�"); - public static void main(String[] args) { - System.out.println(); } + /** * 瀵煎叆瀹跺涵澶т簨浠惰褰曞垪琛� */ -- Gitblit v1.9.1