Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -25,6 +25,7 @@
using Newtonsoft.Json;
using Quartz;
using SqlSugar;
using System.ComponentModel.Design;
using System.Reflection;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Common;
@@ -217,7 +218,10 @@
                        return;
                    }
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    SendCommand(taskCommand, conveyorLine, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                    _taskService.UpdateTaskStatusToNext(task);
                }
@@ -249,7 +253,10 @@
                if (newTask != null)
                {
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    SendCommand(taskCommand, conveyorLine, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                    _taskService.UpdateData(newTask);
                }
@@ -292,7 +299,10 @@
            if (task != null)
            {
                ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                conveyorLine.SendCommand(taskCommand, childDeviceCode);
                //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                SendCommand(taskCommand, conveyorLine, childDeviceCode);
                conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                _taskService.UpdateTaskStatusToNext(task);
@@ -346,7 +356,10 @@
                    if (newTask != null)
                    {
                        ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                        conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        SendCommand(taskCommand, conveyorLine, childDeviceCode);
                        conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                        _taskService.UpdateData(newTask);
                    }
@@ -355,7 +368,10 @@
                {
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    SendCommand(taskCommand, conveyorLine, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                    _taskService.UpdateTaskStatusToNext(task);
                }
@@ -404,7 +420,8 @@
                    }
                }
                conveyorLine.SendCommand(taskCommand, childDeviceCode);
                //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                SendCommand(taskCommand, conveyorLine, childDeviceCode);
                conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                content = _taskService.UpdateTaskStatusToNext(task);
            }
@@ -437,7 +454,8 @@
                        }
                    }
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    SendCommand(taskCommand, conveyorLine, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                    taskNext.ExceptionMessage = log;
@@ -524,6 +542,15 @@
            }
            return content;
        }
        public void SendCommand(ConveyorLineTaskCommand_After taskCommand, CommonConveyorLine_GW conveyorLine, string childDeviceCode)
        {
            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, taskCommand.ConveyorLineTargetAddress, childDeviceCode);
            Thread.Sleep(100);
            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, taskCommand.ConveyorLineBarcode, childDeviceCode);
            Thread.Sleep(100);
            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, taskCommand.ConveyorLineTaskNum, childDeviceCode);
        }
    }
}