1
hutongqing
2025-01-11 9be8d6e3232971246ec6cb2acac1ad4d05798e9b
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -53,7 +53,7 @@
                {
                    return WebResponseContent.Instance.Error($"未找到组盘信息");
                }
                if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.手动组盘暂存.ObjToInt())
                if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.手动组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.出库完成.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"该托盘状态不正确,不可申请入库");
                }
@@ -173,7 +173,7 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent OutEmpty(int qty, string address, int WarehouseId)
        public WebResponseContent OutEmpty(int qty, string address, int WarehouseId, string barcode)
        {
            try
            {
@@ -182,8 +182,17 @@
                {
                    return WebResponseContent.Instance.Error($"未找到库区");
                }
                var stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.入库完成.ObjToInt(), qty, nameof(Dt_StockInfo.CreateDate));
                if (stockInfos == null) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}未找到空箱库存");
                List<Dt_StockInfo> stockInfos = null;
                if (string.IsNullOrEmpty(barcode))
                {
                    stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.入库完成.ObjToInt(), qty, nameof(Dt_StockInfo.CreateDate));
                }
                else
                {
                    stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.入库完成.ObjToInt() && x.PalletCode == barcode);
                    if (stockInfos.Count == 0) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}未找到空箱【{barcode}】");
                }
                if (stockInfos.Count < qty) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}空箱库存不足,库存数【{stockInfos.Count}】");
                List<Dt_Task> tasks = GetTasks(stockInfos, TaskTypeEnum.OutEmpty);
                stockInfos.ForEach(x =>