From 06eb604f71605c47f015b88b1620b72b6f69df8c Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期一, 22 九月 2025 05:20:41 +0800
Subject: [PATCH] 功能增加,代码优化

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
index 5574504..6e7ce35 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
@@ -31,6 +31,9 @@
 using Autofac.Core;
 using WIDESEAWCS_DTO.TaskInfo;
 using AutoMapper;
+using WIDESEAWCS_Tasks.鏉挎潗浠�;
+using HslCommunication.WebSocket;
+using WIDESEAWCS_Tasks.娴嬭瘯鏋朵粨;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -45,10 +48,12 @@
         private readonly IRouterService _routerService;
         private readonly IStationMangerRepository _stationMangerRepository;
         private readonly IRouterRepository _routerRepository;
+        public static BCReadData bCReadData = new BCReadData();
         private List<Dt_ApiInfo> apiInfos;
         private readonly List<Dt_WarehouseDevice> warehouseDevices;
+        private WebSocketServer _webSocketServer;
 
-        public StackerCraneJob_BC(IMapper mapper, ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository)
+        public StackerCraneJob_BC(IMapper mapper, ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository,WebSocketServer webSocketServer)
         {
             _mapper = mapper;
             _taskService = taskService;
@@ -58,6 +63,7 @@
             _stationMangerRepository = stationMangerRepository;
             _cacheService = cacheService;
             _routerRepository = routerRepository;
+            _webSocketServer = webSocketServer;
 
             string? apiInfoStr = _cacheService.Get("apiInfos");
             if (!string.IsNullOrEmpty(apiInfoStr))
@@ -127,6 +133,14 @@
                             }
                         }
                     }
+                    bCReadData.R_BC_Status = ((short)commonStackerCrane.StackerCraneStatusValue);
+                    bCReadData.R_BC_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue);
+                    bCReadData.R_BC_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue);
+                    bCReadData.R_BC_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt();
+                    bCReadData.R_BC_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
+                    bCReadData.R_BC_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType);
+                    string bCData = JsonConvert.SerializeObject(bCReadData);
+                    _webSocketServer.PublishAllClientPayload(bCData);
                 }
             }
             catch (Exception ex)

--
Gitblit v1.9.3