From cbe2572195c6f1ebe26a269289dba7f516245a1d Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 11 十一月 2025 11:41:00 +0800
Subject: [PATCH] 修改问题

---
 Wms/Wms/Controllers/DownApiController.cs |  329 +++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 283 insertions(+), 46 deletions(-)

diff --git a/Wms/Wms/Controllers/DownApiController.cs b/Wms/Wms/Controllers/DownApiController.cs
index 7b635c8..b11c7f2 100644
--- a/Wms/Wms/Controllers/DownApiController.cs
+++ b/Wms/Wms/Controllers/DownApiController.cs
@@ -19,6 +19,9 @@
 using static Model.InterFaceModel.RCSModel;
 using WMS.IBLL.IBllTransServer;
 using Microsoft.Extensions.Logging;
+using ZXing.QrCode.Internal;
+using Model.ModelVm.BllCheckVm;
+using System.DirectoryServices.Protocols;
 
 namespace Wms.Controllers
 {
@@ -659,28 +662,43 @@
         public IActionResult GetPalletNo(Pallnetmsg pallmsg)
         {
             var logStr = $@".\log\AGV\AGV鐢宠鍙《" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            AgvResultModel resultModel = null;//杩斿洖淇℃伅
             try
             {
                 var jsonData = JsonConvert.SerializeObject(pallmsg);
-                LogFile.SaveLogToFile($"AGV鐢宠鍙《锛�( {jsonData} ),", logStr);
+                LogFile.SaveLogToFile($"AGV鐢宠鍙《-璇锋眰鎶ユ枃锛�( {jsonData} ),", logStr);
 
                 if (string.IsNullOrWhiteSpace(pallmsg.Location))
                 {
-                    return Ok(new AgvResultModel { code = "1", message = "鍙枡浣嶇疆涓虹┖锛�", data = "", reqCode = "" });
+                    resultModel = new AgvResultModel { code = "1", message = "鍙枡浣嶇疆涓虹┖!", data = "", reqCode = "" };
+                    var jsonData3 = JsonConvert.SerializeObject(resultModel);
+                    LogFile.SaveLogToFile($"AGV鐢宠鍙《-杩斿洖鎶ユ枃锛�( {jsonData3} ),", logStr);
+                    return Ok(resultModel);
                 }
                 if (string.IsNullOrWhiteSpace(pallmsg.Type))
                 {
-                    return Ok(new AgvResultModel { code = "1", message = "浠诲姟绫诲瀷涓虹┖锛�", data = "", reqCode = "" });
+                    resultModel = new AgvResultModel { code = "1", message = "浠诲姟绫诲瀷涓虹┖!", data = "", reqCode = "" };
+                    var jsonData4 = JsonConvert.SerializeObject(resultModel);
+                    LogFile.SaveLogToFile($"AGV鐢宠鍙《-杩斿洖鎶ユ枃锛�( {jsonData4} ),", logStr);
+                    return Ok(resultModel);
                 }
                 string taskNo = "";
-                _rcsserver.GetPalletNo(pallmsg, _config.AgvHost + _config.GenAgvSchedulingTask, out taskNo);
-                return Ok(new AgvResultModel { code = "0", message = "鍙《鎴愬姛", data = taskNo, reqCode = "" });
+                //鍏蜂綋澶勭悊鏂规硶
+                _rcsserver.GetPalletNo(pallmsg, _config.AgvHost + _config.GenAgvSchedulingTask, _config.MesHost + _config.MesPanClearPallet, out taskNo);
+
+                resultModel = new AgvResultModel { code = "0", message = "鍙《鎴愬姛!", data = taskNo, reqCode = "" };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV鐢宠鍙《-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
             }
             catch (Exception e)
             {
                 LogFile.SaveLogToFile($"AGV鐢宠鍙《寮傚父锛�( {e.Message} ),", logStr);
 
-                return Ok(new AgvResultModel { code = "1", message = e.Message, data = "", reqCode = "" });
+                resultModel = new AgvResultModel { code = "1", message = e.Message, data = "", reqCode = "" };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV鐢宠鍙《-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
             }
         }
 
@@ -693,47 +711,67 @@
         public IActionResult ApplyLocatNo(Pallnetmsg pallmsg)
         {
             var logStr = $@".\log\AGV\AGV鐢宠鍌ㄤ綅" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
-
+            AgvResultModel resultModel = null;//杩斿洖淇℃伅
             try
             {
                 var jsonData = JsonConvert.SerializeObject(pallmsg);
-                LogFile.SaveLogToFile($"AGV鐢宠鍌ㄤ綅锛�( {jsonData} ),", logStr);
+                LogFile.SaveLogToFile($"AGV鐢宠鍌ㄤ綅-璇锋眰鎶ユ枃锛�( {jsonData} ),", logStr);
 
                 if (string.IsNullOrWhiteSpace(pallmsg.Location))
                 {
-                    return Ok(new AgvResultModel { code = "1", message = "鐢宠浣嶇疆涓虹┖锛�", data = "", reqCode = "" });
+                    resultModel = new AgvResultModel { code = "1", message = "鐢宠浣嶇疆涓虹┖!", data = "", reqCode = "" };
+                    var jsonData3 = JsonConvert.SerializeObject(resultModel);
+                    LogFile.SaveLogToFile($"AGV鐢宠鍌ㄤ綅-杩斿洖鎶ユ枃锛�( {jsonData3} ),", logStr);
+                    return Ok(resultModel);
                 }
                 if (string.IsNullOrWhiteSpace(pallmsg.Type))
                 {
-                    return Ok(new AgvResultModel { code = "1", message = "浠诲姟绫诲瀷涓虹┖锛�", data = "", reqCode = "" });
+                    resultModel = new AgvResultModel { code = "1", message = "浠诲姟绫诲瀷涓虹┖!", data = "", reqCode = "" };
+                    var jsonData3 = JsonConvert.SerializeObject(resultModel);
+                    LogFile.SaveLogToFile($"AGV鐢宠鍌ㄤ綅-杩斿洖鎶ユ枃锛�( {jsonData3} ),", logStr);
+                    return Ok(resultModel);
                 }
-                if (string.IsNullOrWhiteSpace(pallmsg.PalletNo))
-                {
-                    return Ok(new AgvResultModel { code = "1", message = "鐢宠鎵樼洏鍙蜂负绌猴紒", data = "", reqCode = "" });
-                }
+                //if (string.IsNullOrWhiteSpace(pallmsg.PalletNo))
+                //{
+                //    resultModel = new AgvResultModel { code = "1", message = "鐢宠妗跺彿涓虹┖!", data = "", reqCode = "" };
+                //    var jsonData3 = JsonConvert.SerializeObject(resultModel);
+                //    LogFile.SaveLogToFile($"AGV鐢宠鍌ㄤ綅-杩斿洖鎶ユ枃锛�( {jsonData3} ),", logStr);
+                //    return Ok(resultModel);
+                //}
                 string taskNo = "";
+                //鍏蜂綋澶勭悊鏂规硶
                 _rcsserver.ApplyLocatNo(pallmsg, _config.AgvHost + _config.GenAgvSchedulingTask, out taskNo);
 
-                return Ok(new AgvResultModel { code = "0", message = "鐢宠鍌ㄤ綅鎴愬姛锛�", data = taskNo, reqCode = "" });
+                resultModel = new AgvResultModel { code = "0", message = "鐢宠鍌ㄤ綅鎴愬姛!", data = taskNo, reqCode = "" };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV鐢宠鍌ㄤ綅-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
             }
             catch (Exception e)
             {
                 LogFile.SaveLogToFile($"AGV鐢宠鍌ㄤ綅寮傚父锛�( {e.Message} ),", logStr);
 
-                return Ok(new AgvResultModel { code = "1", message = e.Message, data = "", reqCode = "" });
+                resultModel = new AgvResultModel { code = "1", message = e.Message, data = "", reqCode = "" };
+                var jsonData3 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV鐢宠鍌ㄤ綅-杩斿洖鎶ユ枃锛�( {jsonData3} ),", logStr);
+                return Ok(resultModel);
             }
         }
         /// <summary>
-        /// 灏嗗噣妗舵敼涓鸿剰妗跺苟鎷夊埌鑴忔《鍖�
+        /// MES灏嗗噣妗舵敼涓鸿剰妗跺苟鎷夊埌鑴忔《鍖�
         /// </summary>
         /// <param name="pallmsg"></param>
         /// <returns></returns>
         [HttpPost]
         public IActionResult ChangePalletStatus(Pallnetmsg pallmsg)
         {
+            var logStr = $@".\log\MES\MES灏嗗噣妗舵敼涓鸿剰妗跺苟鎷夊埌鑴忔《鍖�" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
             var result = new ErpModel { Success = -1, Message = "", };
             try
             {
+                var jsonData = JsonConvert.SerializeObject(pallmsg);
+                LogFile.SaveLogToFile($"MES灏嗗噣妗舵敼涓鸿剰妗跺苟鎷夊埌鑴忔《鍖�-璇锋眰鎶ユ枃锛�( {jsonData} ),", logStr);
+
                 if (string.IsNullOrWhiteSpace(pallmsg.PalletNo))
                 {
                     result.Message = "妗剁紪鍙蜂笉鑳戒负绌猴紒";
@@ -746,22 +784,28 @@
             }
             catch (Exception e)
             {
+                LogFile.SaveLogToFile($"MES灏嗗噣妗舵敼涓鸿剰妗跺苟鎷夊埌鑴忔《鍖哄紓甯革細( {e.Message} ),", logStr);
+
                 result.Message = e.Message;
                 return Ok(result);
             }
         }
 
         /// <summary>
-        /// MES涓嬪彂娓呮礂閿佸畾鑴忔《
+        /// MES涓嬪彂娓呮礂鎸囧畾鑴忔《
         /// </summary>
         /// <param name="pallmsg"></param>
         /// <returns></returns>
         [HttpPost]
         public IActionResult CleanPallet(Pallnetmsg pallmsg)
         {
-            var result = new ErpModel { Success = -1, Message = "", };
+            var logStr = $@".\log\MES\MES涓嬪彂娓呮礂鎸囧畾鑴忔《" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            ErpModel result = new ErpModel { Success = -1, Message = "" };
             try
             {
+                var jsonData = JsonConvert.SerializeObject(pallmsg);
+                LogFile.SaveLogToFile($"MES涓嬪彂娓呮礂鎸囧畾鑴忔《-璇锋眰鎶ユ枃锛�( {jsonData} ),", logStr);
+
                 if (string.IsNullOrWhiteSpace(pallmsg.Location))
                 {
                     result.Message = "鍙枡浣嶇疆涓虹┖锛�";
@@ -779,6 +823,7 @@
             }
             catch (Exception e)
             {
+                LogFile.SaveLogToFile($"MES涓嬪彂娓呮礂鎸囧畾鑴忔《寮傚父锛�( {e.Message} ),", logStr);
                 result.Message = e.Message;
                 return Ok(result);
             }
@@ -818,52 +863,150 @@
             }
         }
 
+
+        #region Agv浠诲姟瀹屾垚鍙嶉
         /// <summary>
-        /// Agv浠诲姟瀹屾垚鍙嶉
+        /// 浠诲姟寮�濮�
         /// </summary>
         /// <param name="model"></param>
         /// <returns></returns>
         [HttpPost]
-        public IActionResult agvCallBack(AgvTaskDto model)
+        public IActionResult start(AgvTaskDto model)
         {
             //璁板綍log
             var logStr = $@".\log\AGV\浠诲姟鎵ц閫氱煡" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            AgvResultModel resultModel = null;//杩斿洖淇℃伅
             try
-            {                
+            {
                 var jsonData = JsonConvert.SerializeObject(model);
-                LogFile.SaveLogToFile($"浠诲姟鎵ц閫氱煡锛�( {jsonData} ),", logStr);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟寮�濮�-璇锋眰鎶ユ枃锛�( {jsonData} ),", logStr);
 
-                if (string.IsNullOrEmpty(model.reqCode))
-                {
-                    return Ok(new AgvResultModel { code = "-1", message = "璇锋眰澶辫触锛宺eqCode鍙傛暟寮傚父", reqCode = model.reqCode });
-                }
-                switch (model.method)
-                {
-                    case "start"://浠诲姟寮�濮�
-                        return Ok(new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode });
+                //鍏蜂綋澶勭悊鏂规硶
 
-                    case "outbin"://璧板嚭鍌ㄤ綅
-                        return Ok(new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode });
 
-                    case "end"://浠诲姟缁撴潫
-                        _rcsserver.RCSFinishTask(model.reqCode, "1");
-                        return Ok(new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode });
-                    case "cancel"://浠诲姟鍗曞彇娑�
-                        return Ok(new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode });
 
-                    case "apply"://CTU鏂欑鍙栨斁鐢宠
-                        return Ok(new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode });
-
-                    default:
-                        return Ok(new AgvResultModel { code = "-1", message = "璇锋眰澶辫触锛宮ethod浠诲姟绫诲瀷閿欒", reqCode = model.reqCode });
-                }
+                resultModel = new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟寮�濮�-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
             }
             catch (Exception ex)
             {
-                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡寮傚父锛�( {ex.Message} ),", logStr);
-                return Ok(new AgvResultModel { code = "-1", message = ex.Message, reqCode = model.reqCode });
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟寮�濮�-寮傚父锛�( {ex.Message} ),", logStr);
+
+                resultModel = new AgvResultModel { code = "1", message = ex.Message, reqCode = model.reqCode };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟寮�濮�-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
             }
         }
+        /// <summary>
+        /// 璧板嚭鍌ㄤ綅
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult outbin(AgvTaskDto model)
+        {
+            //璁板綍log
+            var logStr = $@".\log\AGV\浠诲姟鎵ц閫氱煡" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            AgvResultModel resultModel = null;//杩斿洖淇℃伅
+            try
+            {
+                var jsonData = JsonConvert.SerializeObject(model);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-璧板嚭鍌ㄤ綅-璇锋眰鎶ユ枃锛�( {jsonData} ),", logStr);
+
+                //鍏蜂綋澶勭悊鏂规硶
+
+
+
+                resultModel = new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-璧板嚭鍌ㄤ綅-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
+            }
+            catch (Exception ex)
+            {
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-璧板嚭鍌ㄤ綅-寮傚父锛�( {ex.Message} ),", logStr);
+
+                resultModel = new AgvResultModel { code = "1", message = ex.Message, reqCode = model.reqCode };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-璧板嚭鍌ㄤ綅-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
+            }
+        }
+        /// <summary>
+        /// 浠诲姟缁撴潫
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult end(AgvTaskDto model)
+        {
+            //璁板綍log
+            var logStr = $@".\log\AGV\浠诲姟鎵ц閫氱煡" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            AgvResultModel resultModel = null;//杩斿洖淇℃伅
+            try
+            {
+                var jsonData = JsonConvert.SerializeObject(model);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟缁撴潫-璇锋眰鎶ユ枃锛�( {jsonData} ),", logStr);
+
+                //鍏蜂綋澶勭悊鏂规硶
+                _rcsserver.RCSFinishTask(model.taskCode, "1", "AGV");
+
+
+                resultModel = new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟缁撴潫-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
+            }
+            catch (Exception ex)
+            {
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟缁撴潫-寮傚父锛�( {ex.Message} ),", logStr);
+
+                resultModel = new AgvResultModel { code = "1", message = ex.Message, reqCode = model.reqCode };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟缁撴潫-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
+            }
+        }
+        /// <summary>
+        /// 浠诲姟鍗曞彇娑�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult cancel(AgvTaskDto model)
+        {
+            //璁板綍log
+            var logStr = $@".\log\AGV\浠诲姟鎵ц閫氱煡" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            AgvResultModel resultModel = null;//杩斿洖淇℃伅
+            try
+            {
+                var jsonData = JsonConvert.SerializeObject(model);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟鍗曞彇娑�-璇锋眰鎶ユ枃锛�( {jsonData} ),", logStr);
+
+                //鍏蜂綋澶勭悊鏂规硶
+
+
+
+                resultModel = new AgvResultModel { code = "0", message = "鎴愬姛", reqCode = model.reqCode };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟鍗曞彇娑�-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
+            }
+            catch (Exception ex)
+            {
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟鍗曞彇娑�-寮傚父锛�( {ex.Message} ),", logStr);
+
+                resultModel = new AgvResultModel { code = "1", message = ex.Message, reqCode = model.reqCode };
+                var jsonData2 = JsonConvert.SerializeObject(resultModel);
+                LogFile.SaveLogToFile($"AGV浠诲姟鎵ц閫氱煡-浠诲姟鍗曞彇娑�-杩斿洖鎶ユ枃锛�( {jsonData2} ),", logStr);
+                return Ok(resultModel);
+            }
+        }        
+
+        #endregion
 
         /// <summary>
         /// 鍑哄簱鍗曟嵁涓嬪彂
