调整齐套分拣模块代码

This commit is contained in:
alex
2023-06-26 16:10:10 +08:00
parent a3b6e3f8d0
commit b25aca740a
43 changed files with 571 additions and 77 deletions

View File

@@ -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)