| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.ShuttleCarEnum; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Common.WMSInfo; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.WMSInfo; |
| | | using WIDESEAWCS_IShuttleCar; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public class CommonShuttleCarJob : IJob |
| | | public class CommonShuttleCarJob : JobBase, IJob |
| | | { |
| | | private readonly ITaskService _taskService; |
| | | private readonly IShuttleCarService _shuttleCarService; |
| | |
| | | ShuttleCar shuttleCar = (ShuttleCar)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (shuttleCar != null) |
| | | { |
| | | ShuttleCarTaskCommandR command = shuttleCar.ReadCustomer<ShuttleCarTaskCommandR>(shuttleCar.DeviceCode);//读åç©¿æ¢è½¦ä¿¡æ¯ |
| | | ShuttleCarTaskCommandR command = shuttleCar.Communicator.ReadCustomer<ShuttleCarTaskCommandR>(shuttleCar.DeviceCode);//读åç©¿æ¢è½¦ä¿¡æ¯ |
| | | if (command != null && command.JoinStatus == 1) |
| | | { |
| | | #region ç©¿æ¢è½¦ä»»å¡å®æ |
| | |
| | | { |
| | | #region åWMSç³è¯· |
| | | WebResponseContent content = new WebResponseContent(); |
| | | var ResultData = HttpHelper.PostAsync(WMSIP.GetPosition + $"?position={dt_Task.SourceAddress}", "", headers: new Dictionary<string, string>()); |
| | | var ResultData = HttpHelper.PostAsync(WMSInterfaceAddress.GetPosition + $"?position={dt_Task.SourceAddress}", "", headers: new Dictionary<string, string>()); |
| | | if (ResultData.Result != null) |
| | | { |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result); |
| | |
| | | ShuttleCar shuttleCar = Storage.Devices.FirstOrDefault(x => x.DeviceCode == task.ShuttleCarCode) as ShuttleCar; |
| | | if (shuttleCar != null) |
| | | { |
| | | ShuttleCarTaskCommandR command = shuttleCar.ReadCustomer<ShuttleCarTaskCommandR>(shuttleCar.DeviceCode);//读åç©¿æ¢è½¦ä¿¡æ¯ |
| | | ShuttleCarTaskCommandR command = shuttleCar.Communicator.ReadCustomer<ShuttleCarTaskCommandR>(shuttleCar.DeviceCode);//读åç©¿æ¢è½¦ä¿¡æ¯ |
| | | if (command != null && command.Status == (short)ShuttleCarStatus.Standby && command.TaskTypeComplete == (short)ShuttleCarTaskComplete.Standby && command.Err_Status == (short)ShuttleCarErr.Normal) |
| | | { |
| | | //ä»»å¡è½¬æ¢ |
| | |
| | | } |
| | | } |
| | | |
| | | ///éåºå
çµä»»å¡ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ |
| | | ///ä¸åéåºå
çµä»»å¡å¹¶çæç§»åºä»»å¡ |
| | | if (command.ElectricQuantity > 50) |
| | | { |
| | | |