From c247f5bf64c98595cc7e4efc9e1ae7ff1df79c11 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 23 四月 2026 14:05:32 +0800
Subject: [PATCH] refactor(swagger): 迁移Swagger注解到OpenAPI 3.0
---
src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java | 62 +++++++++++++++++++++----------
1 files changed, 42 insertions(+), 20 deletions(-)
diff --git a/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java b/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
index 1795c15..e567eea 100644
--- a/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
+++ b/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.pojo.ProductModel;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -11,14 +12,16 @@
import com.ruoyi.procurementrecord.mapper.CustomStorageMapper;
import com.ruoyi.procurementrecord.pojo.CustomStorage;
import com.ruoyi.procurementrecord.service.ProcurementRecordService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+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 javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
+
import java.util.List;
/**
@@ -26,22 +29,22 @@
* @date : 2025/7/7 14:32
*/
@RestController
-@Api(tags = "閲囪喘鍏ュ簱")
+@Tag(name = "閲囪喘鍏ュ簱")
@RequestMapping("/stockin")
+@AllArgsConstructor
public class ProcurementRecordController extends BaseController {
-
- @Autowired
private ProcurementRecordService procurementRecordService;
-
+ private CustomStorageMapper customStorageMapper;
/**
* 閫氳繃閿�鍞骇鍝乮d鑾峰彇鍏ュ簱鏁伴噺
+ *
* @param salesProductId
* @return
*/
@GetMapping("/getProcurementAmount")
- @ApiOperation(value = "閫氳繃閿�鍞骇鍝乮d鑾峰彇鍏ュ簱鏁伴噺")
+ @Operation(summary = "閫氳繃閿�鍞骇鍝乮d鑾峰彇鍏ュ簱鏁伴噺")
public AjaxResult getProcurementAmount(@RequestParam("salesProductId") Long salesProductId) {
return AjaxResult.success(procurementRecordService.getProcurementAmount(salesProductId));
}
@@ -114,27 +117,37 @@
@GetMapping("/listPage")
@Log(title = "閲囪喘鍏ュ簱-鍏ュ簱绠$悊-鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
- @ApiOperation(value = "鍏ュ簱鏌ヨ")
+ @Operation(summary = "鍏ュ簱鏌ヨ")
public AjaxResult listPage(Page page, ProcurementPageDto procurementDto) {
IPage<ProcurementPageDto> result = procurementRecordService.listPage(page, procurementDto);
return AjaxResult.success(result);
}
+
@GetMapping("/listReport")
- @ApiOperation(value = "鏌ヨ搴撳瓨鍥捐〃鏁版嵁")
+ @Operation(summary = "鏌ヨ搴撳瓨鍥捐〃鏁版嵁")
public AjaxResult listReport() {
return AjaxResult.success(procurementRecordService.getReportList());
}
+
@GetMapping("/listPageByProduction")
@Log(title = "鐢熶骇鍏ュ簱-鍏ュ簱绠$悊-鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
- @ApiOperation(value = "鍏ュ簱鏌ヨ")
+ @Operation(summary = "鍏ュ簱鏌ヨ")
public AjaxResult listPageByProduction(Page page, ProcurementPageDto procurementDto) {
IPage<ProcurementPageDto> result = procurementRecordService.listPageByProduction(page, procurementDto);
return AjaxResult.success(result);
}
+ @GetMapping("/listPageByProductProduction")
+ @Log(title = "鐢熶骇鍏ュ簱-鍏ュ簱绠$悊-鐢熶骇鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
+ @Operation(summary = "鍏ュ簱鏌ヨ")
+ public AjaxResult listPageByProductProduction(Page page, ProcurementPageDto procurementDto) {
+ IPage<ProcurementPageDto> result = procurementRecordService.listPageByProductProduction(page, procurementDto);
+ return AjaxResult.success(result);
+ }
+
@GetMapping("/listPageByCustom")
@Log(title = "鑷畾涔夊叆搴�-鍏ュ簱绠$悊-鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
- @ApiOperation(value = "鍏ュ簱鏌ヨ")
+ @Operation(summary = "鍏ュ簱鏌ヨ")
public AjaxResult listPageByCustom(Page page, CustomStorage customStorage) {
IPage<CustomStorage> result = procurementRecordService.listPageByCustom(page, customStorage);
return AjaxResult.success(result);
@@ -169,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")
@@ -226,5 +243,10 @@
util.exportExcel(response, customStorages, "鍏ュ簱鍙拌处");
}
-
+ @GetMapping("/listPageProductionStock")
+ @Log(title = "搴撳瓨绠$悊-鎴愬搧搴撳瓨", businessType = BusinessType.OTHER)
+ public AjaxResult listPageProductionStock(Page page, ProcurementPageDto procurementDto) {
+ IPage<ProductModel> result = procurementRecordService.listPageProductionStock(page, procurementDto);
+ return AjaxResult.success(result);
+ }
}
--
Gitblit v1.9.3