diff --git a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs index a5044d16..9ba0ce75 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs @@ -90,7 +90,7 @@ namespace Tnb.WarehouseMgr .Select((a, b, c, d) => new WmsElevatorH { distask_id = c.id, - device_id = c.device_id, + device_id = a.elevator_id, }, true) .FirstAsync(); diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 5cc5d655..5e99d633 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -238,7 +238,7 @@ namespace Tnb.WarehouseMgr List elevatorList = await db.Queryable().InnerJoin((a, b) => a.id == b.bill_id) .Select((a, b) => new WmsElevatorH { - + bill_id = b.bill_id, location_id = b.location_id, location_code = b.location_code, @@ -248,7 +248,6 @@ namespace Tnb.WarehouseMgr }, true).ToListAsync(); - Logger.Information($"elevatorList:{JsonConvert.SerializeObject(elevatorList)}"); //获取所有未下发的预任务申请 List preTasks = await db.Queryable().InnerJoin((a, b) => a.startlocation_id == b.location_id && a.carry_id == b.id) @@ -409,15 +408,20 @@ namespace Tnb.WarehouseMgr { //呼梯操作 //获取目标库位为电梯库位的任务 - List<(string endlocation_code, string device_id, string id, string? start_floor)> endLocCodes = disTasks - .Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) && - !it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)) - .Select(it => (it.endlocation_code, it.device_id, it.id, it.start_floor)).ToList(); - if (endLocCodes?.Count > 0) + var eleTasks = disTasks.Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) && + !it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)) + .ToList(); + foreach (var et in eleTasks) { - - await CallingLanding(endLocCodes); + var ele = elevatorList.Find(x => x.location_code == et.endlocation_code); + if(ele!=null) + { + et.device_id = ele.elevator_id; + } } + List<(string endlocation_code, string device_id, string id, string? start_floor)> endLocCodes = eleTasks + .Select(it => (it.endlocation_code, it.device_id, it.id, it.start_floor)).ToList(); + //执行电梯任务 List? elevatorTasks = disTasks.Where(it => it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();