From f42e607f9309c06394c6c46bfdc354ddd5195d51 Mon Sep 17 00:00:00 2001
From: liudl <673013083@qq.com>
Date: 星期四, 16 一月 2025 08:31:25 +0800
Subject: [PATCH] Merge branch 'Liudl'

---
 Wms/Wms/Controllers/DownApiController.cs |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 107 insertions(+), 7 deletions(-)

diff --git a/Wms/Wms/Controllers/DownApiController.cs b/Wms/Wms/Controllers/DownApiController.cs
index f407a96..09af858 100644
--- a/Wms/Wms/Controllers/DownApiController.cs
+++ b/Wms/Wms/Controllers/DownApiController.cs
@@ -16,6 +16,7 @@
 using System.Collections.Generic;
 using Model.ModelVm.PdaVm;
 using WMS.IBLL.IPdaServer;
+using Model.ModelVm;
 
 namespace Wms.Controllers
 {
@@ -32,8 +33,9 @@
         private readonly IStockCheckServer _crCheckSvc;//鎵樼洏缁戝畾Svc 
         private readonly ITaskServer _taskSvc;//浠诲姟Svc 
         private readonly IPdaSoServer _pdaSoSvc;//绌烘墭鍑哄簱Svc
+        private readonly IPdaAsnServer _paAsnSvc;//绌烘墭璺虹粦瀹�
 
-        public DownApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IPalletBindServer asnPalletBindSvc, IStockCheckServer crCheckSvc, ITaskServer taskSvc, IPdaSoServer pdaSoSvc)
+        public DownApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IPalletBindServer asnPalletBindSvc, IStockCheckServer crCheckSvc, ITaskServer taskSvc, IPdaSoServer pdaSoSvc,IPdaAsnServer paAsnSvc)
         {
             _config = setting.Value;
             _exNoticeSvc = exNoticeSvc;
@@ -41,6 +43,7 @@
             _crCheckSvc = crCheckSvc;
             _taskSvc = taskSvc;
             _pdaSoSvc = pdaSoSvc;
+            _paAsnSvc = paAsnSvc;
         }
 
         #region WMS鎺ュ彛 璋冪敤涓嬫父绯荤粺鎺ュ彛 
@@ -225,8 +228,8 @@
                     var list = _asnPalletBindSvc.RequestRoadWayModel(model.PalletNo, model.HouseNo);
 
                     LogFile.SaveLogToFile($"WCS鐢宠宸烽亾杩斿洖锛�( {JsonConvert.SerializeObject(list)} ),", logStr);
-                    new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鍏ュ簱鏃ュ織", model.PalletNo.Substring(0, 8),
-                        "鐢宠宸烽亾", $"鐢宠宸烽亾鎵樼洏鍙凤細{model.PalletNo.Substring(0, 8)}鐨勬垚鍔熶俊鎭�", 2);
+                    new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鍏ュ簱鏃ュ織", model.PalletNo,
+                        "鐢宠宸烽亾", $"鐢宠宸烽亾鎵樼洏鍙凤細{model.PalletNo}鐨勬垚鍔熶俊鎭�", 2);
 
                     return Ok(new { Success = 0, Message = "鐢宠宸烽亾鎴愬姛", TaskList = list });
                 }
@@ -246,8 +249,8 @@
             catch (Exception e)
             {
                 LogFile.SaveLogToFile($"WCS鐢宠宸烽亾杩斿洖锛�( {e.Message} ),", logStr);
-                new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鍏ュ簱鏃ュ織", model.PalletNo.Substring(0, 8),
-                    "鐢宠宸烽亾", $"鐢宠宸烽亾鎵樼洏鍙凤細{model.PalletNo.Substring(0, 8)}鐨勫け璐ヤ俊鎭�", 2);
+                new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鍏ュ簱鏃ュ織", model.PalletNo,
+                    "鐢宠宸烽亾", $"鐢宠宸烽亾鎵樼洏鍙凤細{model.PalletNo}鐨勫け璐ヤ俊鎭�", 2);
 
                 return Ok(new ErpModel { Success = -1, Message = e.Message });
             }
@@ -426,7 +429,7 @@
                 var bl = _exNoticeSvc.EmptyException(model);
 
                 LogFile.SaveLogToFile($"绌哄彇寮傚父锛�(鎵ц缁撴灉鎴愬姛),", logStr);
