调整齐套分拣模块代码
This commit is contained in:
@@ -95,11 +95,10 @@ namespace Tnb.WarehouseMgr
|
||||
throw new AppFriendlyException($"需要出库[{os.pr_qty}],实际库存{codeQty},数量不足", 500);
|
||||
}
|
||||
var partCarryMats = carryCodesPart.Adapt<List<WmsCarryMat>>();
|
||||
partCarryMats.ForEach(x =>
|
||||
for (int i = 0; i < partCarryMats.Count; i++)
|
||||
{
|
||||
x.need_qty = (int)os.pr_qty;
|
||||
x.real_qty = codeQty;
|
||||
});
|
||||
partCarryMats[i].need_qty = carryCodesPart[i].codeqty;
|
||||
}
|
||||
carryMats.AddRange(partCarryMats);
|
||||
}
|
||||
}
|
||||
@@ -110,12 +109,12 @@ namespace Tnb.WarehouseMgr
|
||||
.Select(x =>
|
||||
{
|
||||
WmsCarryMat? carryMat = x.FirstOrDefault()!;
|
||||
carryMat.real_qty = x.Sum(d => d.real_qty);
|
||||
carryMat.need_qty = x.Sum(d => d.need_qty);
|
||||
return carryMat;
|
||||
})
|
||||
.ToList();
|
||||
await _db.Insertable(carryMats).ExecuteCommandAsync();
|
||||
var dic = carryMats.DistinctBy(x => x.carry_id).ToDictionary(x => x.carry_id, x => x.real_qty);
|
||||
var dic = carryMats.DistinctBy(x => x.carry_id).ToDictionary(x => x.carry_id, x => x.need_qty);
|
||||
var allOutIds = new List<string>();
|
||||
var sortingOutIds = new List<string>();
|
||||
foreach (var pair in dic)
|
||||
|
||||
Reference in New Issue
Block a user