From f23e0326aa05a1c5b47d4aec4c06e73d0d86b8e7 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期二, 29 七月 2025 17:43:15 +0800 Subject: [PATCH] 代码提交 --- 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" index 149b7f2..1090389 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" @@ -17,9 +17,12 @@ 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; @@ -104,7 +107,8 @@ 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 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇 @@ -116,7 +120,6 @@ userTokenIds = tokenInfos.Select(x => x.Token_ID).ToList(); userIds = tokenInfos.Select(x => x.UserId).ToList(); } - #endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇 // 灏嗕氦浜掍俊鍙疯浆鎹负甯冨皵鏁扮粍 @@ -129,6 +132,7 @@ 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); @@ -161,8 +165,21 @@ 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) @@ -234,6 +251,7 @@ { Thread.Sleep(1000); _taskService.UpdateTaskStatusToNext(task); + } } } -- Gitblit v1.9.3