| | |
| | | 锘縰sing Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using Org.BouncyCastle.Tls; |
| | | using Quartz; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly List<Dt_WarehouseDevice> warehouseDevices; |
| | | private static object lockObj = 0;// |
| | | |
| | | public ConveyorLineJob_CPH(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension) |
| | | { |
| | |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | lock (lockObj) |
| | | { |
| | | if (lockObj.ToString()=="0") |
| | | { |
| | | lockObj = 1; |
| | | Task task = Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | while (true) |
| | | { |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null) |
| | | { |
| | |
| | | //{ |
| | | |
| | | //} |
| | | //鍐欏叆鎵ц鏁版嵁 |
| | | device.SetValue(W_CLineCPHDB.W_TaskNo, 1002, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Channel, 5, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Long, 400, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Wide, 370, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_High, 300, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_TMID, conveyorLineInfoRead.R_BoxCode, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Request, 1, item.StationCode); |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | Thread.Sleep(100); |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | lockObj = 0; |
| | | WriteError(nameof(ConveyorLineJob_CPH), $"閿欒淇℃伅锛歿ex.Message}"); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | } |