From b2c070eaf8cc59b40d27bda904312d0c394a51f4 Mon Sep 17 00:00:00 2001
From: lss <Lss@HanInfo>
Date: 星期五, 20 六月 2025 17:23:37 +0800
Subject: [PATCH] 开发与优化

---
 HH.WCS.Mobox3/HH.WCS.Mobox3.DaYang/api/MoboxController.cs |  150 +++++++++++++++++++++++++------------------------
 1 files changed, 76 insertions(+), 74 deletions(-)

diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.DaYang/api/MoboxController.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.DaYang/api/MoboxController.cs
index c489f0b..7230bfc 100644
--- a/HH.WCS.Mobox3/HH.WCS.Mobox3.DaYang/api/MoboxController.cs
+++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.DaYang/api/MoboxController.cs
@@ -2,6 +2,7 @@
 using HH.WCS.DaYang.process;
 using HH.WCS.DaYang.util;
 using HH.WCS.DaYang.wms;
+using Newtonsoft.Json;
 using System.Collections.Generic;
 using System.Web.Http;
 using static HH.WCS.DaYang.api.ApiModel;
@@ -64,7 +65,7 @@
                     {
                         HttpHelper http = new HttpHelper();
                         var CancelResult = http.CancelTask(task, url.url);
-                        if (CancelResult != null && CancelResult.Code ==200)
+                        if (CancelResult != null && CancelResult.Code == 200)
                         {
                             WCSHelper.UpdateStatus(model.TaskNo, 4);
                             result.resultMsg = "浠诲姟鍙栨秷宸蹭笅鍙�;
@@ -78,7 +79,7 @@
                     {
                         LogHelper.Info($"浠诲姟鍙栨秷锛屾湭鎵惧埌瀵瑰簲鍙栨秷浠诲姟鎺ュ彛锛岃妫�煡閰嶇疆鏂囦欢");
                     }
-                  
+
                 }
                 else
                 {
@@ -93,8 +94,42 @@
             }
             return result;
         }
+
         /// <summary>
-        /// 浠诲姟寮哄埗瀹屾垚锛堢洰鍓嶆敮鎸乶dc锛�+        /// 鍙犵洏鏈虹姸鎬佸垏鎹�+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public SimpleResult CancelTask(MoboxChangeStatus model)
+        {
+            var result = new SimpleResult();
+            //鍒囨崲鍙犵洏鏈虹姸鎬侊紝鍘昏皟鐢╳cs鎺ュ彛
+            HttpHelper http = new HttpHelper();
+            var url = Settings.tableUrls.Find(a => a.id == 5);
+            if (url != null)
+            {
+                var changeResult = http.ChangeStatus(model.Type, url.url);
+                if (changeResult.Code == 200)
+                {
+                    result.resultCode = 0;
+                    result.resultMsg = "鍒囨崲鎴愬姛";
+                }
+                else
+                {
+                    result.resultCode = changeResult.Code;
+                    result.resultMsg = "鍒囨崲澶辫触锛� + result.resultMsg;
+                }
+            }
+            else
+            {
+                result.resultCode = 1;
+                result.resultMsg = "鏍规嵁閰嶇疆鏂囦欢鏈幏鍙栧埌鍙犵洏鏈虹姸鎬佸垏鎹㈡帴鍙o紝璇锋鏌ラ厤缃枃浠�;
+            }
+            return result;
+        }
+        /// <summary>
+        /// 浠诲姟寮哄埗瀹屾垚
         /// </summary>
         /// <param name="model"></param>
         /// <returns></returns>
