采购模糊查询
This commit is contained in:
@@ -76,7 +76,7 @@ namespace WMS.Web.Api.Controllers
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return ResultList<InStockTaskBillNoQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
|
||||
var list= await _inStockTaskRepositories.GetListBy(code);
|
||||
var list= await _inStockTaskRepositories.GetListBy(code, InstockType.Purchase);
|
||||
return ResultList<InStockTaskBillNoQueryResponse>.ReSuccess(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -850,6 +850,11 @@
|
||||
来源单号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskBillNoQueryResponse.StockCode">
|
||||
<summary>
|
||||
仓库编码(对应金蝶和单点)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskBillNoQueryResponse.MaterialId">
|
||||
<summary>
|
||||
物料ID
|
||||
|
||||
@@ -1189,7 +1189,7 @@
|
||||
<param name="sourceBillNos"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.IInStockTaskRepositories.GetListBy(System.String)">
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.IInStockTaskRepositories.GetListBy(System.String,System.Nullable{WMS.Web.Domain.Values.InstockType})">
|
||||
<summary>
|
||||
列表-根据来源单号模糊
|
||||
</summary>
|
||||
|
||||
@@ -6,6 +6,7 @@ using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.InStockTask;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Values;
|
||||
|
||||
namespace WMS.Web.Domain.Infrastructure
|
||||
{
|
||||
@@ -47,7 +48,7 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNo"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<InStockTaskBillNoQueryResponse>> GetListBy(string sourceBillNo);
|
||||
Task<List<InStockTaskBillNoQueryResponse>> GetListBy(string sourceBillNo, InstockType? type=null);
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
|
||||
@@ -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