helongyang
17 小时以前 06eb604f71605c47f015b88b1620b72b6f69df8c
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/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,7 @@
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.娴嬭瘯鏋朵粨;
namespace WIDESEAWCS_Tasks
{
@@ -36,13 +38,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 +55,7 @@
            _stationMangerRepository = stationMangerRepository;
            _cacheService = cacheService;
            _mapper = mapper;
            _webSocketServer = webSocketServer;
            string? apiInfoStr = _cacheService.Get("apiInfos");
            if (!string.IsNullOrEmpty(apiInfoStr))
@@ -101,6 +106,14 @@
                            }
                        }
                    }
                    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);
                    string cSJData = JsonConvert.SerializeObject(cSJReadData);
                    _webSocketServer.PublishAllClientPayload(cSJData);
                }
            }
            catch (Exception ex)