wanshenmean
2026-03-30 b430ac7952d637b6eb9021cc37277402233c9c01
Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
@@ -98,6 +98,7 @@
            // 4. 提取物料编号和批次号列表(去重)
            var materielCodeList = stockInfos
                .Where(s => s.Details != null)
                .SelectMany(s => s.Details)
                .Select(d => d.MaterielCode)
                .Where(c => !string.IsNullOrEmpty(c))
@@ -105,6 +106,7 @@
                .ToList();
            var batchNoList = stockInfos
                .Where(s => s.Details != null)
                .SelectMany(s => s.Details)
                .Select(d => d.BatchNo)
                .Where(b => !string.IsNullOrEmpty(b))
@@ -130,7 +132,7 @@
                };
                // 尝试从库存字典中获取库存信息
                if (stockDict.TryGetValue(loc.Id, out var stockInfo))
                if (stockDict.TryGetValue(loc.Id, out var stockInfo) && stockInfo.Details != null)
                {
                    item.PalletCode = stockInfo.PalletCode;
                    item.StockQuantity = stockInfo.Details.Sum(d => d.StockQuantity);