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/basic/controller/ProductController.java |   48 ++++++++++++++++++++++++------------------------
 1 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/main/java/com/ruoyi/basic/controller/ProductController.java b/src/main/java/com/ruoyi/basic/controller/ProductController.java
index 252ab4d..5109662 100644
--- a/src/main/java/com/ruoyi/basic/controller/ProductController.java
+++ b/src/main/java/com/ruoyi/basic/controller/ProductController.java
@@ -10,22 +10,20 @@
 import com.ruoyi.basic.pojo.ProductModel;
 import com.ruoyi.basic.service.IProductModelService;
 import com.ruoyi.basic.service.IProductService;
+import com.ruoyi.basic.vo.ProductModelVo;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.domain.R;
 import com.ruoyi.sales.pojo.SalesLedgerProduct;
 import com.ruoyi.sales.service.ISalesLedgerProductService;
-import com.ruoyi.sales.service.ISalesLedgerService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
 import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.List;
 
 @RestController
@@ -34,9 +32,7 @@
 public class ProductController extends BaseController {
 
     private IProductService productService;
-
     private IProductModelService productModelService;
-    @Autowired
     private ISalesLedgerProductService salesLedgerProductService;
     /**
      * 鏌ヨ浜у搧
@@ -59,8 +55,9 @@
      */
     @Log(title = "浜у搧", businessType = BusinessType.INSERT)
     @PostMapping("/addOrEditProduct")
-    public AjaxResult addOrEditProduct(@RequestBody ProductDto productDto) {
-        return toAjax(productService.addOrEditProduct(productDto));
+    public R<?> addOrEditProduct(@RequestBody ProductDto productDto) {
+        productService.addOrEditProduct(productDto);
+        return R.ok();
     }
 
     /**
@@ -68,8 +65,9 @@
      */
     @Log(title = "浜у搧瑙勬牸鍨嬪彿", businessType = BusinessType.INSERT)
     @PostMapping("/addOrEditProductModel")
-    public AjaxResult addOrEditProductModel(@RequestBody ProductModelDto productModelDto) {
-        return toAjax(productModelService.addOrEditProductModel(productModelDto));
+    public R<?> addOrEditProductModel(@RequestBody ProductModelDto productModelDto) {
+        productModelService.addOrEditProductModel(productModelDto);
+        return R.ok();
     }
 
     /**
@@ -77,18 +75,19 @@
      */
     @Log(title = "浜у搧", businessType = BusinessType.DELETE)
     @DeleteMapping("/delProduct")
-    public AjaxResult remove(@RequestBody Long[] ids) {
+    public R<?> remove(@RequestBody Long[] ids) {
         if (ids == null || ids.length == 0) {
-            return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+            return R.fail("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
         }
         // 妫�鏌ユ槸鍚︽湁閿�鍞晢鍝佽褰曞叧鑱旇浜у搧
         LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(SalesLedgerProduct::getProductId, ids);
         List<SalesLedgerProduct> salesLedgerProductList = salesLedgerProductService.list(queryWrapper);
         if (salesLedgerProductList.size() > 0) {
-            return AjaxResult.error("璇ヤ骇鍝佸瓨鍦ㄩ攢鍞�/閲囪喘璁板綍锛屼笉鑳藉垹闄�");
+            return R.fail("璇ヤ骇鍝佸瓨鍦ㄩ攢鍞�/閲囪喘璁板綍锛屼笉鑳藉垹闄�");
         }
-        return toAjax(productService.delProductByIds(ids));
+        productService.delProductByIds(ids);
+        return R.ok();
     }
 
     /**
@@ -96,18 +95,19 @@
      */
     @Log(title = "浜у搧瑙勬牸鍨嬪彿", businessType = BusinessType.DELETE)
     @DeleteMapping("/delProductModel")
-    public AjaxResult delProductModel(@RequestBody Long[] ids) {
+    public R<?> delProductModel(@RequestBody Long[] ids) {
         if (ids == null || ids.length == 0) {
-            return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+            return R.fail("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
         }
         // 妫�鏌ユ槸鍚︽湁閿�鍞晢鍝佽褰曞叧鑱旇浜у搧瑙勬牸鍨嬪彿
         LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(SalesLedgerProduct::getProductModelId, ids);
         List<SalesLedgerProduct> salesLedgerProductList = salesLedgerProductService.list(queryWrapper);
         if (salesLedgerProductList.size() > 0) {
-            return AjaxResult.error("璇ヤ骇鍝佽鏍煎瀷鍙峰瓨鍦ㄩ攢鍞�/閲囪喘璁板綍锛屼笉鑳藉垹闄�");
+            return R.fail("璇ヤ骇鍝佽鏍煎瀷鍙峰瓨鍦ㄩ攢鍞�/閲囪喘璁板綍锛屼笉鑳藉垹闄�");
         }
-        return toAjax(productModelService.delProductModel(ids));
+        productModelService.delProductModel(ids);
+        return R.ok();
     }
 
     /**
@@ -118,9 +118,9 @@
         return productModelService.modelListPage(page, productDto);
     }
 
-    @ApiOperation("鍒嗛〉鏌ヨ鎵�鏈変骇鍝佸瀷鍙�")
+    @Operation(summary = "鍒嗛〉鏌ヨ鎵�鏈変骇鍝佸瀷鍙�")
     @GetMapping("/pageModel")
-    public IPage<ProductModel> listPageProductModel(Page<ProductModel> page, ProductModel productModel) {
+    public IPage<ProductModelVo> listPageProductModel(Page<ProductModelVo> page, ProductModel productModel) {
         return productService.listPageProductModel(page, productModel);
     }
 
@@ -129,7 +129,7 @@
      */
     @PostMapping("/import")
     @Log(title = "瀵煎叆浜у搧", businessType = BusinessType.IMPORT)
-    public AjaxResult importProductModel(@RequestParam("file") MultipartFile file, Integer productId) {
+    public R<?> importProductModel(@RequestParam("file") MultipartFile file, Integer productId) {
         return productModelService.importProductModel(file, productId);
     }
 
@@ -137,7 +137,7 @@
      * 浜у搧瀵煎叆妯℃澘
      */
     @GetMapping("/export")
-    @ApiOperation("浜у搧瀵煎叆妯℃澘")
+    @Operation(summary = "浜у搧瀵煎叆妯℃澘")
     @Log(title = "浜у搧瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
     public void importProduct(HttpServletResponse response) {
         ExcelUtil<ProductModelExportDto> excelUtil = new ExcelUtil<>(ProductModelExportDto.class);

--
Gitblit v1.9.3