wanshenmean
12 小时以前 96adc295cb04fd135d63d3a907f2732274f90965
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -21,12 +21,14 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using MapsterMapper;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using Quartz;
using WIDESEAWCS_Common.Constants;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
@@ -63,11 +65,6 @@
                    List<Task> tasks = new List<Task>();
                    foreach (string childDeviceCode in childDeviceCodes)
                    {
                        int num = new Random().Next(1, 100);
                        if (num < 30)
                        {
                            throw new CommunicationException("错误测试", CommunicationErrorType.Unknown);
                        }
                        ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode);
                        if (command != null)
                        {
@@ -91,6 +88,8 @@
            }
            catch (Exception ex)
            {
                // 记录异常,避免错误被静默吞掉
                QuartzLogger.Error("CommonConveyorLineJob Execute 异常", "CommonConveyorLineJob", ex);
            }
            return Task.CompletedTask;
        }
@@ -149,7 +148,7 @@
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            if (task != null)
            {
                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, DeviceAddressConst.InteractiveSignalReset, childDeviceCode);
                WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                Console.Out.WriteLine(content.Serialize());
            }
@@ -206,10 +205,11 @@
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            if (task != null)
            {
                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, DeviceAddressConst.InteractiveSignalReset, childDeviceCode);
                WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                Console.Out.WriteLine(content.Serialize());
            }
        }
    }
}