改了入库

This commit is contained in:
2025-07-05 14:41:51 +08:00
parent c9b239545b
commit 777a4c73dd

View File

@@ -207,7 +207,7 @@ namespace WMS.Web.Repositories
//boxList = boxList.GroupBy(g => g.DetailId).Select(s => s.OrderByDescending(o => o.ReceiveTime).First()).ToList(); //boxList = boxList.GroupBy(g => g.DetailId).Select(s => s.OrderByDescending(o => o.ReceiveTime).First()).ToList();
var boxIds = boxList.GroupBy(x => x.BoxId).Select(x => x.Key).ToList(); var boxIds = boxList.GroupBy(x => x.BoxId).Select(x => x.Key).ToList();
if (entity.Type == InstockType.Purchase) if ((entity.Type == InstockType.Purchase||entity.Type==InstockType.ProduceSotck))
{ {
//左连接中 右表中的数据如果有多条,所以需要特殊处理 //左连接中 右表中的数据如果有多条,所以需要特殊处理
var instockTaskBoxList = await _context.InstockTaskBox.Include(x => x.Details).Where(w => w.TaskId == entity.Id && boxIds.Contains(w.BoxId)).ToListAsync(); var instockTaskBoxList = await _context.InstockTaskBox.Include(x => x.Details).Where(w => w.TaskId == entity.Id && boxIds.Contains(w.BoxId)).ToListAsync();
@@ -251,7 +251,7 @@ namespace WMS.Web.Repositories
} }
if (entity.Type == InstockType.Purchase) if ((entity.Type == InstockType.Purchase || entity.Type == InstockType.ProduceSotck))
{ {
var receiveBox = await _context.InStockTaskBoxDetails var receiveBox = await _context.InStockTaskBoxDetails
.GroupJoin(_context.InstockTaskBox, boxde => boxde.Fid, ts => ts.Id, (detail, ts) => new { detail, ts }) .GroupJoin(_context.InstockTaskBox, boxde => boxde.Fid, ts => ts.Id, (detail, ts) => new { detail, ts })