From f7f1f176f931f5ad54056df7b8e8a9f028eea100 Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期二, 17 十二月 2024 19:50:38 +0800
Subject: [PATCH] 合并

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
index 24e985a..5923b5e 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -96,8 +96,20 @@
                 if (!content.Status)
                 {
                     // wms澶辫触杩斿洖鍘籒G鍙d换鍔�
-
-
+                    //if (stationManager.stationChildCode != stationManager.stationNGChildCode)
+                    //{
+                    //    WMSTaskDTO taskDTO = new WMSTaskDTO()
+                    //    {
+                    //        Grade = 8,
+                    //        PalletCode = palletCode,
+                    //        SourceAddress = stationManager.stationLocation,
+                    //        TargetAddress = stationManager.stationNGLocation,
+                    //        RoadWay = stationManager.Roadway,
+                    //        TaskNum = 1000,
+                    //        TaskState = (int)TaskOutStatusEnum.OutNew,
+                    //        TaskType = (int)TaskOutboundTypeEnum.InToOut
+                    //    };
+                    //}
                     return content;
                 }
 
@@ -111,6 +123,45 @@
             }
         }
 
+        public async Task<WebResponseContent> RequestOutTaskToBZAsync(Dt_StationManager stationManager)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
+                var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue;
+                var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.RequestOutTaskToBZ)?.ConfigValue;
+                if (wmsBase == null || requestTask == null)
+                {
+                    throw new InvalidOperationException("WMS IP 鏈厤缃�");
+                }
+                var wmsIpAddrss = wmsBase + requestTask;
+
+                var result = await HttpHelper.PostAsync(wmsIpAddrss, new { }.ToJsonString());
+                content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+                if (!content.Status)
+                {
+                    //鏃犳弧瓒虫潯浠跺彲鍑哄簱鑷冲寘瑁呯殑搴撳瓨
+                    return content;
+                }
+
+                var task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
+                ConsoleHelper.WriteSuccessLine(content.Data.ToString());
+                content = ReceiveByWMSTask(task);
+                //if (content.Status)
+                //{
+                //    //鐩稿簲鐨勫湪閫旀暟鎹�+1
+                //   // _taskNeedBarcodeRepository.UpdateData();
+                //}
+                return content;
+            }
+            catch (Exception ex)
+            {
+
+                return content.Error(ex.Message);
+            }
+        }
+
         /// <summary>
         /// 鎺ユ敹WMS浠诲姟淇℃伅
         /// </summary>

--
Gitblit v1.9.3