From a9d2ef88a2ac9cdc0b07e98e9c3a8ba621cfb1d8 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 09 四月 2026 16:11:31 +0800
Subject: [PATCH] feat: 生产订单根据库存数量判断生产,发货与冻结解冻挂钩
---
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
index 570b2f5..38c4b12 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -437,8 +437,8 @@
salesLedgerProduct.setApproveStatus(0);
salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice());
salesLedgerProductMapper.insert(salesLedgerProduct);
- // 娣诲姞鐢熶骇鏁版嵁
- salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct);
+ // 娣诲姞鐢熶骇鏁版嵁锛屽苟澶勭悊鍐荤粨搴撳瓨
+ salesLedgerProductServiceImpl.processStockAndProduction(salesLedgerProduct);
}
}
@@ -479,6 +479,8 @@
.eq(ShippingInfo::getSalesLedgerProductId, product.getId())
.orderByDesc(ShippingInfo::getCreateTime)
.last("limit 1"));
+ product.setShippingCarNumber(shippingInfo.getShippingCarNumber());
+ product.setShippingDate(shippingInfo.getShippingDate());
if (shippingInfo != null) {
product.setShippingStatus(shippingInfo.getStatus());
}
@@ -537,6 +539,11 @@
.collect(Collectors.toList());
//鍒犻櫎鐢熶骇鏁版嵁
salesLedgerProductServiceImpl.deleteProductionData(productIds);
+
+ // 杩樺師鍐荤粨鐨勭墿鐞嗗簱瀛�
+ for (Long productId : productIds) {
+ salesLedgerProductServiceImpl.revertFrozenStock(productId);
+ }
// 鎵归噺鍒犻櫎浜у搧瀛愯〃
if (!productIds.isEmpty()) {
@@ -735,8 +742,8 @@
salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxInclusiveTotalPrice());
salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice());
salesLedgerProductMapper.insert(salesLedgerProduct);
- // 娣诲姞鐢熶骇鏁版嵁
- salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct);
+ // 娣诲姞鐢熶骇鏁版嵁锛屽苟澶勭悊鍐荤粨搴撳瓨
+ salesLedgerProductServiceImpl.processStockAndProduction(salesLedgerProduct);
}
}
}
--
Gitblit v1.9.3