Admin
2026-03-26 dea22f4759b5c8a4f79a3e93e5af1741f5e00ae4
ÏîÄ¿´úÂë/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -1,6 +1,6 @@
/*#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
*//*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_Tasks.ConveyorLineJob
----------------------------------------------------------------
 *命名空间:WIDESEAWCS_Tasks.ConveyorLineJob
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š2024/8/2 16:13:36
 * ç‰ˆæœ¬ï¼šV1.0.0
@@ -12,8 +12,8 @@
 * ç‰ˆæœ¬ï¼šV1.0.1
 * ä¿®æ”¹è¯´æ˜Žï¼š
 * 
 *----------------------------------------------------------------*//*
#endregion << ç‰ˆ æœ¬ æ³¨ é‡Š >>
 *----------------------------------------------------------------
#endregion << ç‰ˆ æœ¬ æ³¨ é‡Š >>*/
using AutoMapper;
using Newtonsoft.Json;
@@ -36,8 +36,10 @@
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Model.Models.System;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.DTO;
@@ -56,19 +58,63 @@
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly IRouterService _routerService;
        private readonly IMapper _mapper;
        private readonly IDt_PlatformStationService _PlatformStationService;
        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper)
        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, IDt_PlatformStationService dt_PlatformStation)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _routerService = routerService;
            _mapper = mapper;
            _PlatformStationService = dt_PlatformStation;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams");
                if (conveyorLine != null)
                {
                    /*List<Dt_PlatformStation> childDeviceCodes = _PlatformStationService.getStatiomList(conveyorLine.DeviceCode);
                    foreach (Dt_PlatformStation childDeviceCode in childDeviceCodes)
                    {
                        ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode.Station_code);
                        if (command != null)
                        {
                            DeviceProtocolDetailDTO? deviceProtocolDetail = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.ProtocalDetailValue == command.InteractiveSignal.ToString() && x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal));
                            if (deviceProtocolDetail != null)
                            {
                                MethodInfo? method = GetType().GetMethod(deviceProtocolDetail.ProtocolDetailType);
                                if (method != null)
                                {
                                    method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode });
                                }
                                else
                                {
                                    //todo æœªæ‰¾åˆ°æ–¹æ³•æ—¶
                                }
                            }
                        }
                        //});
                        //tasks.Add(task);
                    }*/
                }
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(CommonConveyorLineJob) + ":" + ex.ToString());
            }
            /*finally
            {
                Console.Out.WriteLine(DateTime.Now);
            }*/
            return Task.CompletedTask;
        }
    }
}
*/