From cb25acc46bf41863e068b6f968f1592b7a14d1c9 Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期六, 13 九月 2025 08:12:14 +0800
Subject: [PATCH] 功能更新优化

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/阻焊仓/StackerCraneJob_ZH.cs |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/StackerCraneJob_ZH.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/StackerCraneJob_ZH.cs"
index 7f7aa5b..d5785a0 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/StackerCraneJob_ZH.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/StackerCraneJob_ZH.cs"
@@ -27,6 +27,8 @@
 using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_Core.Caches;
 using AutoMapper;
+using WIDESEAWCS_Tasks.闃荤剨浠�;
+using HslCommunication.WebSocket;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -35,14 +37,16 @@
     {
         private readonly ITaskService _taskService;
         private readonly ITaskExecuteDetailService _taskExecuteDetailService;
+        public static ZHReadData zHReadData = new ZHReadData();
         private readonly ITaskRepository _taskRepository;
         private readonly IRouterService _routerService;
         private readonly IStationMangerRepository _stationMangerRepository;
         private readonly ICacheService _cacheService;
         private readonly IMapper _mapper;
+        private WebSocketServer _webSocketServer;
         private List<Dt_ApiInfo> apiInfos;
 
-        public StackerCraneJob_ZH(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,ICacheService cacheService, IMapper mapper)
+        public StackerCraneJob_ZH(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,ICacheService cacheService, IMapper mapper, WebSocketServer webSocketServer)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -51,6 +55,7 @@
             _stationMangerRepository = stationMangerRepository;
             _cacheService = cacheService;
             _mapper = mapper;
+            _webSocketServer = webSocketServer;
             string? apiInfoStr = _cacheService.Get("apiInfos");
             if (!string.IsNullOrEmpty(apiInfoStr))
             {
@@ -100,6 +105,14 @@
                             }
                         }
                     }
+                    zHReadData.R_ZH_Status = ((short)commonStackerCrane.StackerCraneStatusValue);
+                    zHReadData.R_ZH_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue);
+                    zHReadData.R_ZH_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue);
+                    zHReadData.R_ZH_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt();
+                    zHReadData.R_ZH_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
+                    zHReadData.R_ZH_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType);
+                    string zHData = JsonConvert.SerializeObject(zHReadData);
+                    _webSocketServer.PublishAllClientPayload(zHData);
                 }
             }
             catch (Exception ex)

--
Gitblit v1.9.3