-                return Ok(new { Success = 0, Message = "" });
+                return Ok(new { Success = 0,StatusCode = 0, Message = "" });
             }
             catch (Exception e)
             {
@@ -451,7 +454,7 @@
                 var list = _asnPalletBindSvc.FullException(model);
 
                 LogFile.SaveLogToFile($"婊″叆寮傚父锛�( {JsonConvert.SerializeObject(list)} ),", logStr);
-                return Ok(new { Success = 0, Message = "", TaskList = list });
+                return Ok(new { Success = 0, StatusCode = 0, Message = "", TaskList = list });
             }
             catch (Exception e)
             {
@@ -538,6 +541,30 @@
         }
 
         /// <summary>
+        /// WCS鐢宠绌烘墭璺虹粦瀹�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult BindPlnInHouseWcs(PalletsBind model)
+        {
+            var logStr = $@".\log\WCS\WCS鐢宠绌烘墭璺虹粦瀹�" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            try
+            {
+                var strMsg = _paAsnSvc.BindNullPallets(model);
+
+                return Ok(new { Success = 0, Message = "绌烘墭璺虹粦瀹氭垚鍔�", TaskList = strMsg });
+            }
+            catch (Exception e)
+            {
+                LogFile.SaveLogToFile($"WCS鐢宠绌烘墭璺虹粦瀹氬紓甯歌繑鍥烇細( {e.Message} ),", logStr);
+
+                return Ok(new ErpModel { Success = -1, Message = e.Message });
+            }
+        }
+
+        /// <summary>
         /// WCS鐢宠绌烘墭鍑哄簱
         /// </summary>
         /// <param name="model"></param>
@@ -561,6 +588,78 @@
             }
         }
 
+        /// <summary>
+        /// WCS鐢宠鏄惁缂犺啘
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult RequestPackWcs(RequesIsBale model)
+        {
+            var logStr = $@".\log\WCS\WCS鐢宠缂犺啘鎷嗚啘" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            try
+            {
+               int t = _asnPalletBindSvc.RequestPackWcs(model.PalletNo);
+                LogFile.SaveLogToFile($"WCS鐢宠缂犺啘鍏ュ簱璇锋眰锛岃姹傛墭鐩樺憟锛�( {model.PalletNo} ),", logStr);
+
+                return Ok(new { Success = t, Message = "缂犺啘鎸囦护鍙戦�佹垚鍔�" });
+            }
+            catch (Exception e)
+            {
+                LogFile.SaveLogToFile($"WCS鐢宠缂犺啘鍏ュ簱寮傚父杩斿洖锛�( {e.Message} ),", logStr);
+
+                return Ok(new ErpModel { Success = -1, Message = e.Message });
+            }
+        }
+
+        /// <summary>
+        /// WCS鐢宠鏄惁鎷嗚啘
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult RequestUnPackWcs(RequesIsBale model)
+        {
+            var logStr = $@".\log\WCS\WCS鐢宠缂犺啘鎷嗚啘" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            try
+            {
+                int t = _asnPalletBindSvc.RequestUnPackWcs(model.PalletNo);
+
+                return Ok(new { Success = t, Message = "鎷嗚啘鎸囦护鍙戦�佹垚鍔�" });
+            }
+            catch (Exception e)
+            {
+                LogFile.SaveLogToFile($"WCS鐢宠鎷嗚啘鍑哄簱寮傚父杩斿洖锛�( {e.Message} ),", logStr);
+
+                return Ok(new ErpModel { Success = -1, Message = e.Message });
+            }
+        }
+
+        /// <summary>
+        /// WCS鍙嶉缂犺啘瀹屾垚
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult RequestPackedWcs(RequesIsBale model)
+        {
+            var logStr = $@".\log\WCS\WCS鐢宠缂犺啘鎷嗚啘" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+            try
+            {
+                int t = _asnPalletBindSvc.RequestPackedWcs(model.PalletNo);
+
+                return Ok(new { Success = t, Message = "缂犺啘瀹屾垚鎸囦护鍙戦�佹垚鍔�" });
+            }
+            catch (Exception e)
+            {
+                LogFile.SaveLogToFile($"WCS鐢宠缂犺啘瀹屾垚寮傚父杩斿洖锛�( {e.Message} ),", logStr);
+
+                return Ok(new ErpModel { Success = -1, Message = e.Message });
+            }
+        }
 
         ///// <summary>
         ///// 鎴愬搧绠辩爜鎷嗗灈鎷h揣
@@ -625,6 +724,7 @@
                 switch (orderType)
                 {
                     case "0"://鍏ュ簱浠诲姟鎵ц
+
                     case "1"://鍑哄簱浠诲姟鎵ц
                     case "2"://鐩樺簱浠诲姟鎵ц
                     case "3"://绉诲簱浠诲姟鎵ц

--
Gitblit v1.8.0