From 55a16a2b0144c30277c7ac01712f347eedfaab41 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期三, 22 四月 2026 17:49:46 +0800
Subject: [PATCH] feat(common): 优化文件预览接口实现及文件压缩功能

---
 src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java b/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
index 64134d3..a22c5ed 100644
--- a/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
+++ b/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
@@ -14,12 +14,14 @@
 import com.ruoyi.procurementrecord.service.ProcurementRecordService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
 import org.apache.ibatis.annotations.Delete;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import jakarta.servlet.http.HttpServletResponse;
+
 import java.util.List;
 
 /**
@@ -29,15 +31,15 @@
 @RestController
 @Api(tags = "閲囪喘鍏ュ簱")
 @RequestMapping("/stockin")
+@AllArgsConstructor
 public class ProcurementRecordController extends BaseController {
 
-
-    @Autowired
     private ProcurementRecordService procurementRecordService;
-
+    private CustomStorageMapper customStorageMapper;
 
     /**
      * 閫氳繃閿�鍞骇鍝乮d鑾峰彇鍏ュ簱鏁伴噺
+     *
      * @param salesProductId
      * @return
      */
@@ -120,11 +122,13 @@
         IPage<ProcurementPageDto> result = procurementRecordService.listPage(page, procurementDto);
         return AjaxResult.success(result);
     }
+
     @GetMapping("/listReport")
     @ApiOperation(value = "鏌ヨ搴撳瓨鍥捐〃鏁版嵁")
     public AjaxResult listReport() {
         return AjaxResult.success(procurementRecordService.getReportList());
     }
+
     @GetMapping("/listPageByProduction")
     @Log(title = "鐢熶骇鍏ュ簱-鍏ュ簱绠$悊-鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
     @ApiOperation(value = "鍏ュ簱鏌ヨ")
@@ -178,54 +182,58 @@
 
     /**
      * 搴撳瓨绠$悊閲囪喘瀵煎嚭
+     *
      * @param response
      */
     @PostMapping("/exportCopy")
     public void exportCopy(HttpServletResponse response) {
-        procurementRecordService.exportCopy(response,1);
+        procurementRecordService.exportCopy(response, 1);
     }
 
     /**
      * 搴撳瓨绠$悊鐢熶骇瀵煎嚭
+     *
      * @param response
      */
     @PostMapping("/exportCopyOne")
     public void exportCopyOne(HttpServletResponse response) {
-        procurementRecordService.exportCopy(response,2);
+        procurementRecordService.exportCopy(response, 2);
     }
 
     /**
      * 搴撳瓨绠$悊鑷畾涔夊鍑�
+     *
      * @param response
      */
     @PostMapping("/exportCopyTwo")
     public void exportCopyTwo(HttpServletResponse response) {
-        procurementRecordService.exportCopyTwo(response,3);
+        procurementRecordService.exportCopyTwo(response, 3);
     }
 
     /**
      * 鍏ュ簱锛屽嚭搴撶鐞嗛噰璐鍑�
+     *
      * @param response
      */
     @PostMapping("/export")
     public void export(HttpServletResponse response) {
-        procurementRecordService.export(response,1);
+        procurementRecordService.export(response, 1);
     }
 
     /**
      * 鍏ュ簱锛屽嚭搴撶鐞嗙敓浜у鍑�
+     *
      * @param response
      */
     @PostMapping("/exportOne")
     public void exportOne(HttpServletResponse response) {
-        procurementRecordService.export(response,2);
+        procurementRecordService.export(response, 2);
     }
 
-    @Autowired
-    private CustomStorageMapper customStorageMapper;
 
     /**
      * 鍏ュ簱锛屽嚭搴撶鐞嗚嚜瀹氫箟瀵煎嚭
+     *
      * @param response
      */
     @PostMapping("/exportTwo")
@@ -238,7 +246,7 @@
     @GetMapping("/listPageProductionStock")
     @Log(title = "搴撳瓨绠$悊-鎴愬搧搴撳瓨", businessType = BusinessType.OTHER)
     public AjaxResult listPageProductionStock(Page page, ProcurementPageDto procurementDto) {
-        IPage<ProductModel> result = procurementRecordService.listPageProductionStock(page,procurementDto);
+        IPage<ProductModel> result = procurementRecordService.listPageProductionStock(page, procurementDto);
         return AjaxResult.success(result);
     }
 }

--
Gitblit v1.9.3