diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs index 39d5ad2d..d7e250f7 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs @@ -71,8 +71,13 @@ namespace Tnb.WarehouseMgr carryOutPut.carryMats = await _db.Queryable().Where(it => it.carry_id == carryId).ToListAsync(); return carryOutPut; } - - + [HttpGet] + public async Task GetCarryInfoByCode([FromRoute] string carrycode) + { + var carryOutPut = await _db.Queryable().Where(it => it.carry_code == carrycode).FirstAsync(); + + return carryOutPut; + } /// /// 更换载具 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs index 9f5ff757..0579a3fd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs @@ -88,16 +88,22 @@ 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); + } - List preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it => + List preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it => { WmsPointH? sPoint = it.FirstOrDefault(); WmsPointH? ePoint = it.LastOrDefault(); @@ -167,8 +173,6 @@ namespace Tnb.WarehouseMgr //((int)EnumCarryStatus.寄存).ToString() } } - } - await _db.Ado.CommitTranAsync(); } catch (Exception) diff --git a/apihost/Tnb.API.Entry/Startup.cs b/apihost/Tnb.API.Entry/Startup.cs index d8ac9877..dd4c9ae1 100644 --- a/apihost/Tnb.API.Entry/Startup.cs +++ b/apihost/Tnb.API.Entry/Startup.cs @@ -63,7 +63,7 @@ public class Startup : AppStartup services.AddSingleton(sp => new TimedTaskBackgroundService()); //var bgSvc = App.GetRequiredService(); //bgSvc.StartAsync(CancellationToken.None); - services.AddHostedService(); + // services.AddHostedService(); }