通过编号查询到任务采购单据

This commit is contained in:
tongfei
2023-11-02 16:34:08 +08:00
parent f58556b0c4
commit f1cd7f0f5f
12 changed files with 457 additions and 181 deletions

View File

@@ -8,9 +8,11 @@ using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core;
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.Infrastructure;
using WMS.Web.Domain.Mappers;
using WMS.Web.Repositories.Configuration;
namespace WMS.Web.Repositories
@@ -94,7 +96,7 @@ namespace WMS.Web.Repositories
RealityQty = s.detail.RealityQty,
Receiver = "",
//ReceiveTime= s.order.ReceiveTime.ToString("yyyy-MM-dd HH:mm:ss.fff"),
ReceiveTime = s.order.ReceiveTime.HasValue? s.order.ReceiveTime.Value.ToString("yyyy-MM-dd HH:mm:ss.fff") : "",
ReceiveTime = s.order.ReceiveTime.HasValue ? s.order.ReceiveTime.Value.ToString("yyyy-MM-dd HH:mm:ss.fff") : "",
Shelfer = "",
//ShelfTime= s.order.ShelfTime.ToString("yyyy-MM-dd HH:mm:ss.fff"),
ShelfTime = s.order.ShelfTime.HasValue ? s.order.ShelfTime.Value.ToString("yyyy-MM-dd HH:mm:ss.fff") : "",
@@ -135,7 +137,7 @@ namespace WMS.Web.Repositories
/// </summary>
/// <param name="sourceBillNos"></param>
/// <returns></returns>
public async Task<List<InStockTask>> GetListBy(List<string> sourceBillNos)
public async Task<List<InStockTask>> GetListBy(List<string> sourceBillNos)
{
return await _context.InStockTask
.Include(s => s.Details)
@@ -143,6 +145,33 @@ namespace WMS.Web.Repositories
.ToListAsync();
}
/// <summary>
/// 列表-根据来源单号模糊
/// </summary>
/// <param name="sourceBillNo"></param>
/// <returns></returns>
public async Task<List<InStockTaskBillNoQueryResponse>> GetListBy(string sourceBillNo)
{
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 + "%"));
var list = await query.Select(s => new InStockTaskBillNoQueryResponse()
{
Id=s.detail.Id,
DetailsId=s.detail.Id,
SourceBillNo=s.order.SourceBillNo,
MaterialName = "",
MaterialNumber = "",
Specifications = "",
Qty=s.detail.AccruedQty
}).ToListAsync();
return list;
}
/// <summary>
/// 批量添加
/// </summary>
@@ -245,7 +274,7 @@ namespace WMS.Web.Repositories
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
public async Task<InStockTask> Update(InStockTask entity,bool isTransaction = true)
public async Task<InStockTask> Update(InStockTask entity, bool isTransaction = true)
{
IDbContextTransaction _transaction = null;
if (isTransaction)