@@ -102,81 +137,48 @@
         public SimpleResult CompleteTask(MoboxTaskBase model)
         {
             var result = new SimpleResult();
+
+            return result;
+        }
+
+        /// <summary>
+        /// 淇敼浠诲姟浼樺厛绾�+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        public SimpleResult changePriority(ChangePriorityModel model)
+        {
+          
+            LogHelper.Info("changePriority 鎺ユ敹锛� + JsonConvert.SerializeObject(model), "API");
+            var result = new SimpleResult();
+            //鍒囨崲鍙犵洏鏈虹姸鎬侊紝鍘昏皟鐢╳cs鎺ュ彛
+            HttpHelper http = new HttpHelper();
+            var url = Settings.tableUrls.Find(a => a.id == 6);
+            if (url != null)
+            {
+                var changeResult = http.ChangePriority(model.TaskNo,model.Priority, url.url);
+                if (changeResult.Code == 200)
+                {
+                    result.resultCode = 0;
+                    result.resultMsg = "淇敼鎴愬姛";
+                }
+                else
+                {
+                    result.resultCode = changeResult.Code;
+                    result.resultMsg = "淇敼澶辫触锛� + result.resultMsg;
+                }
+            }
+            else
+            {
+                result.resultCode = 1;
+                result.resultMsg = "鏍规嵁閰嶇疆鏂囦欢鏈幏鍙栧埌淇敼浠诲姟浼樺厛绾ф帴鍙o紝璇锋鏌ラ厤缃枃浠�;
+            }
+            
+            LogHelper.Info("changePriority 杩斿洖锛� + JsonConvert.SerializeObject(result), "API");
             return result;
         }
 
 
-        /// <summary>
-        /// 鐮佺洏鏍¢獙
-        /// </summary>
-        /// <param name="model"></param>
-        /// <returns></returns>
-        [HttpPost]
-        public SimpleResult PalletSorting(PalletSorting model)
-        {
-            return ApiHelper.PalletSorting(model);
-        }
-        /// <summary>
-        /// 鐮佺洏鏍¢獙涓嶅甫涓婃灦(鍏ュ簱)鍗曞彿
-        /// </summary>
-        /// <param name="model"></param>
-        /// <returns></returns>
-        [HttpPost]
-        public SimpleResult PalletSorting1(PalletSorting1 model)
-        {
-            return ApiHelper.PalletSorting1(model);
-        }
-        /// <summary>
-        /// pda鍏ュ簱鐢宠
-        /// </summary>
-        /// <param name="model"></param>
-        /// <returns></returns>
-        public SimpleResult Instock(InstockInfo model)
-        {
-            return ApiHelper.Instock(model);
 
-        }
-
-        /// <summary>
-        /// 鍙戣揣鍗曟墽琛�-        /// </summary>
-        /// <param name="model"></param>
-        /// <returns></returns>
-        [HttpPost]
-        public SimpleResult ShippingOrderExecute(ShippingOrderCheck model)
-        {
-            return ApiHelper.ShippingOrderExecute(model);
-
-        }
-        /// <summary>
-        /// 鍒嗘嫞鍗曟墽琛�-        /// </summary>
-        /// <param name="model"></param>
-        /// <returns></returns>
-        [HttpPost]
-        public SimpleResult SortingOrderExecute(SortingOrderCheck model)
-        {
-            return ApiHelper.SortingOrderExecute(model);
-
-        }
-        /// <summary>
-        /// 鍒嗘嫞缁撴灉纭锛堝墠绔嫤鎴暟閲忎笉鍙互瓒呰繃鍒嗘嫞鏄庣粏涓�F_QTY-F_ACC_SR_QTY鐨勬暟閲忥級
-        /// </summary>
-        /// <returns></returns>
-        public SimpleResult SortingResultCheck(List<SortingResultCheck> models)
-        {
-            return ApiHelper.SortingResultCheck(models);
-
-        }
-        /// <summary>
-        /// 鍒ゆ柇鏄惁鏄暣鎵樺垎鎷�-        /// </summary>
-        /// <param name="model"></param>
-        /// <returns></returns>
-        public SimpleResult CheckSortingWholeCntr(CheckSortingWholeCntr model)
-        {
-            return ApiHelper.CheckSortingWholeCntr(model);
-
-        }
     }
 }

--
Gitblit v1.9.1