diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs index 6b2cf63a..a5d0e856 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs @@ -93,10 +93,19 @@ namespace Tnb.WarehouseMgr if (sPoint != null && ePoint != null) { - List points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); - if (points.Count <= 2) + List points = new List(); + if (sPoint.area_code != ePoint.area_code) { - throw new AppFriendlyException("该路径不存在", 500); + points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); + if (points.Count <= 2) + { + throw new AppFriendlyException("该路径不存在", 500); + } + } + else + { + points.Add(sPoint); + points.Add(ePoint); } //根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序) if (points?.Count > 0) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs index 64acaea5..044d02a9 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs @@ -198,7 +198,8 @@ namespace Tnb.WarehouseMgr } catch (Exception) { - return await Task.FromResult(false); + await _db.Ado.RollbackTranAsync(); + throw; } finally { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs index cc9bd7a3..a34f765c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs @@ -98,11 +98,19 @@ namespace Tnb.WarehouseMgr if (sPoint != null && ePoint != null) { - List? points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); - //根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序) - if (points?.Count <= 2) + List points = new List(); + if (sPoint.area_code != ePoint.area_code) { - throw new AppFriendlyException("该路径不存在", 500); + points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); + if (points.Count <= 2) + { + throw new AppFriendlyException("该路径不存在", 500); + } + } + else + { + points.Add(sPoint); + points.Add(ePoint); } if (points?.Count > 0) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs index 93af33c6..ab7bd955 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs @@ -79,14 +79,24 @@ namespace Tnb.WarehouseMgr if (sPoint != null && ePoint != null) { - List points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); - //根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序) - if (points?.Count > 0) + List points = new List(); + if (sPoint.area_code != ePoint.area_code) { + points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); if (points.Count <= 2) { throw new AppFriendlyException("该路径不存在", 500); } + } + else + { + points.Add(sPoint); + points.Add(ePoint); + } + //根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序) + if (points?.Count > 0) + { + List preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it => {