From 3428deadb4b60ef25dbd06fbf53905fc51c7616e Mon Sep 17 00:00:00 2001
From: zxx <Zxx@HanInfo>
Date: 星期一, 07 七月 2025 17:06:45 +0800
Subject: [PATCH] 1

---
 HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs   |   71 ++++++++++++++++++-----------------
 HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/api/ApiModel.cs       |   33 +++++++++++-----
 HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/models/WCSTask.cs     |    2 
 HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/RcsHelper.cs |   11 +++++
 4 files changed, 69 insertions(+), 48 deletions(-)

diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/api/ApiModel.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/api/ApiModel.cs
index 299b8e3..57ee37e 100644
--- a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/api/ApiModel.cs
+++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/api/ApiModel.cs
@@ -310,6 +310,9 @@
         /// 棰濆淇℃伅2
         /// </summary>
         public string extraInfo2 { get; set; }
+
+        //
+        public string StatusChangeTime { get; set; }
     }
 
     public class orderReroute
@@ -347,28 +350,36 @@
     ////鍙嶉灏忕背
     //public class XiaoMiOrderStatusReport
     //{
-    //    public string StatusChangeTime { get; set; }
     //    public int orderID { get; set; }
+    //    public int orderName { get; set; }
     //    public string orderStatus { get; set; }
-    //    public int errorCode { get; set; }
-    //    public string extraInfo1 { get; set; }
+    //    public string agvIDList { get; set; }
     //    public int priority { get; set; }
     //    public string currentDes { get; set; }
+    //    public string currentCmd { get; set; }
+    //    public int errorCode { get; set; }
+    //    public string extraInfo1 { get; set; }
+    //    //public statusParameter extraInfo1 { get; set; }
     //    public string extraInfo2 { get; set; }
     //    public string deadLine { get; set; }
-    //    public string agvIDList { get; set; }
-    //    public string currentCmd { get; set; }
     //    public string createdTime { get; set; }
     //    public string createdUser { get; set; }
-    //    public string orderName { get; set; }
+    //    public string StatusChangeTime { get; set; }
 
     //}
+    //public class statusParameter
+    //{
+    //    public string wcstaskCode { get; set; }
+    //    public string rcstaskCode { get; set; }
+    //    public string sku { get; set; }
+    //    public string boxType{ get; set; }
+    //    public string num { get; set; }
+    //}
 
-
-    /// <summary>
-    /// 杩斿洖缁橤Z
-    /// </summary>
-    public class GzResult
+        /// <summary>
+        /// 杩斿洖缁橤Z
+        /// </summary>
+        public class GzResult
     {
         public int resultCode { get; set; }
         public bool success { get; set; }
diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs
index 46a8c27..03e4151 100644
--- a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs
+++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs
@@ -195,7 +195,8 @@
                 agv.ForkliftNo = model.agvIDList;
                 WCSCore.OperateAgvTaskStatus(agv);
 
-                
+                ////灏忕背鐘舵�涓婃姤
+                //xiaoMiRequestApi(model);
 
             }
 
@@ -299,41 +300,41 @@
 
         }
 
-        ///// <summary>
-        ///// 璋冪敤灏忕背鐘舵�鍥炴姤鎺ュ彛
-        ///// </summary>
-        ///// <param name="id"></param>
-        ///// <returns></returns>
-        //public static int xiaoMiRequestApi(orderStatusReportParme model)
-        //{
-        //    var msg = "";
-        //    var orderId = 0;
-        //    var request = JsonConvert.SerializeObject(model);
-        //    var response = apiHelper.Post(baseUrl + "api/om/order/", request);
-        //    msg = $"[xiaoMiRequestApi] request={request} response={response}";
-        //    Console.WriteLine(msg);
-        //    if (response != ""&& model.orderStatus == "6")
-        //    {
-        //        try
-        //        {
-        //            var dataResult = JsonConvert.DeserializeObject<gzResult<OrderInfoResult>>(response);
-        //            if (dataResult.code == 0)
-        //            {
-        //                orderId = dataResult.data[0].in_order_id;
-        //            }
-        //        }
-        //        catch (Exception ex)
-        //        {
-        //        }
-        //    }
-        //    else
-        //    {
-        //        msg = "[xiaoMiRequestApi]鐘舵�姹囨姤澶辫触";
-        //        Console.WriteLine(msg);
-        //    }
+        /// <summary>
+        /// 璋冪敤灏忕背鐘舵�鍥炴姤鎺ュ彛
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public static int xiaoMiRequestApi(orderStatusReportParme model)
+        {
+            var msg = "";
+            var orderId = 0;
+            var request = JsonConvert.SerializeObject(model);
+            var response = apiHelper.Post(baseUrl + "api/om/order/", request);
+            msg = $"[xiaoMiRequestApi] request={request} response={response}";
+            Console.WriteLine(msg);
+            if (response != "" && model.orderStatus == "6")
+            {
+                try
+                {
+                    var dataResult = JsonConvert.DeserializeObject<gzResult<OrderInfoResult>>(response);
+                    if (dataResult.code == 0)
+                    {
+                        orderId = dataResult.data[0].in_order_id;
+                    }
+                }
+                catch (Exception ex)
+                {
+                }
+            }
+            else
+            {
+                msg = "[xiaoMiRequestApi]鐘舵�姹囨姤澶辫触";
+                Console.WriteLine(msg);
+            }
 
-        //    return orderId;
-        //}
+            return orderId;
+        }
 
     }
 
diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/RcsHelper.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/RcsHelper.cs
index bd3fae7..af3780d 100644
--- a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/RcsHelper.cs
+++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/RcsHelper.cs
@@ -35,7 +35,16 @@
                     var dataResult = JsonConvert.DeserializeObject<RcsResult>(response);
                     if (dataResult.code == 0)
                     {
-                        result = true;
+                        var db = new SqlHelper<WCSTask>().GetInstance();
+                        //瀛樿鍗曞彿
+                        var task = db.Queryable<WCSTask>().Where(a => a.S_CODE == model.ts_name).First();
+                        task.S_WORKSHOP_NO = dataResult.data.in_order_id;
+                        var res = db.Updateable(task).UpdateColumns(it => it.S_WORKSHOP_NO).ExecuteCommand() > 0;
+                        if (res)
+                        {
+                            result = true;
+                        }
+
                     }
                 }
                 catch (Exception ex)
diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/models/WCSTask.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/models/WCSTask.cs
index 42654c2..bea2822 100644
--- a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/models/WCSTask.cs
+++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/models/WCSTask.cs
@@ -53,7 +53,7 @@
 
         public string S_OP_NAME { get; set; }
 
-        //瀛樺皬绫充换鍔″彿
+        //瀛樺皬绫宠繑鍥炶鍗曞彿
         public string S_WORKSHOP_NO { get; set; }
         public string S_WORKSHOP_NAME { get; set; }
         //public int N_START_LAYER { get; internal set; }

--
Gitblit v1.9.1