From e9f2adb9ddc511c62e1628fbd527ba7cda8294d4 Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期五, 09 五月 2025 14:29:29 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/product-inventory-management-after

---
 src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
index 1f871d6..3c93788 100644
--- a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
+++ b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
@@ -4,13 +4,12 @@
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.sales.dto.SalesLedgerDto;
 import com.ruoyi.sales.pojo.SalesLedger;
 import com.ruoyi.sales.service.ISalesLedgerService;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -47,6 +46,17 @@
     }
 
     /**
+     * 鏌ヨ閿�鍞彴璐﹀拰浜у搧鐖跺瓙鍒楄〃
+     */
+    @GetMapping("/getSalesLedgerWithProducts")
+    public TableDataInfo getSalesLedgerWithProducts()
+    {
+        startPage();
+        List<SalesLedgerDto> list = salesLedgerService.getSalesLedgerWithProducts();
+        return getDataTable(list);
+    }
+
+    /**
      * 瀵煎嚭閿�鍞彴璐﹀垪琛�
      */
     @Log(title = "閿�鍞彴璐�", businessType = BusinessType.EXPORT)
@@ -68,32 +78,25 @@
     }
 
     /**
-     * 鏂板閿�鍞彴璐�
+     * 鏂板淇敼閿�鍞彴璐�
      */
     @Log(title = "閿�鍞彴璐�", businessType = BusinessType.INSERT)
-    @PostMapping ("/insertSalesLedger")
+    @PostMapping ("/addOrUpdateSalesLedger")
     public AjaxResult add(@RequestBody SalesLedger salesLedger)
     {
-        return toAjax(salesLedgerService.insertSalesLedger(salesLedger));
-    }
-
-    /**
-     * 淇敼閿�鍞彴璐�
-     */
-    @Log(title = "閿�鍞彴璐�", businessType = BusinessType.UPDATE)
-    @PostMapping ("/updateSalesLedger")
-    public AjaxResult edit(@RequestBody SalesLedger salesLedger)
-    {
-        return toAjax(salesLedgerService.updateSalesLedger(salesLedger));
+        return toAjax(salesLedgerService.addOrUpdateSalesLedger(salesLedger));
     }
 
     /**
      * 鍒犻櫎閿�鍞彴璐�
      */
     @Log(title = "閿�鍞彴璐�", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
+	@DeleteMapping("/delLedger")
+    public AjaxResult remove(@RequestBody Long[] ids)
     {
+        if (ids == null || ids.length == 0) {
+            return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+        }
         return toAjax(salesLedgerService.deleteSalesLedgerByIds(ids));
     }
 }

--
Gitblit v1.9.3