From d06ef3f44d6dc19dae223ab420165369ea13cc16 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 20 五月 2026 16:29:35 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New_pro

---
 src/main/java/com/ruoyi/stock/controller/StockInRecordController.java |   68 ++++++++++++++++++++++------------
 1 files changed, 44 insertions(+), 24 deletions(-)

diff --git a/src/main/java/com/ruoyi/stock/controller/StockInRecordController.java b/src/main/java/com/ruoyi/stock/controller/StockInRecordController.java
index e5bdef2..f26bc5f 100644
--- a/src/main/java/com/ruoyi/stock/controller/StockInRecordController.java
+++ b/src/main/java/com/ruoyi/stock/controller/StockInRecordController.java
@@ -4,51 +4,71 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.R;
 import com.ruoyi.stock.dto.StockInRecordDto;
 import com.ruoyi.stock.service.StockInRecordService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.RequiredArgsConstructor;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
 @RestController
-@Api(tags = "閲囪喘鍏ュ簱")
+@Tag(name = "鍏ュ簱")
 @RequestMapping("/stockInRecord")
-public class StockInRecordController {
-    @Autowired
-    private StockInRecordService stockInRecordService;
+@RequiredArgsConstructor
+public class StockInRecordController extends BaseController {
+
+    private final StockInRecordService stockInRecordService;
 
     @GetMapping("/listPage")
     @Log(title = "鐢熶骇鍏ュ簱-鍏ュ簱绠$悊-鍒楄〃", businessType = BusinessType.OTHER)
-    @ApiOperation(value = "鍏ュ簱绠$悊鍒楄〃")
-    public AjaxResult listPage(Page page, StockInRecordDto stockInRecordDto) {
+    @Operation(summary = "鍏ュ簱绠$悊鍒楄〃")
+    public R<?> listPage(Page page, StockInRecordDto stockInRecordDto) {
         IPage<StockInRecordDto> result = stockInRecordService.listPage(page, stockInRecordDto);
-        return AjaxResult.success(result);
+        return R.ok(result);
     }
 
-    @PostMapping("")
-    @Log(title = "鍏ュ簱绠$悊-鏂板鍏ュ簱", businessType = BusinessType.INSERT)
-    public AjaxResult add(@RequestBody StockInRecordDto stockInRecordDto) {
-        return AjaxResult.success(stockInRecordService.add(stockInRecordDto));
-    }
 
-    @PutMapping("/{id}")
-    @Log(title = "鍏ュ簱绠$悊-鏇存柊鍏ュ簱", businessType = BusinessType.UPDATE)
-    public AjaxResult update(@PathVariable("id") Long id, @RequestBody StockInRecordDto stockInRecordDto) {
-        return AjaxResult.success(stockInRecordService.update(id, stockInRecordDto));
-    }
 
     @DeleteMapping("")
     @Log(title = "鍏ュ簱绠$悊-鍒犻櫎鍏ュ簱", businessType = BusinessType.DELETE)
-    public AjaxResult delete(@RequestBody List<Long> ids) {
+    public R<?> delete(@RequestBody List<Long> ids) {
         if(CollectionUtils.isEmpty(ids)){
-            return AjaxResult.error("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
+            return R.fail("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
         }
-        return AjaxResult.success(stockInRecordService.batchDelete(ids));
+        return R.ok(stockInRecordService.batchDelete(ids));
+    }
+
+    @DeleteMapping("/pending")
+    @Log(title = "鍏ュ簱绠$悊-鍒犻櫎寰呭鎵瑰叆搴�", businessType = BusinessType.DELETE)
+    @Operation(summary = "鍒犻櫎寰呭鎵圭殑鍏ュ簱璁板綍")
+    public R<?> deletePending(@RequestBody List<Long> ids) {
+        if(CollectionUtils.isEmpty(ids)){
+            return R.fail("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
+        }
+        return R.ok(stockInRecordService.batchDeletePending(ids));
+    }
+
+    @PostMapping("/exportStockInRecord")
+    @Operation(summary = "瀵煎嚭鍏ュ簱璁板綍")
+    public void exportStockInRecord(HttpServletResponse response, StockInRecordDto stockInRecordDto) {
+        stockInRecordService.exportStockInRecord(response,stockInRecordDto);
+    }
+
+    @PostMapping("/approve")
+    @Log(title = "鍏ュ簱绠$悊-瀹℃壒鍏ュ簱", businessType = BusinessType.UPDATE)
+    @Operation(summary = "鎵归噺瀹℃壒鍏ュ簱璁板綍")
+    public R<?> approve(@RequestBody StockInRecordDto approveDto) {
+        if(CollectionUtils.isEmpty(approveDto.getIds())){
+            return R.fail("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
+        }
+        stockInRecordService.batchApprove(approveDto.getIds(), approveDto.getApprovalStatus());
+        return R.ok();
     }
 
 }

--
Gitblit v1.9.3