huanghongfeng
3 天以前 5ffc36a1db18d3112a9b50a9cf3953d7fcf21bae
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -24,6 +24,7 @@
using Newtonsoft.Json;
using Quartz;
using SqlSugar;
using System.Net;
using System.Reflection;
using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoRepository;
@@ -43,6 +44,7 @@
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_SignalR;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
namespace WIDESEAWCS_Tasks
@@ -295,9 +297,15 @@
                conveyorLine.SetValue(ConveyorLineDBName.WheelsDiameter, task.wheels_gkcc, stationInfo.stationChildCode);
                conveyorLine.SetValue(ConveyorLineDBName.WheelsLX, task.WheelsLX, stationInfo.stationChildCode);
                conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
                _taskService.UpdatePosition(task.TaskNum, stationInfo.stationChildCode);
                Dt_Task dt_Task = _taskService.UpdatePosition(task.TaskNum, stationInfo.stationChildCode);
                if (dt_Task != null)
                {
                    conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
                }
                else
                {
                    conveyorLine.SetValue(ConveyorLineDBName.ResponState, 3, stationInfo.stationChildCode);
                }
            }
        }
@@ -341,19 +349,29 @@
            var task = _taskService.QueryExecutingTaskByBarcode(command.Number, stationInfo.stationChildCode);
            if (task != null)
            {
                //根据车轴缓存位置 å†™å…¥å¯¹åº”目标地址
                if (task.TargetAddress == stationInfo.stationChildCode)
                if (task.TargetAddress == "2032" || task.TargetAddress == "2042")
                {
                    //WebResponseContent content = _taskService.RequestWheelsFlow(task.task_CZInfo).Result;
                    bool k1 = conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
                    bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode);
                    bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
                    WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task);
                    Console.Out.WriteLine($"读取到输送线申请,申请条码:{command.Number},反馈至输送线信息====起始地址:{k1},目标地址“{k2},反馈信号:{k3},任务修改状态:{k4.Status}))");
                }
                else
                {
                    WebResponseContent content = _taskService.RequestWheelsFlow(task.PalletCode).Result;
                    if (content.Status)
                    {
                        string taraddress = content.Data.ToString(); // "2032";SourceAddress
                        bool k1 = conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
                        bool k2= conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taraddress, stationInfo.stationChildCode);
                        bool k3= conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
                        bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode);
                        bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
                        WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task);
                        Console.Out.WriteLine($"读取到输送线申请,申请条码:{command.Number},反馈至输送线信息====起始地址:{k1},目标地址“{k2},反馈信号:{k3},任务修改状态:{k4.Status}))");
@@ -365,22 +383,28 @@
                        Console.Out.WriteLine($"读取到输送线申请,申请条码:{command.Number},向WMS申请去向失败,原因:{content.Message},写入申诉信故障:2");
                    }
                }
                else
                {
                    bool k1= conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
                    bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode);
                    bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
                    WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task);
                    Console.Out.WriteLine($"读取到输送线申请,申请条码:{command.Number},反馈至输送线信息====起始地址:{k1},目标地址“{k2},反馈信号:{k3},任务修改状态:{k4.Status}))");
                }
            }
            else
            {
                conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode);
                Console.Out.WriteLine($"读取到输送线申请,申请条码:{command.Number},未找到,写入申诉信故障:2");
                string taraddresspos = _taskService.RequestWheletHty(command.Number);
                if (taraddresspos != null)
                {
                    bool k1 = conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
                    bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taraddresspos, stationInfo.stationChildCode);
                    bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
                    Console.Out.WriteLine($"历史查询信息,,申请条码:{command.Number},反馈至输送线信息====起始地址:{k1},目标地址“{k2},反馈信号:{k3},写入目标地址为:{taraddresspos})");
                }
                else
                {
                    conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode);
                    Console.Out.WriteLine($"读取到输送线申请,申请条码:{command.Number},未找到任务,申请下一地址为:{stationInfo.stationChildCode},写入申诉信故障:2");
                }
            }
            //_taskService.UpdatePosition(task.TaskNum, stationInfo.stationChildCode);
        }
        #region è½¦è½´çº¿äº¤äº’
@@ -397,7 +421,7 @@
            if (content.Status)
            {
                conveyorLine.SetValue(ConveyorLineDBName.Number, content.Data.ToString(), stationInfo.stationChildCode);
                conveyorLine.SetValue(ConveyorLineDBName.CarType,"001", stationInfo.stationChildCode);
                conveyorLine.SetValue(ConveyorLineDBName.CarType, "001", stationInfo.stationChildCode);
                conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
            }
            else
@@ -415,7 +439,6 @@
        /// <param name="ProtocalDetailValue">线体当前bool读取偏移地址</param>
        public void RequestTakeCZ(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, Dt_StationManager stationInfo)
        {
            WebResponseContent content = _taskService.UpdateAxleCurrentStatue(command.Number);
            if (content.Status)
            {
@@ -442,7 +465,7 @@
        {
            DeviceProDTO? deviceProDTOt = conveyorLine.DeviceProDTOs.Find(x => x.DeviceChildCode == "3022" && x.DeviceProParamName == "Number");
            string Number = conveyorLine.Communicator.Read<string>(deviceProDTOt.DeviceProAddress);
            if (Number != "" && Number!=null)
            if (Number != "" && Number != null)
            {
                //调取wms接口申请agv任务
                WebResponseContent content = _taskService.GetAGVTaskdistribution(stationInfo.stationLocation);