From 07d6e47c51a0ac489d6a8da76f893675d7d2a75f Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 21 八月 2026 16:10:50 +0800
Subject: [PATCH] fix: 需求总量耗料计算修改
---
src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java | 5 ++---
1 files changed, 2 insertions(+), 3 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..c1e665c 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java
@@ -217,13 +217,13 @@
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()));
+ BigDecimal demandedQuantity = defaultDecimal(orderQuantity)
+ .multiply(defaultDecimal(structure.getUnitQuantity()));
// if (compareDecimal(structure.getDemandedQuantity(), demandedQuantity) == 0) {
// continue;
// }
@@ -232,7 +232,6 @@
update.setDemandedQuantity(demandedQuantity);
updateList.add(update);
structure.setDemandedQuantity(demandedQuantity);
- lastProcessDemandedQuantity = demandedQuantity;
}
if (!updateList.isEmpty()) {
this.updateBatchById(updateList);
--
Gitblit v1.9.3