生成预任务增加判断,如果起终库位相同则删除对应的预任务

This commit is contained in:
alex
2023-09-06 10:15:27 +08:00
parent 8411d57b6e
commit 6b847305f7
3 changed files with 16 additions and 9 deletions

View File

@@ -75,7 +75,7 @@ namespace Tnb.WarehouseMgr
_cacheManager = cacheManager;
}
/// <summary>
/// 根据载具Id带出库位、仓库信息
/// </summary>
@@ -519,7 +519,7 @@ namespace Tnb.WarehouseMgr
{
loc.is_use = ((int)EnumCarryStatus.).ToString();
}
locIts.Add(loc);
}
@@ -581,6 +581,11 @@ namespace Tnb.WarehouseMgr
/// <returns></returns>
public async Task<bool> GenPreTask(List<WmsPretaskH> preTasks, List<WmsPretaskCode> preTaskCodes)
{
//如果预任务出现起终库位相同,则删除对应预任务
if (preTasks.FindAll(it => it.startlocation_id == it.endlocation_id)?.Count > 0)
{
preTasks.RemoveAll(it => it.startlocation_id == it.endlocation_id);
}
var grpList = preTasks.OrderBy(o => o.bill_code).GroupBy(g => g.carry_id).ToList();
if (grpList?.Count > 0)
{