| | |
| | | using Quartz; |
| | | using Masuit.Tools; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ISystemServices; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_SignalR; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_Tasks.ElevatorJob; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | |
| | | [DisallowConcurrentExecution] |
| | | public partial class CommonElevatorJob : JobBase, IJob |
| | | { |
| | | public CommonElevatorJob() |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly ITask_HtyRepository _taskhtyRepository; |
| | | private readonly ITaskService _taskService; |
| | | private readonly IDt_StationManagerRepository _stationManagerRepository; |
| | | public CommonElevatorJob(ITaskRepository taskRepository, ITaskService taskService, IDt_StationManagerRepository stationManagerRepository, ITask_HtyRepository taskhtyRepository) |
| | | { |
| | | |
| | | _taskRepository = taskRepository; |
| | | _taskService = taskService; |
| | | _stationManagerRepository = stationManagerRepository; |
| | | _taskhtyRepository = taskhtyRepository; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | if(elevator != null) |
| | | { |
| | | //è·åæåæºå½å模å¼0-æå¨\æ
éãç»´æ¤æ¨¡å¼ï¼1-èªå¨æ¨¡å¼ |
| | | var x = elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.Model); |
| | | if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.Model) == 1) |
| | | { |
| | | var task = _taskService.QueryRequestTSJSignalTask(); |
| | | |
| | | |
| | | if (task != null && task.AGVSign == "RequestPickUp") |
| | | { |
| | | |
| | | if (task.TaskState == (int)TaskAcrossFloorStatusEnum.SecondCarry) |
| | | { |
| | | if (task.Floor == "1F") |
| | | { |
| | | if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.OneLayerAllowPickUp) == 1) |
| | | { |
| | | _taskService.ContinueAgvTask(task.AGVTaskNum); |
| | | task.AGVSign = ""; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.TwoLayerAllowPickUp) == 1) |
| | | { |
| | | _taskService.ContinueAgvTask(task.AGVTaskNum); |
| | | task.AGVSign = ""; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | if (task != null && task.AGVSign == "RequestPut") |
| | | { |
| | | if (task.TaskState == (int)TaskAcrossFloorStatusEnum.FirstCarry) |
| | | { |
| | | if (task.Floor == "1F") |
| | | { |
| | | if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.OneLayerAllowPut) == 1) |
| | | { |
| | | _taskService.ContinueAgvTask(task.AGVTaskNum); |
| | | task.AGVSign = ""; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.TwoLayerAllowPut) == 1) |
| | | { |
| | | _taskService.ContinueAgvTask(task.AGVTaskNum); |
| | | task.AGVSign = ""; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return Task.CompletedTask; |
| | | } |