From a15d996584733d60d0adddcd791f029d608c4fae Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 03 十一月 2024 09:57:56 +0800
Subject: [PATCH] 2222

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   65 ++++++++++++++++++++++++--------
 1 files changed, 49 insertions(+), 16 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
index 1cdc30a..20a3264 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -132,8 +132,8 @@
             try
             {
                 #region 鐪熷疄鏁版嵁
-
-                // 鍒涘缓璇锋眰瀵硅薄
+                // TODO: 璋冪敤鎺ュ彛鑾峰彇涓嬩竴涓湴鍧�
+                //// 鍒涘缓璇锋眰瀵硅薄
                 //RequestTaskDto request = new RequestTaskDto()
                 //{
                 //    Position = sourceAddress,
@@ -401,6 +401,34 @@
                         task.CurrentAddress = task.NextAddress;
                         task.NextAddress = $"{random.Next(1, 1).ToString().PadLeft(3, '0')}-{random.Next(1, 1).ToString().PadLeft(3, '0')}-{random.Next(1, 1).ToString().PadLeft(3, '0')}";
                         task.TargetAddress = task.NextAddress;
+
+                        #region 鐪熷疄鏁版嵁
+                        // TODO: 璋冪敤鎺ュ彛鑾峰彇涓嬩竴涓湴鍧�
+                        //// 鍒涘缓璇锋眰瀵硅薄
+                        //RequestTaskDto request = new RequestTaskDto()
+                        //{
+                        //    Position = task.NextAddress,
+                        //    PalletCode = task.PalletCode,
+                        //};
+
+                        //// 鍙戦�佽姹傚苟绛夊緟鍝嶅簲
+                        //var result = HttpHelper.PostAsync("http:127.0.0.1:8098/api/Task/RequestTaskAsync", request.ToJsonString()).Result;
+
+                        //// 鍙嶅簭鍒楀寲鍝嶅簲鍐呭
+                        //content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+
+                        //// 妫�鏌ョ姸鎬佸苟杩斿洖
+                        //if (!content.Status)
+                        //    return content;
+
+                        //// 鍙嶅簭鍒楀寲浠诲姟鏁版嵁
+                        //WMSTaskDTO taskResult = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
+
+                        //task.CurrentAddress = task.NextAddress;
+                        //task.NextAddress = taskResult.TargetAddress;
+                        //task.TargetAddress = task.NextAddress;
+                        #endregion
+
                     }
                 }
                 else
@@ -504,20 +532,25 @@
                     BaseDal.UpdateData(task);
                     _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撳畬鎴�");
 
-                    WMSTaskDTO taskDTO = new WMSTaskDTO()
-                    {
-                        TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")),
-                        Grade = 1,
-                        PalletCode = task.PalletCode + "S",
-                        RoadWay = "SC01",
-                        SourceAddress = task.TargetAddress,
-                        TargetAddress = "CLOutAreaA",
-                        TaskState = (int)TaskOutStatusEnum.OutNew,
-                        Id = 0,
-                        TaskType = (int)TaskOutboundTypeEnum.Outbound
-                    };
 
-                    content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
+                    //var x = new { taskNum = taskNum };
+                    //var result = HttpHelper.GetAsync("http:127.0.0.1:8098/api/Task/CompleteTaskAsync", x.ToJsonString()).Result;
+                    //content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+
+                    //WMSTaskDTO taskDTO = new WMSTaskDTO()
+                    //{
+                    //    TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")),
+                    //    Grade = 1,
+                    //    PalletCode = task.PalletCode + "S",
+                    //    RoadWay = "SC01",
+                    //    SourceAddress = task.TargetAddress,
+                    //    TargetAddress = "CLOutAreaA",
+                    //    TaskState = (int)TaskOutStatusEnum.OutNew,
+                    //    Id = 0,
+                    //    TaskType = (int)TaskOutboundTypeEnum.Outbound
+                    //};
+
+                    //content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
                 }
                 else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
                 {
@@ -530,7 +563,7 @@
                 {
                     throw new Exception($"浠诲姟绫诲瀷閿欒,鏈壘鍒拌浠诲姟绫诲瀷,浠诲姟鍙�:銆恵taskNum}銆�,浠诲姟绫诲瀷:銆恵task.TaskType}銆�");
                 }
-                content = WebResponseContent.Instance.OK();
+                //content = WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
             {

--
Gitblit v1.9.3