调整箱信息接口

This commit is contained in:
18942506660
2023-11-01 16:29:30 +08:00
parent 57b4116031
commit 0f66efa9e2
10 changed files with 110 additions and 55 deletions

View File

@@ -50,32 +50,13 @@ namespace WMS.Web.Repositories
/// </summary>
/// <param name="BoxBillNo"></param>
/// <returns></returns>
public async Task<BoxResponse> GetBox(string BoxBillNo)
public async Task<List<BoxResponse>> GetBox(List<string> BoxBillNos)
{
var entity = await _context.Box.FirstOrDefaultAsync(f => f.BoxBillNo.Equals(BoxBillNo));
if (entity == null) return null;
BoxResponse result = new BoxResponse()
{
Id = entity.Id,
SupplierId=entity.SupplierId,
BoxBillNo = entity.BoxBillNo
};
result.Details = 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()
{
MaterialId = s.detail.MaterialId,
MaterialName = "",
MaterialNumber = "",
Specifications = "",
SerialNumbers = s.detail.SerialNumbers,
SupplierId = s.detail.SupplierId,
Qty = s.detail.Qty
})
.ToListAsync();
return result;
var list = await _context.Box.Include(x=>x.Details).Where(f => BoxBillNos.Contains(f.BoxBillNo)).ToListAsync();
var resList = _mapper.Map<List<BoxResponse>>(list);
//获取物料信息 显示物料三件套
var mIds = list.SelectMany(s => s.Details).Select(s => s.MaterialId).ToList();
return resList;
}
/// <summary>