From 3799054e5cd8a42a49cc902cc9d9cb46059b3a7d Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期日, 14 九月 2025 10:54:54 +0800 Subject: [PATCH] 添加WebSocket将设备运行信息推送到前端,前端将数据接收赋值到对应设备监控页面 --- 项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPH.cs | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPH.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPH.cs" index 742eb6b..d134c26 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPH.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPH.cs" @@ -1,5 +1,6 @@ 锘縰sing Microsoft.AspNetCore.Components.Routing; using Newtonsoft.Json; +using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; using Quartz; using SqlSugar.Extensions; using System; @@ -80,12 +81,13 @@ //鐮佸灈鐜嚎璇锋眰浠诲姟 if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request==1) { - WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode); - //鍚慦MS璇锋眰浠诲姟 - if (true) - { + //WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode); + ////鍚慦MS璇锋眰浠诲姟 + //if (true) + //{ - } + //} + } } else if(item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null) @@ -94,16 +96,14 @@ //鑾峰彇鐮佸灈鍙d换鍔℃洿鏂颁换鍔$姸鎬� if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0) { - - } - } - else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && deviceProRead != null) - { - R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress); - //鐮佸灈鐜嚎鎺掑嚭鍙h姹傚彇娑堜换鍔� - if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0 && conveyorLineInfoRead.R_Request == 2) - { - + Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.R_TaskNo && x.NextAddress==item.StationCode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); + if (task != null) + { + task.CurrentAddress = item.StationCode; + task.NextAddress = task.TargetAddress; + task.DeviceCode = item.StackerCraneCode; + _taskService.UpdateTask(task, TaskStatusEnum.MD_Executing); + } } } else -- Gitblit v1.9.3