From f88884da6e87b1fb3757451f1c5fb4d8c75a1441 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 04 六月 2026 11:52:29 +0800
Subject: [PATCH] refactor(production): 优化BOM结构需求数量计算逻辑

---
 src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java
index 0513bdc..c459154 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java
@@ -217,22 +217,18 @@
             return;
         }
         List<ProductionBomStructure> updateList = new ArrayList<>();
-        BigDecimal lastProcessDemandedQuantity = orderQuantity;
         for (ProductionBomStructure structure : structureList) {
             if (structure == null || structure.getId() == null) {
                 continue;
             }
 
-            BigDecimal demandedQuantity = lastProcessDemandedQuantity.multiply(defaultDecimal(structure.getUnitQuantity()));
-//            if (compareDecimal(structure.getDemandedQuantity(), demandedQuantity) == 0) {
-//                continue;
-//            }
+            // 鐩存帴浣跨敤璁㈠崟鏁伴噺 脳 褰撳墠BOM鐨勫崟浣嶄骇鍑猴紝涓嶅啀閫愬眰绱Н
+            BigDecimal demandedQuantity = orderQuantity.multiply(defaultDecimal(structure.getUnitQuantity()));
             ProductionBomStructure update = new ProductionBomStructure();
             update.setId(structure.getId());
             update.setDemandedQuantity(demandedQuantity);
             updateList.add(update);
             structure.setDemandedQuantity(demandedQuantity);
-            lastProcessDemandedQuantity = demandedQuantity;
         }
         if (!updateList.isEmpty()) {
             this.updateBatchById(updateList);

--
Gitblit v1.9.3