刘磊
2024-12-17 58a5a9af83492c5bbb4fba88b4443f08fa4becfc
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -166,7 +166,7 @@
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(CommonConveyorLine_AfterJob) + ":" + ex.ToString());
                Console.Out.WriteLine(nameof(CommonConveyorLine_GWJob) + ":" + ex.ToString());
            }
            finally
            {
@@ -321,32 +321,32 @@
                    RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ")
                };
                    var MOMIpAddress = wmsBase + ipAddress;
                var MOMIpAddress = wmsBase + ipAddress;
                    var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.ToJsonString()).Result;
                    WriteInfo("入站校验", $"【{childDeviceCode}】入站校验请求参数【{trayCells.ToJsonString()}】");
                    WriteInfo("入站校验", "");
                    WriteInfo("入站校验", $"【{childDeviceCode}】入站校验返回参数【{result}】");
                    ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result);
                    if (result1.Success || task.Remark != "NG")
                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.ToJsonString()).Result;
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验请求参数【{trayCells.ToJsonString()}】");
                WriteInfo("入站校验", "");
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验返回参数【{result}】");
                ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result);
                if (result1.Success || task.Remark != "NG")
                {
                    Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                    if (newTask != null)
                    {
                        Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                        if (newTask != null)
                        {
                            ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                            conveyorLine.SendCommand(taskCommand, childDeviceCode);
                            conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                        }
                    }
                    else
                    {
                        ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                        taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
                        ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                        conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                        _taskService.UpdateTaskStatusToNext(task);
                    }
                }
                else
                {
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                    _taskService.UpdateTaskStatusToNext(task);
                }
            }
        }