采购模糊查询

This commit is contained in:
tongfei
2023-11-03 10:44:42 +08:00
parent 7afffdc84e
commit 4edfd4f5e2
5 changed files with 14 additions and 4 deletions

View File

@@ -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,