From e15c73ef6313c335d31173f2b14be3843e786156 Mon Sep 17 00:00:00 2001 From: whywhyo <1511349576@qq.com> Date: 星期二, 23 五月 2023 18:12:24 +0800 Subject: [PATCH] 456 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorController.java | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 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..9a197dd 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; @@ -44,6 +46,16 @@ return zfDoctorService.selectDoctorList(zfDoctor, pageNum, pageSize); } + /** + * 鑾峰彇瀵煎叆妯℃澘 + */ + @PostMapping("/model") + public void getExportModel(HttpServletResponse response){ + List<ZfDoctor> list = Collections.singletonList(new ZfDoctor()); + ExcelUtil<ZfDoctor> util = new ExcelUtil<>(ZfDoctor.class); + util.exportExcel(response,list,"瀹跺涵灏忓尰鐢熷鍏ユā鏉�"); + } + /** * 瀵煎嚭瀹跺涵灏忓尰鐢熻褰曞垪琛� @@ -58,7 +70,19 @@ ExcelUtil<ZfDoctor> util = new ExcelUtil<>(ZfDoctor.class); 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<ZfDoctor> list = zfDoctorService.selectByIds(ids); + log.info("瀵煎嚭璁板綍涓�:{}",list); + ExcelUtil<ZfDoctor> util = new ExcelUtil<>(ZfDoctor.class); + util.exportExcel(response, list, "瀹跺涵灏忓尰鐢熻褰曟暟鎹�"); + } /** * 瀵煎叆瀹跺涵灏忓尰鐢熻褰曞垪琛� */ @@ -94,7 +118,7 @@ @PostMapping public AjaxResult add(@RequestBody ZfDoctor zfDoctor) { - return toAjax(zfDoctorService.save(zfDoctor)); + return zfDoctorService.mySave(zfDoctor); } /** -- Gitblit v1.9.1