From cc967be03d754403ab4159a7229d50f46e731a2d Mon Sep 17 00:00:00 2001 From: Jinquan_Ou <Jinquan@gdut.com> Date: 星期一, 24 四月 2023 22:56:49 +0800 Subject: [PATCH] 1 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventController.java | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 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 82753e6..264df42 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 @@ -39,7 +39,7 @@ private ZfEventService zfEventService; @GetMapping("/all") - public AjaxResult listAll(ZfEvent zfEvent){ + public AjaxResult listAll(ZfEvent zfEvent) { Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); return zfEventService.selectDataList(zfEvent, pageNum, pageSize); @@ -52,12 +52,16 @@ // @PreAuthorize("@ss.hasPermi('system:property:export')") @Log(title = "瀹跺涵澶т簨浠惰褰�", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, ZfEvent zfEvent) - { + public void export(HttpServletResponse response, ZfEvent zfEvent) { List<ZfEvent> list = zfEventService.selectByCondition(zfEvent); - log.info("瀵煎嚭璁板綍涓�:{}",list); + log.info("瀵煎嚭璁板綍涓�:{}", list); ExcelUtil<ZfEvent> util = new ExcelUtil<>(ZfEvent.class); util.exportExcel(response, list, "瀹跺涵澶т簨浠惰褰曟暟鎹�"); + + } + + public static void main(String[] args) { + System.out.println(); } /** @@ -65,8 +69,8 @@ */ @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.IMPORT) @PostMapping("/importData") - public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception - { + public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception { + return zfEventService.importExcel(file); } @@ -76,19 +80,18 @@ */ // @PreAuthorize("@ss.hasPermi('system:property:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(zfEventService.getById(id)); } // + /** * 鏂板瀹跺涵澶т簨浠惰褰� */ // @PreAuthorize("@ss.hasPermi('system:property:add')") @Log(title = "瀹跺涵澶т簨浠惰褰�", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody ZfEvent zfEvent) - { + public AjaxResult add(@RequestBody ZfEvent zfEvent) { return zfEventService.addData2(zfEvent); } @@ -98,19 +101,18 @@ // @PreAuthorize("@ss.hasPermi('system:property:edit')") @Log(title = "瀹跺涵澶т簨浠惰褰�", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody ZfEvent zfEvent) - { + public AjaxResult edit(@RequestBody ZfEvent zfEvent) { return toAjax(zfEventService.updateById(zfEvent)); } // + /** * 鎵归噺鍒犻櫎瀹跺涵澶т簨浠惰褰� */ // @PreAuthorize("@ss.hasPermi('system:property:remove')") @Log(title = "瀹跺涵澶т簨浠惰褰�", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(zfEventService.removeByIds(Arrays.asList(ids))); } -- Gitblit v1.9.1