现场问题

This commit is contained in:
2024-10-08 11:33:35 +08:00
parent 4af8cc9d86
commit 2a3a56814b
5 changed files with 72 additions and 62 deletions

View File

@@ -775,7 +775,7 @@ namespace Tnb.WarehouseMgr
{
decimal? needOut = input.needOut;
int endlocation_index = 0;
BasLocation endlocation_ssx = null;
BasLocation endlocation_ssx2 = null;
for (int i = 0; i < itemsASC.Count; i++)
{
@@ -790,7 +790,7 @@ namespace Tnb.WarehouseMgr
// 每6个重新获取一次终点
if (i % move_num == 0)
{
endlocation_ssx = await cyDb.Queryable<BasLocation>().Where(r => input.endlocations.Contains(r.id)).OrderBy("is_lock, task_nums, location_code").FirstAsync();
endlocation_ssx2 = await cyDb.Queryable<BasLocation>().Where(r => input.endlocations.Contains(r.id)).OrderBy("is_lock, task_nums, location_code").FirstAsync();
}
// 查找是否有一个料箱可以正好满足剩余需求数量(目前只做这个额外判断,其它情形不考虑)
@@ -803,9 +803,9 @@ namespace Tnb.WarehouseMgr
needOut -= _wmsCarryCode.codeqty;
WmsCarryH _wmsCarryH = itemsASC[j].wmsCarryH;
await cyDb.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
await cyDb.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx2.id == it.id).ExecuteCommandAsync();
carrysASC.Add(new Tuple<WmsCarryH, decimal, BasLocation>(_wmsCarryH, _wmsCarryCode.codeqty, endlocation_ssx));
carrysASC.Add(new Tuple<WmsCarryH, decimal, BasLocation>(_wmsCarryH, _wmsCarryCode.codeqty, endlocation_ssx2));
isFind = true;
break;
@@ -818,9 +818,9 @@ namespace Tnb.WarehouseMgr
// 目前只支持一个料箱只有一个物料
needOut -= wmsCarryCode.codeqty;
await cyDb.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
await cyDb.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx2.id == it.id).ExecuteCommandAsync();
carrysASC.Add(new Tuple<WmsCarryH, decimal, BasLocation>(wmsCarryH, wmsCarryCode.codeqty, endlocation_ssx));
carrysASC.Add(new Tuple<WmsCarryH, decimal, BasLocation>(wmsCarryH, wmsCarryCode.codeqty, endlocation_ssx2));
}
if (needOut > 0)