diff --git a/src/WMS.Web.Repositories/InStockTaskRepositories.cs b/src/WMS.Web.Repositories/InStockTaskRepositories.cs index b61d510c..7d8060f9 100644 --- a/src/WMS.Web.Repositories/InStockTaskRepositories.cs +++ b/src/WMS.Web.Repositories/InStockTaskRepositories.cs @@ -343,29 +343,35 @@ namespace WMS.Web.Repositories string sourceBillNo = s[0]; string type = s[1]; InstockType t = InstockType.Purchase; - if(type=="6") + if (type == "6") { t = InstockType.ProduceSotck; } - else + else if (type == "1") { t = InstockType.Purchase; } - //这里只查状态为:部分入库和等待收货 + //这里只查状态为:部分入库和等待收货 - var query = _context.InStockTaskDetails - .GroupJoin(_context.InStockTask, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders }) - .SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order }) - .Where(w => EF.Functions.Like(w.order.SourceBillNo, "%" + sourceBillNo + "%") - && w.order.Type == t - && (w.order.Status == InstockStatus.Part || w.order.Status == InstockStatus.Wait || w.order.Status == InstockStatus.WaitInStock) - && w.detail.AccruedQty > 0 - && w.detail.IsRepeal != true); + var query = _context.InStockTaskDetails + .GroupJoin(_context.InStockTask, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders }) + .SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order }) + .Where(w => EF.Functions.Like(w.order.SourceBillNo, "%" + sourceBillNo + "%") + // && w.order.Type == t + && (w.order.Status == InstockStatus.Part || w.order.Status == InstockStatus.Wait || w.order.Status == InstockStatus.WaitInStock) + && w.detail.AccruedQty > 0 + && w.detail.IsRepeal != true); - + if (type == "") + { + } + else + { + query = query.Where(x => x.order.Type == t); + } //仓库 if (!string.IsNullOrEmpty(dto.StockCode))