gongchunyi
2026-06-23 da3901e08f9a870579770ae11bbf13a117063809
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -1915,11 +1915,7 @@
            BigDecimal stockedQty = item.getStockedQuantity() == null ? BigDecimal.ZERO : item.getStockedQuantity();
            return orderQty.compareTo(BigDecimal.ZERO) <= 0 || stockedQty.compareTo(orderQty) >= 0;
        });
        int newStockStatus = allStocked ? 2 : (hasStocked ? 1 : 0);
        if (newStockStatus > 0 && ledger.getDeliveryDate() == null) {
            ledger.setDeliveryDate(LocalDate.now().plusDays(7));
        }
        ledger.setStockStatus(newStockStatus);
        ledger.setStockStatus(allStocked ? 2 : (hasStocked ? 1 : 0));
        baseMapper.updateById(ledger);
    }
@@ -2084,11 +2080,7 @@
            return sq != null && sq.compareTo(BigDecimal.ZERO) > 0;
        });
        boolean allLinesFull = ledgerAllProducts.stream().allMatch(p -> Objects.equals(p.getProductStockStatus(), 2));
        int newStockStatus = allLinesFull ? 2 : (anyInbound ? 1 : 0);
        if (newStockStatus > 0 && salesLedger.getDeliveryDate() == null) {
            salesLedger.setDeliveryDate(LocalDate.now().plusDays(7));
        }
        salesLedger.setStockStatus(newStockStatus);
        salesLedger.setStockStatus(allLinesFull ? 2 : (anyInbound ? 1 : 0));
        baseMapper.updateById(salesLedger);
    }