From 55d694aaae4e421b5e55cd941500e08f85cb5d4d Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 27 八月 2026 18:21:33 +0800
Subject: [PATCH] feat(sales): 添加框架合同订单功能并优化销售台账管理

---
 src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
index 05b0bce..af93f28 100644
--- a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
+++ b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
@@ -166,6 +166,24 @@
         return toAjax(salesLedgerService.addOrUpdateSalesLedger(salesLedgerDto));
     }
 
+    @PostMapping("/createFrameworkOrder")
+    @Operation(summary = "鍒涘缓妗嗘灦璁㈠崟")
+    public AjaxResult createFrameworkOrder(@RequestBody SalesLedgerDto salesLedgerDto) {
+        return toAjax(salesLedgerService.createFrameworkOrder(salesLedgerDto));
+    }
+
+    @GetMapping("/listFrameworkOrders")
+    @Operation(summary = "鏌ヨ妗嗘灦鍚堝悓涓嬬殑妗嗘灦璁㈠崟")
+    public AjaxResult listFrameworkOrders(@RequestParam("parentContractId") Long parentContractId) {
+        return AjaxResult.success(salesLedgerService.listFrameworkOrders(parentContractId));
+    }
+
+    @GetMapping("/frameworkContractShippedQuantity")
+    @Operation(summary = "鏌ヨ妗嗘灦鍚堝悓绱宸插彂璐ф暟閲�")
+    public AjaxResult frameworkContractShippedQuantity(@RequestParam("parentContractId") Long parentContractId) {
+        return AjaxResult.success(salesLedgerService.getFrameworkContractShippedQuantity(parentContractId));
+    }
+
     /**
      * 鍒犻櫎閿�鍞彴璐�
      */
@@ -262,16 +280,13 @@
 
             //  濡傛灉宸茬粡鏈夎繃寮�绁ㄦ垨鍥炴鎿嶄綔,鍒欎笉鍏佽缂栬緫
             boolean hasReceiptOperation = receiptPaymentAmountTotal.compareTo(BigDecimal.ZERO) > 0;
-            salesLedgerVo.setIsEdit(hasReceiptOperation);
+            salesLedgerVo.setIsEdit(!hasReceiptOperation);
 
             salesLedgerVo.setStorageBlobVOs(fileUtil.getStorageBlobVOsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.FILE, RecordTypeEnum.SALES_LEDGER, ledgerId));
         }
 
         if (ObjectUtils.isNotEmpty(salesLedgerDto.getStatus())) {
             if (salesLedgerDto.getStatus()) {
-                // 娓呴櫎鎵�鏈夆�滄湭寮�绁ㄩ噾棰濃�濅负 0 鐨勮褰�
-                iPage.getRecords().removeIf(salesLedger ->
-                        Objects.equals(salesLedger.getNoInvoiceAmountTotal(), new BigDecimal("0.00")));
                 iPage.setTotal(iPage.getRecords().size());
             }
         }

--
Gitblit v1.9.3