From 1cf91e355038837f30f2d727507b2229263d7de7 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期二, 27 一月 2026 17:49:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New
---
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
index 55333a5..c0c53ca 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -28,6 +28,8 @@
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import com.ruoyi.sales.pojo.ShippingInfo;
import com.ruoyi.sales.service.ISalesLedgerProductService;
+import com.ruoyi.stock.mapper.StockInventoryMapper;
+import com.ruoyi.stock.pojo.StockInventory;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -85,6 +87,8 @@
@Autowired
private ProductStructureMapper productStructureMapper;
+ @Autowired
+ private StockInventoryMapper stockInventoryMapper;
@Override
public SalesLedgerProduct selectSalesLedgerProductById(Long id) {
@@ -491,10 +495,11 @@
int count = 0;
StringBuilder stringBuffer = new StringBuilder();
for (ProductStructureDto productStructureDto : productStructureDtos) {
- BigDecimal stockQuantity = stockUtils.getStockQuantity(productStructureDto.getProductModelId()).get("stockQuantity");
+ StockInventory stockInventory = stockInventoryMapper.selectOne(new QueryWrapper<StockInventory>().lambda().eq(StockInventory::getProductModelId, productStructureDto.getProductModelId()));
+
//鎵�闇�鏁伴噺
BigDecimal multiply = salesLedgerProduct.getQuantity().multiply(productStructureDto.getUnitQuantity());
- BigDecimal subtract =stockQuantity.subtract(multiply).divide(BigDecimal.ONE, 2, RoundingMode.CEILING);
+ BigDecimal subtract =stockInventory.getQualitity().subtract(stockInventory.getLockedQuantity()).subtract(multiply).divide(BigDecimal.ONE, 2, RoundingMode.CEILING);
if (subtract.compareTo(BigDecimal.ZERO) <= 0) {
count++;
stringBuffer.append(productStructureDto.getProductName())
--
Gitblit v1.9.3