增加报错代码

This commit is contained in:
FanLian
2023-07-13 10:26:10 +08:00
parent 35df665c73
commit 5aed4189a4
3 changed files with 96 additions and 77 deletions

View File

@@ -87,10 +87,10 @@ namespace Tnb.WarehouseMgr
if (sPoint != null && ePoint != null)
{
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
if (points?.Count > 0)
else
{
if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
var preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
{
var sPoint = it.FirstOrDefault();
@@ -153,6 +153,10 @@ namespace Tnb.WarehouseMgr
}
}
else
{
throw new AppFriendlyException("起始库位不可用或无可用的目标库位",500);
}
await _db.Ado.CommitTranAsync();
}