1
huanghongfeng
2024-12-02 e2a5657e3a0b8615bcd78a3149e5ba9ce5579bb8
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -126,9 +126,14 @@
            Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
            //查货位
            Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
            Dt_StockInfoDetail dt_StockInfodetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.OrderNo == task.PalletCode);
            Dt_StockInfoDetail dt_StockInfodetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id);
            CheckCompleted(stockInfo, locationInfo);
            if (stockInfo.MaterialType == (int)InventoryMaterialType.空托)
            {
                string currentTime = DateTime.Now.ToString("HHmmss");
                stockInfo.PalletCode = "KTP" + currentTime;
            }
            stockInfo.LocationCode = task.TargetAddress;
            stockInfo.StockStatus = StockStatusEmun.已入库.ObjToInt();
             _stockService.StockInfoService.Repository.UpdateData(stockInfo);
@@ -141,7 +146,14 @@
            beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity);
            int beforeStatus = locationInfo.LocationStatus;
            locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
            if (stockInfo.MaterialType == (int)InventoryMaterialType.空托)
            {
                locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
            }
            else
            {
                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
            }
            _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
            _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
@@ -207,10 +219,10 @@
                return (false, "未找到货位信息");
            }
            if (isCheckStockDetail && (stockInfo.Details == null || stockInfo.Details.Count == 0))
            /*if (isCheckStockDetail && (stockInfo.Details == null || stockInfo.Details.Count == 0))
            {
                return (false, "未找到组盘明细信息");
            }
            }*/
            return (true, "成功");
        }
@@ -328,5 +340,7 @@
            }
            return false;
        }
    }   
}