This commit is contained in:
qianjiawei
2023-12-21 09:46:21 +08:00
parent e8d9f9af81
commit 024c75356a
7 changed files with 318 additions and 39 deletions

View File

@@ -709,24 +709,23 @@ namespace Tnb.WarehouseMgr
if (sPoint != null && ePoint != null)
{
List<WmsPointH> points = new List<WmsPointH>();
try
if (sPoint.area_code != ePoint.area_code)
{
points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
if (points.Count <= 2)
{
throw new AppFriendlyException("该路径不存在", 500);
}
}
catch (Exception)
else
{
points.Add(sPoint);
points.Add(ePoint);
}
locIds.AddRange(points.Select(x => x.location_id).ToList()!);
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
if (points?.Count > 0)
{
if (points.Count < 2)
{
throw new AppFriendlyException("该路径不存在", 500);
}
List<WmsPretaskH> curPreTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
{