采购模糊查询
This commit is contained in:
@@ -13,6 +13,7 @@ using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.Mappers;
|
||||
using WMS.Web.Domain.Values;
|
||||
using WMS.Web.Repositories.Configuration;
|
||||
|
||||
namespace WMS.Web.Repositories
|
||||
@@ -150,13 +151,16 @@ namespace WMS.Web.Repositories
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNo"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<InStockTaskBillNoQueryResponse>> GetListBy(string sourceBillNo)
|
||||
public async Task<List<InStockTaskBillNoQueryResponse>> GetListBy(string sourceBillNo, InstockType? type=null)
|
||||
{
|
||||
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 + "%"));
|
||||
|
||||
if(type.HasValue)
|
||||
query = query.Where(w => w.order.Type == type.Value);
|
||||
|
||||
var list = await query.Select(s => new InStockTaskBillNoQueryResponse()
|
||||
{
|
||||
Id=s.detail.Id,
|
||||
|
||||
Reference in New Issue
Block a user