@@ -896,6 +1039,100 @@
                 return Ok(new ErpModel { Success = -1, Message = e.Message });
             }
         }
+
+        /// <summary>
+        /// 鎵嬪姩涓嬪彂灏忚溅浠诲姟
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult SendAgvTaskWms(CheckTaskVm model)
+        {
+            try
+            {
+                //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
+                var claimsIdentity = this.User.Identity as ClaimsIdentity;
+                if (claimsIdentity == null)
+                {
+                    return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+                if (string.IsNullOrWhiteSpace(userId))
+                {
+                    return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                _rcsserver.DownTask(model.taskNo, int.Parse(userId), _config.AgvHost + _config.GenAgvSchedulingTask);
+
+                return Ok(new { code = 0, msg = "閲嶆柊涓嬪彂宸插畬鎴�", data = "" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
+        /// <summary>
+        /// 鎵嬪姩瀹屾垚灏忚溅浠诲姟
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult FinshAgvTaskWms(CheckTaskVm model)
+        {
+            try
+            {
+                //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
+                var claimsIdentity = this.User.Identity as ClaimsIdentity;
+                if (claimsIdentity == null)
+                {
+                    return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+                if (string.IsNullOrWhiteSpace(userId))
+                {
+                    return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                //鍏蜂綋澶勭悊鏂规硶
+                _rcsserver.RCSFinishTask(model.taskNo, "1", "WMS");
+
+                return Ok(new { code = 0, msg = "閲嶆柊涓嬪彂宸插畬鎴�", data = "" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
+        /// <summary>
+        /// 鎵嬪姩鍙栨秷AGV绉诲簱浠诲姟
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult CancelAgvTaskWms(CheckTaskVm model)
+        {
+            try
+            {
+                //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
+                var claimsIdentity = this.User.Identity as ClaimsIdentity;
+                if (claimsIdentity == null)
+                {
+                    return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+                if (string.IsNullOrWhiteSpace(userId))
+                {
+                    return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                _rcsserver.CancelTask(model.taskNo, int.Parse(userId));
+
+                return Ok(new { code = 0, msg = "鎴愬姛鍙栨秷浠诲姟", data = "" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
         #endregion
     }
 }

--
Gitblit v1.8.0