刘磊
5 天以前 5eeed44ad21748ed7560a8c688d4e2d2f03555c8
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/taskResult.cs
ÎļþÃû´Ó ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/agvCallback.cs ÐÞ¸Ä
@@ -21,7 +21,7 @@
        /// </summary>
        /// <param name="taskRespon"></param>
        /// <returns></returns>
        public WebResponseContent agvCallback(object taskRespon)
        public WebResponseContent taskResult(object taskRespon)
        {
            WebResponseContent content = new WebResponseContent();
            try
@@ -32,8 +32,11 @@
                    throw new Exception("AGV调用接口失败:无请求参数");
                }
                LogFactory.GetLog("AGV回调参数").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("AGV回调参数").Info(true, taskRespon.ToString());
                var task = _taskRepository.QueryFirst(x => x.AGVtaskId == taskResult.task_id);
                if (task == null) throw new Exception($"未知任务{taskResult.task_id}");
                if (task == null) throw new Exception($"未知任务:{taskResult.task_id}");
                if (taskResult.result.ToLower() == "task_execute")   //AGV开始执行
                {
@@ -45,15 +48,19 @@
                {
                    task.TaskState = (int)TaskStatusEnum.Completed;
                    //_taskRepository.
                    //_stockInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
                    _taskRepository.Update(task);
                    WebResponseContent responseContent = _taskService.CompleteAsync((int)task.TaskNum).Result;
                    if (!responseContent.Status)
                    {
                        throw new Exception(responseContent.Message);
                    }
                    //_taskRepository.Update(task);
                }
                return content.OK();
            }
            catch (Exception ex)
            {
                LogFactory.GetLog("AGV回调异常").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("AGV回调异常").Info(true, ex.Message);
                return content.Error($"AGV回调异常:{ex.Message}");
            }
        }