From 78694f580367d8825025a0d32beccbd9662764b7 Mon Sep 17 00:00:00 2001 From: whywhyo <1511349576@qq.com> Date: 星期六, 13 五月 2023 21:33:54 +0800 Subject: [PATCH] 导入模板 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorController.java | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorController.java index c76275d..a9bc22e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorController.java @@ -9,6 +9,7 @@ import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.domain.ZfDoctor; +import com.ruoyi.domain.excel.ZfCollectionExcelBean; import com.ruoyi.service.ZfDoctorService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; @@ -17,6 +18,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; @@ -42,6 +44,16 @@ Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); return zfDoctorService.selectDoctorList(zfDoctor, pageNum, pageSize); + } + + /** + * 鑾峰彇瀵煎叆妯℃澘 + */ + @GetMapping("/model") + public void getExportModel(HttpServletResponse response){ + List<ZfDoctor> list = Collections.singletonList(new ZfDoctor()); + ExcelUtil<ZfDoctor> util = new ExcelUtil<>(ZfDoctor.class); + util.exportExcel(response,list,"灏忓尰鐢熻褰曟暟鎹�"); } @@ -94,7 +106,7 @@ @PostMapping public AjaxResult add(@RequestBody ZfDoctor zfDoctor) { - return toAjax(zfDoctorService.save(zfDoctor)); + return zfDoctorService.mySave(zfDoctor); } /** -- Gitblit v1.9.1