来源单号查询-接口优化

This commit is contained in:
tongfei
2023-11-09 14:55:16 +08:00
parent e04f0eeae0
commit b396c980b0
3 changed files with 26 additions and 1 deletions

View File

@@ -236,10 +236,11 @@ namespace WMS.Web.Repositories
if (materials_result.IsSuccess)
materials = materials_result.Data.ToList();
//这里只查状态为:部分入库和等待收货
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 + "%"));
.Where(w => EF.Functions.Like(w.order.SourceBillNo, "%" + sourceBillNo + "%") && (w.order.Status== InstockStatus.Part || w.order.Status==InstockStatus.Wait));
if(type.HasValue)
query = query.Where(w => w.order.Type == type.Value);