1
dengjunjie
2025-09-29 d9c99e0480b4910cdb134778dd5c314b35ec4cf2
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -196,16 +196,25 @@
                }
                else
                {
                    Dt_InventoryInfo? _InventoryInfo = _stockService.InventoryInfoService.Repository.QueryData(x => x.BatchNo == inventoryInfo.BatchNo && (x.StockStatus == StockStatusEmun.入库中.ObjToInt() || x.StockStatus == StockStatusEmun.已入库.ObjToInt())).OrderByDescending(x => x.ModifyDate).FirstOrDefault();
                    Dt_InventoryInfo? _InventoryInfo = _stockService.InventoryInfoService.Repository.QueryData(x => x.BatchNo == inventoryInfo.BatchNo && x.StockStatus == StockStatusEmun.入库中.ObjToInt()).OrderByDescending(x => x.ModifyDate).FirstOrDefault();
                    if (_InventoryInfo != null)
                    {
                        locationInfo = _basicService.LocationInfoService.GetLocation(_InventoryInfo.LocationCode);
                        if (locationInfo?.MaxQty <= locationInfo?.CurrentQty) locationInfo = null;
                    }
                    if (locationInfo == null)
                    {
                        _InventoryInfo = _stockService.InventoryInfoService.Repository.QueryData(x => x.BatchNo == inventoryInfo.BatchNo && x.StockStatus == StockStatusEmun.已入库.ObjToInt()).OrderByDescending(x => x.InDate).FirstOrDefault();
                        if (_InventoryInfo != null)
                        {
                            locationInfo = _basicService.LocationInfoService.GetLocation(_InventoryInfo.LocationCode);
                            if (locationInfo?.MaxQty <= locationInfo?.CurrentQty) locationInfo = null;
                        }
                    }
                    if (locationInfo == null)//分配新货位
                    {
                        var Qty = Convert.ToInt32(inboundOrderDetail.OrderQuantity - inboundOrderDetail.OverInQuantity);
                        var Qty = Convert.ToInt32(inboundOrderDetail.OrderQuantity - inboundOrderDetail.ReceiptQuantity);
                        var ts = Qty / 320;
                        if (Qty % 320 > 0) ts++;
                        int inboundOrderCount = ts > 12 ? 2 : 1;
@@ -223,6 +232,7 @@
                task.SourceIsPickPlace = false;
                inventoryInfo.LocationCode = locationInfo.LocationCode;
                inventoryInfo.StockStatus = StockStatusEmun.入库中.ObjToInt();
                inventoryInfo.ModifyDate = DateTime.Now;
                locationInfo.CurrentQty++;
                if (locationInfo.MaxQty < locationInfo.CurrentQty) locationInfo.CurrentQty = locationInfo.MaxQty;
                inventoryInfo.SerialNumber = locationInfo.CurrentQty;