From 01ba2e2affa33320ef8aca6e033248388bb8f60e Mon Sep 17 00:00:00 2001
From: 肖洋 <cathay_xy@163.com>
Date: 星期二, 10 十二月 2024 11:04:41 +0800
Subject: [PATCH] 高温出库修改

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
index 7aad880..3d35a4a 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -10,7 +10,9 @@
 using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Core;
+using WIDESEAWCS_Core.Caches;
 using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.HttpContextUser;
 using WIDESEAWCS_DTO.MOM;
 using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_IProcessRepository;
@@ -22,8 +24,10 @@
 using WIDESEAWCS_QuartzJob.DeviceBase;
 using WIDESEAWCS_QuartzJob.DTO;
 using WIDESEAWCS_QuartzJob.Service;
+using WIDESEAWCS_SignalR;
 using WIDESEAWCS_Tasks.ConveyorLineJob;
 using static System.Collections.Specialized.BitVector32;
+using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -39,8 +43,10 @@
         private readonly IMapper _mapper;
         private readonly IDt_StationManagerService _stationManagerService;
         private readonly IDt_StationManagerRepository _stationManagerRepository;
+        private readonly ICacheService _cacheService;
+        private readonly INoticeService _noticeService;
 
-        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository)
+        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -51,6 +57,8 @@
             _sys_ConfigService = sys_ConfigService;
             _stationManagerService = stationManagerService;
             _stationManagerRepository = stationManagerRepository;
+            _cacheService = cacheService;
+            _noticeService = noticeService;
         }
 
         public async Task Execute(IJobExecutionContext context)
@@ -165,6 +173,27 @@
                         }
                     }
                 }
+
+
+                #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
+
+                var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
+                if (tokenInfos == null || !tokenInfos.Any())
+                {
+                    //throw new Exception(conveyorLine.DeviceName + "缂撳瓨涓湭鎵惧埌Token缂撳瓨");
+                    return;
+                }
+                var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
+                var userIds = tokenInfos?.Select(x => x.UserId).ToList();
+
+                object obj = new
+                {
+                    command,
+                    commandWrite
+                };
+                _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
+
+                #endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
             }
         }
 

--
Gitblit v1.9.3