wangxinhui
2 天以前 a8756c3526832332db4ef5685348d9b188c2bf2b
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/×躸²Ö/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)