From 08961862954d395e7eda3d7bf9747ec581bcca04 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 10 Oct 2023 16:03:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=BC=E6=A2=AF=E6=97=B6=EF=BC=8C=E5=88=B0?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=9B=AE=E6=A0=87=E6=A5=BC=E5=B1=82=EF=BC=8C?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BB=BB=E5=8A=A1=E7=9A=84start=5Ffloor?= =?UTF-8?q?=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs | 2 +- WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs | 4 ++-- WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs | 6 +++--- WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs index f0e7460f..cb09d3f8 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs @@ -71,6 +71,6 @@ namespace Tnb.WarehouseMgr.Interfaces /// /// /// Task TaskExecuteAfter(TaskExecuteAfterUpInput input); - Func AddUnExecuteTask { get; set; } + Func AddUnExecuteTask { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs index 9e818faa..bcb8303d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs @@ -258,7 +258,7 @@ namespace Tnb.WarehouseMgr elevatorQueueItem = await _db.Queryable().FirstAsync(it => disTasks.Select(x => x.id).Contains(it.distask_id) && it.task_status == "待执行"); if (!elevatorQueueItem?.elevator_code.IsNullOrEmpty() ?? false) { - await (_wareHouseService.AddUnExecuteTask?.Invoke(elevatorQueueItem?.elevator_code!) ?? Task.CompletedTask); + await (_wareHouseService.AddUnExecuteTask?.Invoke(elevatorQueueItem?.elevator_code!, disTask.start_floor.ParseToInt()) ?? Task.CompletedTask); } } } @@ -272,7 +272,7 @@ namespace Tnb.WarehouseMgr disTaskIds = disTasks.Select(x => x.id).ToList() }; await _wareHouseService.TaskComplate(taskCompleUpInput); - + } } catch (Exception ex) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs index 81cde8fb..89fd7d80 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs @@ -33,10 +33,10 @@ namespace Tnb.WarehouseMgr private static Dictionary> _fetchStartedStausValue = new(); private bool isFrontDoorBit = false; //是否到前门位 - public ElevatorControlService(BackgroundService agvHeartbeatMonitorService) + public ElevatorControlService() { _elevatorCtlCfg = App.Configuration.Build(); - _agvHeartbeatMonitor = agvHeartbeatMonitorService; + //_agvHeartbeatMonitor = agvHeartbeatMonitorService; } /// @@ -107,7 +107,7 @@ namespace Tnb.WarehouseMgr public async Task ThreeFloorElevatorFlow() { //test by close door - _agvHeartbeatMonitor.StartAsync(CancellationToken.None); + //_agvHeartbeatMonitor.StartAsync(CancellationToken.None); //await SendOpenCloseCmd(4); //await SetAgvControlStatus(1); //监听电梯门是否为关闭的状态 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 6ff7bf66..a5449e30 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -49,7 +49,7 @@ namespace Tnb.WarehouseMgr private readonly IElevatorControlService _elevatorControlService; private static Dictionary _elevatorMap = new Dictionary(); private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build(); - public Func AddUnExecuteTask { get; set; } + public Func AddUnExecuteTask { get; set; } public WareHouseService(ISqlSugarRepository repository, IDictionaryDataService dictionaryDataService, IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService) @@ -60,9 +60,9 @@ namespace Tnb.WarehouseMgr _userManager = userManager; _cacheManager = cacheManager; _elevatorControlService = elevatorControlService; - AddUnExecuteTask = async code => + AddUnExecuteTask = async (code, floor) => { - await _elevatorControlService.CallLift(code, 5, CancellationToken.None); + await _elevatorControlService.CallLift(code, floor, CancellationToken.None); }; } @@ -415,7 +415,7 @@ namespace Tnb.WarehouseMgr if ((elevatorQueue.IsNull() || elevatorQueue.Count < 1)) { elevatorQueueItem.task_status = "执行中"; - await _elevatorControlService.CallLift(devName, 5, CancellationToken.None); + await _elevatorControlService.CallLift(devName, floorNO.ParseToInt(), CancellationToken.None); }