1
This commit is contained in:
@@ -76,21 +76,17 @@ namespace Tnb.WarehouseMgr
|
|||||||
throw new AppFriendlyException($"需要出库[{os.pr_qty}],实际库存{codeQty},数量不足", 500);
|
throw new AppFriendlyException($"需要出库[{os.pr_qty}],实际库存{codeQty},数量不足", 500);
|
||||||
}
|
}
|
||||||
var partCarryMats = carryCodesPart.Adapt<List<WmsCarryMat>>();
|
var partCarryMats = carryCodesPart.Adapt<List<WmsCarryMat>>();
|
||||||
partCarryMats.ForEach(x =>
|
for (int i = 0; i < partCarryMats.Count; i++)
|
||||||
{
|
{
|
||||||
x.need_qty = (int)os.pr_qty;
|
partCarryMats[i].need_qty = carryCodesPart[i].codeqty;
|
||||||
x.real_qty = codeQty;
|
}
|
||||||
});
|
|
||||||
carryMats.AddRange(partCarryMats);
|
carryMats.AddRange(partCarryMats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (carryMats.Count > 0)
|
if (carryMats.Count > 0)
|
||||||
{
|
{
|
||||||
carryMats.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
carryMats.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||||
for (int i = 0; i < partCarryMats.Count; i++)
|
|
||||||
{
|
|
||||||
partCarryMats[i].need_qty = carryCodesPart[i].codeqty;
|
|
||||||
}
|
|
||||||
carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch })
|
carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch })
|
||||||
.Select(x =>
|
.Select(x =>
|
||||||
{
|
{
|
||||||
@@ -100,7 +96,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
await _db.Insertable(carryMats).ExecuteCommandAsync();
|
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);
|
||||||
|
|
||||||
carryIds = carryMats.Select(x => x.carry_id).Distinct().ToList();
|
carryIds = carryMats.Select(x => x.carry_id).Distinct().ToList();
|
||||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString() }).Where(it => carryIds.Contains(it.id)).ExecuteCommandAsync();
|
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString() }).Where(it => carryIds.Contains(it.id)).ExecuteCommandAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user