From 2c18c7b8d1708fd028b8e5093d5f5832c389ed0e Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期五, 22 五月 2026 09:29:22 +0800
Subject: [PATCH] feat(approve): 完善审批实例管理功能并新增报销单模块
---
src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 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 6a30baf..31cdc79 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionBomStructureServiceImpl.java
@@ -216,19 +216,22 @@
return;
}
List<ProductionBomStructure> updateList = new ArrayList<>();
+ BigDecimal lastProcessDemandedQuantity = orderQuantity;
for (ProductionBomStructure structure : structureList) {
if (structure == null || structure.getId() == null) {
continue;
}
- BigDecimal demandedQuantity = defaultDecimal(structure.getUnitQuantity()).multiply(orderQuantity);
- if (compareDecimal(structure.getDemandedQuantity(), demandedQuantity) == 0) {
- continue;
- }
+
+ BigDecimal demandedQuantity = lastProcessDemandedQuantity.multiply(defaultDecimal(structure.getUnitQuantity()));
+// if (compareDecimal(structure.getDemandedQuantity(), demandedQuantity) == 0) {
+// continue;
+// }
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);
@@ -307,7 +310,7 @@
if (matchedOperation == null) {
matchedOperation = insertRoutingOperationSnapshot(orderRouting.getId(), productionOrderId, desiredOperation);
} else {
- updateRoutingOperationSnapshotIfNecessary(matchedOperation, orderRouting.getId(), productionOrderId, desiredOperation);
+ updateRoutingOperationSnapshotIfNecessary(desiredOperation, orderRouting.getId(), productionOrderId, matchedOperation);
}
finalOperationList.add(matchedOperation);
}
--
Gitblit v1.9.3