From 7086c88c6c080aa9ff15664c5c97aee7bbcdc55b Mon Sep 17 00:00:00 2001 From: wankeda <Administrator@DESKTOP-HAU3ST3> Date: 星期三, 05 三月 2025 16:56:11 +0800 Subject: [PATCH] 阻焊仓堆垛机对接 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs | 39 +++++++++++++++++++++++++++++++++------ 1 files changed, 33 insertions(+), 6 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs" index 54f6266..808efce 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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($"鏈壘鍒癢CSAApi鍦板潃,璇锋鏌ラ厤缃枃浠�"); + } + 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); + } + } } } -- Gitblit v1.9.3