From 1ca5584d7e3200a9af65a099bd26d3593e2ba702 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期四, 07 五月 2026 14:36:08 +0800
Subject: [PATCH] 迁移pro
---
src/main/java/com/ruoyi/stock/controller/StockInRecordController.java | 40 +++++++++++++++++++++++++++++++---------
1 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/ruoyi/stock/controller/StockInRecordController.java b/src/main/java/com/ruoyi/stock/controller/StockInRecordController.java
index b12fc67..1887b27 100644
--- a/src/main/java/com/ruoyi/stock/controller/StockInRecordController.java
+++ b/src/main/java/com/ruoyi/stock/controller/StockInRecordController.java
@@ -7,25 +7,26 @@
import com.ruoyi.framework.web.domain.AjaxResult;
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 javax.servlet.http.HttpServletResponse;
import java.util.List;
@RestController
-@Api(tags = "鍏ュ簱")
+@Tag(name = "鍏ュ簱")
@RequestMapping("/stockInRecord")
+@RequiredArgsConstructor
public class StockInRecordController {
- @Autowired
- private StockInRecordService stockInRecordService;
+
+ private final StockInRecordService stockInRecordService;
@GetMapping("/listPage")
@Log(title = "鐢熶骇鍏ュ簱-鍏ュ簱绠$悊-鍒楄〃", businessType = BusinessType.OTHER)
- @ApiOperation(value = "鍏ュ簱绠$悊鍒楄〃")
+ @Operation(summary = "鍏ュ簱绠$悊鍒楄〃")
public AjaxResult listPage(Page page, StockInRecordDto stockInRecordDto) {
IPage<StockInRecordDto> result = stockInRecordService.listPage(page, stockInRecordDto);
return AjaxResult.success(result);
@@ -42,10 +43,31 @@
return AjaxResult.success(stockInRecordService.batchDelete(ids));
}
+ @DeleteMapping("/pending")
+ @Log(title = "鍏ュ簱绠$悊-鍒犻櫎寰呭鎵瑰叆搴�", businessType = BusinessType.DELETE)
+ @Operation(summary = "鍒犻櫎寰呭鎵圭殑鍏ュ簱璁板綍")
+ public AjaxResult deletePending(@RequestBody List<Long> ids) {
+ if(CollectionUtils.isEmpty(ids)){
+ return AjaxResult.error("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
+ }
+ return AjaxResult.success(stockInRecordService.batchDeletePending(ids));
+ }
+
@PostMapping("/exportStockInRecord")
- @ApiOperation("瀵煎嚭鍏ュ簱璁板綍")
+ @Operation(summary = "瀵煎嚭鍏ュ簱璁板綍")
public void exportStockInRecord(HttpServletResponse response, StockInRecordDto stockInRecordDto) {
stockInRecordService.exportStockInRecord(response,stockInRecordDto);
}
+ @PostMapping("/approve")
+ @Log(title = "鍏ュ簱绠$悊-瀹℃壒鍏ュ簱", businessType = BusinessType.UPDATE)
+ @Operation(summary = "鎵归噺瀹℃壒鍏ュ簱璁板綍")
+ public AjaxResult approve(@RequestBody StockInRecordDto approveDto) {
+ if(CollectionUtils.isEmpty(approveDto.getIds())){
+ return AjaxResult.error("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
+ }
+ stockInRecordService.batchApprove(approveDto.getIds(), approveDto.getApprovalStatus());
+ return AjaxResult.success();
+ }
+
}
--
Gitblit v1.9.3