From f040136ab8029cc207a8111d21c78bbf315a6dbd Mon Sep 17 00:00:00 2001
From: IPC-610 <IPC-610@DESKTOP-6LEOOS3>
Date: 星期一, 21 十月 2024 18:54:19 +0800
Subject: [PATCH] 修改问题

---
 Admin.NET/WCS.Application/Util/HttpService.cs |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/Admin.NET/WCS.Application/Util/HttpService.cs b/Admin.NET/WCS.Application/Util/HttpService.cs
index 05ea89e..b471dc6 100644
--- a/Admin.NET/WCS.Application/Util/HttpService.cs
+++ b/Admin.NET/WCS.Application/Util/HttpService.cs
@@ -60,6 +60,7 @@
                     StartLocate = startLocat,
                     PalletNo = palletNo,
                     TaskNo = result.TaskList.TaskNo,
+                    Levels = 999,
                     EndLocate = result.TaskList.EndLocate,
                     EndRoadway = result.TaskList.EndRoadway
                 };
@@ -227,7 +228,6 @@
         }
 
         return returnStr;
-        
     }
 
 
@@ -269,4 +269,63 @@
         Log.Information("璋冪敤WMS鎺ュ彛鍙嶉婊″彇寮傚父鎺ュ彛" + result.ToJson());
         return result;
     }
+
+    /// <summary>
+    /// 璋冪敤WMS鎺ュ彛鐢宠绌烘墭璺哄嚭搴�
+    /// </summary>
+    /// <param name="Num"></param>
+    /// <param name="OutMode"></param>
+    /// <returns></returns>
+    public string IssuePlnOutHouseWcs(string Num,string OutMode)
+    {
+        string returnStr = "";
+
+        var model = new OutPalletModel()
+        {
+            Num = Num,//鍑哄簱璺烘暟
+            OutMode = OutMode//鍑哄簱鍙�
+        };
+        string url = Urls.WMSAddress + ":" + Urls.WMSPort;
+        var result = (url + "/api/DownAPi/IssuePlnOutHouseWcs").SetBody(model, "application/json", Encoding.UTF8).PostAsAsync<ResponseOutPallet>().Result;
+        Log.Information("璋冪敤WMS鎺ュ彛鍙嶉浠诲姟鎺ュ彛" + result.ToJson());
+
+        if (result.Success == 0)
+        {
+            foreach (var item in result.TaskList)
+            {
+                var taskUp = _db.Queryable<WcsTask>().First(m => m.IsDelete == false && m.TaskNo == item.TaskNo);
+                if (taskUp == null)
+                {
+                    var taskAdd = new WcsTask()
+                    {
+                        TaskNo = item.TaskNo,
+                        TaskType = (TaskTypeEnum)(int.Parse(item.TaskType)),
+                        Status = TaskStatusEnum.Wait,
+                        //IsSuccess =TaskSuccessEnum.Success,
+                        Origin = "WMS",
+                        StartLocate = item.StartLocate,
+                        StartRoadway=item.StartRoadway,
+                        PalletNo = item.PalletNo,
+                        EndLocate = item.EndLocate,
+                        EndRoadway = item.EndRoadway
+                    };
+                    _db.Insertable(taskAdd).ExecuteCommand();
+                    HubUtil.PublicTask(taskAdd.Adapt<WcsTaskOutput>());
+                }
+                else
+                {
+                    taskUp.EndRoadway = item.EndRoadway;
+                    taskUp.EndLocate = item.EndLocate;
+                    _db.Updateable(taskUp).ExecuteCommand();
+                    HubUtil.PublicTask(taskUp.Adapt<WcsTaskOutput>());
+                }
+            }
+        }
+        else
+        {
+            returnStr = "-1:" + result.Message;
+            return returnStr;
+        }
+        return returnStr;
+    }
 }

--
Gitblit v1.8.0