1
huangxiaoqiang
5 天以前 bafe1d72065cef96afe6f03e103e9ca662185ae0
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -21,6 +21,8 @@
using Newtonsoft.Json;
using Quartz;
using System.Reflection;
using System.Text;
using System.Web;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
@@ -105,7 +107,6 @@
            try
            {
                ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(station.stationChildCode);
                //var Barcode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.ConveyorLineBarcode, station.stationChildCode);
                if (command != null)
                {
                    #region è°ƒç”¨äº‹ä»¶æ€»çº¿é€šçŸ¥å‰ç«¯
@@ -129,7 +130,7 @@
                        foreach (var item in deviceProtocolDetails)
                        {
                            int itemValue = Convert.ToInt32(item.ProtocalDetailValue);
                            _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { station.stationChildCode,InStock= structs[itemValue] , Roadway =station.Roadway});
                            _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { station.stationChildCode, InStock = structs[itemValue], Roadway = station.Roadway + station.stationFloor });
                            if (structs[itemValue] == true)
                            {
                                MethodInfo? method = GetType().GetMethod(item.ProtocolDetailType);
@@ -162,6 +163,19 @@
                var log = $"【{conveyorLine._deviceName}】站台【{station.stationChildCode}】请求取货";
                await LogAndWarn(conveyorLine.DeviceName, log);
                if (station.stationChildCode == "3004")
                {
                    var taskIn = _taskRepository.QueryFirst(x => x.TaskNum == command.TaskNum && x.NextAddress == station.stationChildCode && x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState == (int)TaskInStatusEnum.HoistInExecuting);
                    if (taskIn != null)
                    {
                        Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.Roadway == taskIn.Roadway && x.stationType == 3 && x.stationFloor == taskIn.Floor);
                        taskIn.CurrentAddress = station.stationChildCode;
                        taskIn.NextAddress = stationManager.stationChildCode;
                        taskIn.TaskState = (int)TaskInStatusEnum.InNew;
                        _taskRepository.UpdateData(taskIn);
                    }
                }
                var task = _taskService.QueryConveyorLineTask(station.stationChildCode, command.TaskNum);
                await HandleNewTaskAsync(conveyorLine, command, station.stationChildCode, task);
@@ -189,7 +203,7 @@
                var task = _taskService.QueryConveyorLineFinishTask(stationManager.stationChildCode, command.TaskNum);
                //改查询方法
                if(stationManager.stationType==5||stationManager.stationType==4)
                if (stationManager.stationType == 5 || stationManager.stationType == 4)
                {
                    // å¦‚果任务存在
                    if (task != null)
@@ -235,7 +249,7 @@
                {
                    Thread.Sleep(1000);
                    _taskService.UpdateTaskStatusToNext(task);
                }
            }
        }