From 898bd4e44b8b0abe35cf98bf104aec44ec06dee2 Mon Sep 17 00:00:00 2001
From: zqy <2522236926@qq.com>
Date: 星期二, 22 四月 2025 20:57:59 +0800
Subject: [PATCH] bug
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanController.java | 128 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 125 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..bbf8e0a 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,28 @@
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.domain.excel.ZfCleanExcelBean;
+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.Collections;
+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 +34,110 @@
*/
@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);
+ }
+
+ /**
+ * 鑾峰彇瀵煎叆妯℃澘
+ */
+ @PostMapping("/model")
+ public void getExportModel(HttpServletResponse response){
+ List<ZfCleanExcelBean> list = Collections.singletonList(new ZfCleanExcelBean());
+ ExcelUtil<ZfCleanExcelBean> util = new ExcelUtil<>(ZfCleanExcelBean.class);
+ util.exportExcel(response,list,"淇濇磥鏀剁撼瀵煎叆妯℃澘");
+ }
+
+
+ /**
+ * 瀵煎嚭淇濇磥鏀剁撼璁板綍鍒楄〃
+ */
+// @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, "淇濇磥鏀剁撼璁板綍鏁版嵁");
+ }
+ /**
+ * 瀵煎嚭淇濇磥鏀剁撼璁板綍鍒楄〃
+ */
+// @PreAuthorize("@ss.hasPermi('system:property:export')")
+ @Log(title = "淇濇磥鏀剁撼璁板綍", businessType = BusinessType.EXPORT)
+ @PostMapping("/export1/{ids}")
+ public void export(HttpServletResponse response, @PathVariable Long[] ids)
+ {
+ List<ZfClean> list = zfCleanService.selectByIds(ids);
+ 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.addData(zfClean);
+ }
+
+ /**
+ * 淇敼淇濇磥鏀剁撼璁板綍
+ */
+// @PreAuthorize("@ss.hasPermi('system:property:edit')")
+ @Log(title = "淇濇磥鏀剁撼璁板綍", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody ZfClean zfClean)
+ {
+ return zfCleanService.updateData(zfClean);
+ }
+//
+ /**
+ * 鎵归噺鍒犻櫎淇濇磥鏀剁撼璁板綍
+ */
+// @PreAuthorize("@ss.hasPermi('system:property:remove')")
+ @Log(title = "淇濇磥鏀剁撼璁板綍", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return zfCleanService.deleteData(ids);
+ }
}
--
Gitblit v1.9.1