From a8756c3526832332db4ef5685348d9b188c2bf2b Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期六, 13 九月 2025 08:36:44 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/StackerCraneJob_GM.cs |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs"
index 0536b05..bdc3052 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs"
@@ -28,6 +28,8 @@
 using WIDESEAWCS_QuartzJob.Repository;
 using WIDESEAWCS_DTO.TaskInfo;
 using AutoMapper;
+using HslCommunication.WebSocket;
+using WIDESEAWCS_Tasks.骞茶啘浠�;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -38,13 +40,15 @@
         private readonly ITaskService _taskService;
         private readonly ITaskExecuteDetailService _taskExecuteDetailService;
         private readonly ITaskRepository _taskRepository;
+        public static GMReadData gMReadData = new GMReadData();
         private readonly IRouterService _routerService;
         private readonly IStationMangerRepository _stationMangerRepository;
         private readonly IRouterRepository _routerRepository;
         private readonly IMapper _mapper;
         private List<Dt_ApiInfo> apiInfos;
+        private WebSocketServer _webSocketServer;
 
-        public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IMapper mapper)
+        public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IMapper mapper,WebSocketServer webSocketServer)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -54,6 +58,7 @@
             _cacheService = cacheService;
             _routerRepository = routerRepository;
             _mapper = mapper;
+            _webSocketServer = webSocketServer;
 
             string? apiInfoStr = _cacheService.Get("apiInfos");
             if (!string.IsNullOrEmpty(apiInfoStr))
@@ -111,6 +116,14 @@
                             }
                         }
                     }
+                    gMReadData.R_GM_Status = ((short)commonStackerCrane.StackerCraneStatusValue);
+                    gMReadData.R_GM_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue);
+                    gMReadData.R_GM_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue);
+                    gMReadData.R_GM_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt();
+                    gMReadData.R_GM_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
+                    gMReadData.R_GM_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType);
+                    string gMData = JsonConvert.SerializeObject(gMReadData);
+                    _webSocketServer.PublishAllClientPayload(gMData);
                 }
             }
             catch (Exception ex)
@@ -295,6 +308,8 @@
                     }
                     else if (existTask != null && existTask.TaskState != (int)TaskStatusEnum.SC_Execute)
                     {
+                        WriteError(commonStackerCrane.DeviceCode, $"浠诲姟{task.TaskNum}娴呰揣浣嶄换鍔existTask.TaskNum}浠诲姟鐘舵�佷笉涓哄爢鍨涘緟鎵ц");
+                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"浠诲姟{task.TaskNum}娴呰揣浣嶄换鍔existTask.TaskNum}浠诲姟鐘舵�佷笉涓哄爢鍨涘緟鎵ц");
                         return null;
                     }
                     else

--
Gitblit v1.9.3