wangxinhui
2025-10-26 733c975cd8647f6d006736f1863bad731e32e6fb
项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs
@@ -73,7 +73,7 @@
            {
                decimal needQuantity = item.XqLen;
                //鑾峰彇鍙敤搴撳瓨
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId);
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!outStocks.Select(x=>x.PalletCode).Contains(x.PalletCode)).ToList();
                if (!stockInfos.Any())
                {
                    throw new Exception($"鏈壘鍒板彲鍒嗛厤搴撳瓨");
@@ -118,7 +118,11 @@
                            Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(sGOrder, details[i], autoAssignStocks[0], orderDetailNeedQuantity);
                            outStockLockInfos.Add(outStockLockInfo);
                            details[i].AssignTotalUsage = orderQuantity;
                            autoAssignStocks[0].StockOutLength-= orderDetailNeedQuantity;
                            autoAssignStocks[0].StockOutLength+= orderDetailNeedQuantity;
                            if (autoAssignStocks[0].StockOutLength== autoAssignStocks[0].StockLength)
                            {
                                autoAssignStocks.Remove(autoAssignStocks[0]);
                            }
                            assignStop =false;
                        }
                    }