1
wankeda
2025-03-05 a0194deab4b4f19183f7b596bf5f9e3bb8a15ec9
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs
@@ -35,7 +35,7 @@
                {
                    return OutboundTaskCompleted(taskNum);
                }
                else if (task.TaskType.GetTaskTypeGroup() != TaskTypeGroup.RelocationGroup)
                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
                {
                    return RelocationTaskCompleted(task);
                }
@@ -69,7 +69,13 @@
                {
                    x.AGVArea = agvDescription;
                });
                string response = HttpHelper.Post("http://127.0.0.1:9281/api/Task/ReceiveTask", taskDTOs.Serialize());
                string url = AppSettings.Get("WCS");
                if (string.IsNullOrEmpty(url))
                {
                    throw new Exception($"未找到WCSAApi地址,请检查配置文件");
                }
                string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize());
                return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("返回错误");
            }
@@ -79,9 +85,30 @@
            }
        }
        //public WebResponseContent UpdateTaskInfo(WCSTaskDTO taskDTO)
        //{
        //}
        /// <summary>
        /// ä¿®æ”¹ä»»åŠ¡çŠ¶æ€
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        public WebResponseContent UpdateTaskInfo(WCSTaskDTO task)
        {
            try
            {
                Dt_Task wmsTask = BaseDal.QueryFirst(x=>x.TaskNum == task.TaskNum);
                if (wmsTask != null)
                {
                    wmsTask.TaskStatus = task.TaskState;
                    wmsTask.CurrentAddress = task.CurrentAddress;
                    wmsTask.NextAddress = task.NextAddress;
                    wmsTask.Dispatchertime = task.Dispatchertime;
                    BaseDal.UpdateData(wmsTask);
                }
                return WebResponseContent.Instance.OK();
            }
            catch(Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}