wangxinhui
2026-01-12 ded9c653b4bd5f45cb23124068687135c29e6915
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_OutboundService/OutMESOrderService.cs
@@ -6,6 +6,7 @@
using System.Threading.Tasks;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.MaterielEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
@@ -209,7 +210,7 @@
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterialCode, item.WarehouseId).Where(x => !outStocks.Select(x => x.PalletCode).Contains(x.PalletCode)).ToList();
                if (!stockInfos.Any())
                {
                    throw new Exception($"未找到可分配库存");
                    continue;
                }
                //分配实际库存
                List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, needQuantity).OrderBy(x => x.StockLength).ToList();
@@ -246,7 +247,8 @@
                        assignStop = false;
                    }
                }
                //修改状态
                item.OutMESOrderStatus = OutOrderStatusEnum.出库中.ObjToInt();
                locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()));
            }
@@ -276,7 +278,7 @@
                List<Dt_ProStockInfo> stockInfos = _stockService.ProStockInfoService.GetUseableStocks(item.MaterialCode, WarehouseEnum.LLDCP.ObjToInt()).Where(x => !outStocks.Select(x => x.PalletCode).Contains(x.PalletCode)).ToList();
                if (!stockInfos.Any())
                {
                    throw new Exception($"未找到可分配库存");
                    continue;
                }
                //分配实际库存
                List<Dt_ProStockInfo> autoAssignStocks = _stockService.ProStockInfoService.GetOutboundStocks(stockInfos, needQuantity);
@@ -313,7 +315,7 @@
                        assignStop = false;
                    }
                }
                item.OutMESOrderStatus = OutOrderStatusEnum.出库中.ObjToInt();
                locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()));
            }