| | |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.Log; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.StackerHandTask; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Model.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | |
| | | private async Task RequestTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, Dt_StationManager stationManager) |
| | | { |
| | | try |
| | | { |
| | | var hasTask = await _taskRepository.QueryFirstAsync(x => x.SourceAddress == childDeviceCode && x.TaskState < (int)TaskInStatusEnum.RGV_InExecutingFinish && x.TaskState >= (int)TaskInStatusEnum.InNew); |
| | | if (hasTask != null) |
| | | { |
| | |
| | | }; |
| | | |
| | | _taskRepository.AddData(task); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | var log = $"ã{conveyorLine._deviceName}ãè¾é线ã{childDeviceCode}ãã{ex.Message}ã"; |
| | | ConsoleHelper.WriteWarningLine(log); |
| | | |
| | | await _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" }); |
| | | WriteInfo(conveyorLine.DeviceName, log); |
| | | } |
| | | |
| | | } |
| | | private void RequestWMSTask(CommonConveyorLine conveyorLine, Dt_StationManager stationManager) |
| | | { |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + requestTask; |
| | | var result = WIDESEA_Comm.Http.HttpHelper.PostAsync(wmsIpAddress, taskDTO.ToJsonString()).Result; |
| | | WriteLog.GetLog("WMSæ¥å£è¿åä¿¡æ¯").Write(JsonConvert.SerializeObject(result), "WMSæ¥å£è¿åä¿¡æ¯"); |
| | | } |
| | | } |
| | | else |
| | |
| | | var x = conveyorLine.Communicator.Read(devicePro.DeviceProAddress, 10); |
| | | |
| | | string Barcode = Encoding.UTF8.GetString(x); |
| | | |
| | | if (Barcode == null || Barcode == "" || Barcode.Trim().Contains("\0")) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, Convert.ToSByte(3), stationManager.stationChildCode); |
| | |
| | | var task = _taskRepository.QueryFirst(x => x.PalletCode == Barcode); |
| | | if (task != null) |
| | | { |
| | | |
| | | var log = $"ã{conveyorLine._deviceName}ãç«å°ã{stationManager.stationChildCode}ã请æ±åè´§ãå·²åå¨ä»»å¡ä»»å¡å·{task.TaskNum}"; |
| | | LogAndWarn(conveyorLine.DeviceName, log); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + requestTask; |
| | | var result = WIDESEA_Comm.Http.HttpHelper.PostAsync(wmsIpAddress, taskDTO.ToJsonString()).Result; |
| | | WriteLog.GetLog("WMSæ¥å£è¿åä¿¡æ¯").Write(JsonConvert.SerializeObject(result), "WMSæ¥å£è¿åä¿¡æ¯"); |
| | | } |
| | | } |
| | | } |