| | |
| | | |
| | | using AutoMapper; |
| | | using HslCommunication; |
| | | using HslCommunication.Profinet.OpenProtocol; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Web; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | |
| | | try |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(station.stationChildCode); |
| | | //var Barcode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.ConveyorLineBarcode, station.stationChildCode); |
| | | var Barcodea = conveyorLine.Communicator.Read("DB1103.2",5); |
| | | string x=Encoding.UTF8.GetString(Barcodea); |
| | | if (command != null) |
| | | { |
| | | #region è°ç¨äºä»¶æ»çº¿éç¥å端 |
| | |
| | | userTokenIds = tokenInfos.Select(x => x.Token_ID).ToList(); |
| | | userIds = tokenInfos.Select(x => x.UserId).ToList(); |
| | | } |
| | | |
| | | #endregion è°ç¨äºä»¶æ»çº¿éç¥å端 |
| | | |
| | | // å°äº¤äºä¿¡å·è½¬æ¢ä¸ºå¸å°æ°ç» |
| | |
| | | foreach (var item in deviceProtocolDetails) |
| | | { |
| | | int itemValue = Convert.ToInt32(item.ProtocalDetailValue); |
| | | _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { station.stationChildCode,InStock= structs[itemValue] , Roadway =station.Roadway}); |
| | | if (structs[itemValue] == true) |
| | | { |
| | | MethodInfo? method = GetType().GetMethod(item.ProtocolDetailType); |
| | |
| | | var log = $"ã{conveyorLine._deviceName}ãç«å°ã{station.stationChildCode}ã请æ±åè´§"; |
| | | await LogAndWarn(conveyorLine.DeviceName, log); |
| | | |
| | | var task = _taskService.QueryConveyorLineTask(station.stationChildCode, command.TaskNum); |
| | | if (station.stationChildCode == "3004") |
| | | { |
| | | var taskIn = _taskRepository.QueryFirst(x => x.TaskNum == command.TaskNum && x.NextAddress == station.stationChildCode && x.TaskType == (int)TaskInboundTypeEnum.Inbound&&x.TaskState==(int)TaskInStatusEnum.HoistInExecuting); |
| | | if(taskIn != null) |
| | | { |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.Roadway == taskIn.Roadway && x.stationType == 3 && x.stationFloor == taskIn.Floor); |
| | | taskIn.CurrentAddress = station.stationChildCode; |
| | | taskIn.NextAddress = stationManager.stationChildCode; |
| | | taskIn.TaskState = (int)TaskInStatusEnum.InNew; |
| | | _taskRepository.UpdateData(taskIn); |
| | | } |
| | | } |
| | | |
| | | var task = _taskService.QueryConveyorLineTask(station.stationChildCode, command.TaskNum); |
| | | |
| | | await HandleNewTaskAsync(conveyorLine, command, station.stationChildCode, task); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | Thread.Sleep(1000); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | |
| | | } |
| | | } |
| | | } |