From 291067c13bfe8fb9c876e3764a828dc3ddd22f99 Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期一, 17 十一月 2025 16:50:12 +0800
Subject: [PATCH] 监控优化,代码功能优化

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.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/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
index 63fb296..698bb33 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
@@ -1,4 +1,5 @@
 锘縰sing AutoMapper;
+using HslCommunication.WebSocket;
 using Microsoft.AspNetCore.Components.Routing;
 using Newtonsoft.Json;
 using Quartz;
@@ -27,6 +28,8 @@
 using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
 using WIDESEAWCS_Tasks.HoisterJob;
 using WIDESEAWCS_Tasks.StackerCraneJob;
+using WIDESEAWCS_Tasks.鏉挎潗浠�;
+using WIDESEAWCS_Tasks.娴嬭瘯鏋朵粨;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -36,13 +39,15 @@
         private readonly IMapper _mapper;
         private readonly ICacheService _cacheService;
         private readonly ITaskService _taskService;
+        public static CSJReadData cSJReadData = new CSJReadData();
         private readonly ITaskExecuteDetailService _taskExecuteDetailService;
         private readonly ITaskRepository _taskRepository;
         private readonly IRouterService _routerService;
         private readonly IStationMangerRepository _stationMangerRepository;
+        private WebSocketServer _webSocketServer;
         private List<Dt_ApiInfo> apiInfos;
 
-        public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper)
+        public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper, WebSocketServer webSocketServer)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -51,6 +56,7 @@
             _stationMangerRepository = stationMangerRepository;
             _cacheService = cacheService;
             _mapper = mapper;
+            _webSocketServer = webSocketServer;
 
             string? apiInfoStr = _cacheService.Get("apiInfos");
             if (!string.IsNullOrEmpty(apiInfoStr))
@@ -101,6 +107,15 @@
                             }
                         }
                     }
+                    cSJReadData.R_CSJ_Status = ((short)commonStackerCrane.StackerCraneStatusValue);
+                    cSJReadData.R_CSJ_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue);
+                    cSJReadData.R_CSJ_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue);
+                    cSJReadData.R_CSJ_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt();
+                    cSJReadData.R_CSJ_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
+                    cSJReadData.R_CSJ_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType);
+                    cSJReadData.R_CSJ_Column = commonStackerCrane.Communicator.Read<short>("DB11.42.0");
+                    string cSJData = JsonConvert.SerializeObject(cSJReadData);
+                    _webSocketServer.PublishAllClientPayload(cSJData);
                 }
             }
             catch (Exception ex)

--
Gitblit v1.9.3