From 5c639049becf22f931703235b72734b5711cc361 Mon Sep 17 00:00:00 2001 From: "yang.lee" Date: Thu, 23 Nov 2023 17:09:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=91=BC=E6=A2=AF=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr/DeviceProviderService.cs | 2 +- .../Tnb.WarehouseMgr/WareHouseService.cs | 22 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) 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();