From 3cfa0bda6574d0c39db120c457e98a168aa193e8 Mon Sep 17 00:00:00 2001 From: Jinquan_Ou <Jinquan@gdut.com> Date: 星期日, 23 四月 2023 17:15:20 +0800 Subject: [PATCH] 完成婚姻 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanController.java | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 100 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanController.java index 04844ba..d464645 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanController.java @@ -1,9 +1,26 @@ package com.ruoyi.web.controller.zhang; -import org.springframework.web.bind.annotation.RequestMapping; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.domain.ZfClean; +import com.ruoyi.service.ZfCleanService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + +import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; +import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; /** * <p> @@ -15,7 +32,87 @@ */ @RestController @RequestMapping("/zfClean") -public class ZfCleanController { +@Slf4j +public class ZfCleanController extends BaseController { + + @Resource + private ZfCleanService zfCleanService; + + @GetMapping("/all") + public AjaxResult listAll(ZfClean zfClean){ + Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); + return zfCleanService.selectDataList(zfClean, pageNum, pageSize); + } + + + /** + * 瀵煎嚭淇濇磥鏀剁撼璁板綍鍒楄〃 + */ +// @PreAuthorize("@ss.hasPermi('system:property:export')") + @Log(title = "淇濇磥鏀剁撼璁板綍", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ZfClean zfClean) + { + List<ZfClean> list = zfCleanService.selectByCondition(zfClean); + log.info("瀵煎嚭璁板綍涓�:{}",list); + ExcelUtil<ZfClean> util = new ExcelUtil<>(ZfClean.class); + util.exportExcel(response, list, "淇濇磥鏀剁撼璁板綍鏁版嵁"); + } + + /** + * 瀵煎叆淇濇磥鏀剁撼璁板綍鍒楄〃 + */ + @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.IMPORT) + @PostMapping("/importData") + public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception + { + return zfCleanService.importExcel(file); + + } + + /** + * 鑾峰彇淇濇磥鏀剁撼璁板綍璇︾粏淇℃伅 + */ +// @PreAuthorize("@ss.hasPermi('system:property:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(zfCleanService.getById(id)); + } +// + /** + * 鏂板淇濇磥鏀剁撼璁板綍 + */ +// @PreAuthorize("@ss.hasPermi('system:property:add')") + @Log(title = "淇濇磥鏀剁撼璁板綍", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ZfClean zfClean) + { + return zfCleanService.addData2(zfClean); + } + + /** + * 淇敼淇濇磥鏀剁撼璁板綍 + */ +// @PreAuthorize("@ss.hasPermi('system:property:edit')") + @Log(title = "淇濇磥鏀剁撼璁板綍", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ZfClean zfClean) + { + return toAjax(zfCleanService.updateById(zfClean)); + } +// + /** + * 鎵归噺鍒犻櫎淇濇磥鏀剁撼璁板綍 + */ +// @PreAuthorize("@ss.hasPermi('system:property:remove')") + @Log(title = "淇濇磥鏀剁撼璁板綍", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(zfCleanService.removeByIds(Arrays.asList(ids))); + } } -- Gitblit v1.9.1