箱号查询
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
@@ -36,8 +37,33 @@ namespace WMS.Web.Repositories
|
||||
}
|
||||
public async Task<Box> Get(string BoxBillNo)
|
||||
{
|
||||
return await _context.Box.Include(x=>x.Details)
|
||||
.FirstOrDefaultAsync(f => f.BoxBillNo.Equals(BoxBillNo));
|
||||
return await _context.Box.Include(x => x.Details)
|
||||
.FirstOrDefaultAsync(f => f.BoxBillNo.Equals(BoxBillNo));
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据箱号查询物料信息
|
||||
/// </summary>
|
||||
/// <param name="BoxBillNo"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<BoxDetailResponse>> GetDetails(string BoxBillNo)
|
||||
{
|
||||
return await _context.BoxDetails
|
||||
.GroupJoin(_context.Box, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
.Where(w => w.order.BoxBillNo.Equals(BoxBillNo))
|
||||
.Select(s => new BoxDetailResponse()
|
||||
{
|
||||
Fid = s.detail.Fid,
|
||||
BoxId = s.order.OpsBoxId,
|
||||
MaterialId = s.detail.MaterialId,
|
||||
MaterialName = "",
|
||||
MaterialNumber = "",
|
||||
Specifications = "",
|
||||
SerialNumbers = s.detail.SerialNumbers,
|
||||
SupplierId = s.detail.SupplierId,
|
||||
Qty = s.detail.Qty
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user