From 071e6262409c5e96f904d0724b73a07fb21bcdf3 Mon Sep 17 00:00:00 2001 From: 肖洋 <cathay_xy@163.com> Date: 星期四, 26 十二月 2024 14:12:42 +0800 Subject: [PATCH] 优化枚举和查询逻辑 --- Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs index e6c0992..e32b07f 100644 --- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs @@ -1178,7 +1178,7 @@ .Includes(x => x.StockInfoDetails) // 棰勫姞杞絊tockInfoDetails .Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢 .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine) - .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢 + .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢 .WhereIF(!devices.IsNullOrEmpty(), x => devices.Contains(x.LocationInfo.RoadwayNo)) .OrderBy(x => x.OutboundTime) // 鎺掑簭 .FirstAsync(); // 鑾峰彇绗竴涓厓绱� @@ -1201,7 +1201,7 @@ .Includes(x => x.StockInfoDetails) // 棰勫姞杞絊tockInfoDetails .Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢 .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine) - .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢 + .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢 .OrderBy(x => x.OutboundTime) // 鎺掑簭 .FirstAsync(); // 鑾峰彇绗竴涓厓绱� @@ -1223,7 +1223,7 @@ .Includes(x => x.StockInfoDetails) // 棰勫姞杞絊tockInfoDetails .Where(x => x.AreaCode == areaCode && x.IsFull == false) .Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "绌烘墭鐩�")) - .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢 + .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢 .OrderBy(x => x.CreateDate) // 鎺掑簭 .FirstAsync(); // 杞崲涓哄垪琛� @@ -2191,11 +2191,11 @@ List<DtLocationInfo> locations; if (IsFull) { - locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == roadWay); + locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == roadWay && x.EnalbeStatus == (int)EnableEnum.Enable); } else { - locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == roadWay /*&& x.LocationType ==*/); + locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == roadWay && x.EnalbeStatus == (int)EnableEnum.Enable); } if (locations == null) -- Gitblit v1.9.3