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/PP仓/StackerCraneJob_PP.cs | 30 +++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 1 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" index 84563b0..061d640 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" @@ -28,6 +28,9 @@ using WIDESEAWCS_DTO.TaskInfo; using WIDESEAWCS_Core.Caches; using AutoMapper; +using WIDESEAWCS_Tasks.PP浠�; +using HslCommunication.WebSocket; +using WIDESEAWCS_Tasks.骞茶啘浠�; namespace WIDESEAWCS_Tasks { @@ -39,11 +42,13 @@ private readonly ITaskService _taskService; private readonly ITaskExecuteDetailService _taskExecuteDetailService; private readonly ITaskRepository _taskRepository; + public static PPReadData pPReadData = new PPReadData(); private readonly IRouterService _routerService; private readonly IStationMangerRepository _stationMangerRepository; private List<Dt_ApiInfo> apiInfos; + private WebSocketServer _webSocketServer; - public StackerCraneJob_PP(IMapper mapper, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, ICacheService cacheService) + public StackerCraneJob_PP(IMapper mapper, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, ICacheService cacheService,WebSocketServer webSocketServer) { _taskService = taskService; _taskExecuteDetailService = taskExecuteDetailService; @@ -52,6 +57,21 @@ _stationMangerRepository = stationMangerRepository; _cacheService = cacheService; _mapper=mapper; + _webSocketServer = webSocketServer; + + string? apiInfoStr = _cacheService.Get("apiInfos"); + if (!string.IsNullOrEmpty(apiInfoStr)) + { + List<Dt_ApiInfo>? infos = JsonConvert.DeserializeObject<List<Dt_ApiInfo>>(apiInfoStr); + if (infos == null || infos.Count == 0) + { + apiInfos = new List<Dt_ApiInfo>(); + } + else + { + apiInfos = infos; + } + } } public Task Execute(IJobExecutionContext context) @@ -89,6 +109,14 @@ } } } + pPReadData.R_PP_Status = ((short)commonStackerCrane.StackerCraneStatusValue); + pPReadData.R_PP_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); + pPReadData.R_PP_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); + pPReadData.R_PP_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); + pPReadData.R_PP_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); + pPReadData.R_PP_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); + string pPData = JsonConvert.SerializeObject(pPReadData); + _webSocketServer.PublishAllClientPayload(pPData); } } catch (Exception ex) -- Gitblit v1.9.3