From 86985a3e211ab4cc1e94a696c15a6f77d21c462a Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期二, 15 十月 2024 18:36:51 +0800
Subject: [PATCH] 修改出库单据问题

---
 Wms/Wms/Controllers/PdaCrController.cs |  140 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 138 insertions(+), 2 deletions(-)

diff --git a/Wms/Wms/Controllers/PdaCrController.cs b/Wms/Wms/Controllers/PdaCrController.cs
index a324d4a..d135a64 100644
--- a/Wms/Wms/Controllers/PdaCrController.cs
+++ b/Wms/Wms/Controllers/PdaCrController.cs
@@ -10,6 +10,8 @@
 using WMS.IBLL.IPdaServer;
 using WMS.Entity.DataEntity;
 using WMS.Entity.SysEntity;
+using Wms.Tools;
+using Microsoft.Extensions.Options;
 
 namespace Wms.Controllers
 {
@@ -19,10 +21,11 @@
     public class PdaCrController : ControllerBase
     {
         private readonly IPdaCrServer _pdaCrSvc;
-
-        public PdaCrController(IPdaCrServer pdaCrSvc)
+        private readonly ApiUrlConfig _config; //鎺ュ彛浜や簰璺緞
+        public PdaCrController(IPdaCrServer pdaCrSvc, IOptions<ApiUrlConfig> setting)
         {
             _pdaCrSvc = pdaCrSvc;
+            _config = setting.Value;
         }
 
         #region 鐩樼偣
@@ -278,6 +281,139 @@
             }
 
         }
+        /// <summary>
+        /// 鑾峰彇鎵樼洏鎵�鍦ㄦゼ灞傛墍鏈夊尯鍩�
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        public IActionResult GetRunSoNoticeList()
+        {
+            try
+            {
+                List<string> result = _pdaCrSvc.GetRunSoNoticeList();
+
+                return Ok(new { data = result, code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+
+        }
+        /// <summary>
+        /// 鏍规嵁鎵樼洏鍙疯幏鍙栨墭鐩樹笂鐗╂枡淇℃伅
+        /// </summary>
+        /// <param name="palletNo"></param>
+        /// <returns></returns>
+        [HttpGet]
+        public IActionResult GetSkuInfoByPalletNo(string palletNo)
+        {
+            try
+            {
+                List<DataStockDetail> result = _pdaCrSvc.GetSkuInfoByPalletNo(palletNo);
+
+                return Ok(new { data = result, code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+
+        }
+        /// <summary>
+        /// 鏍规嵁鍑哄簱鍗曞彿鑾峰彇鍒嗛厤鐨勬墭鐩樹俊鎭�
+        /// </summary>
+        /// <param name="soNo"></param>
+        /// <returns></returns>
+        [HttpGet]
+        public IActionResult GetPalletNoListBySoNo(string soNo)
+        {
+            try
+            {
+                List<string> result = _pdaCrSvc.GetPalletNoListBySoNo(soNo);
+
+                return Ok(new { data = result, code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+
+        }
+        /// <summary>
+        /// agv杞繍鍛煎彨灏忚溅
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult AgvTransport(PdaAgvTransportVm 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 = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+
+                var uId = int.Parse(userId);
+                _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, uId, _config.WcsHost + _config.GenAgvSchedulingTask);
+
+                return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
+        /// <summary>
+        /// agv杞繍鍛煎彨灏忚溅鍙栬揣
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult AgvTransport2(PdaAgvTransportVm 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 = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+
+                var uId = int.Parse(userId);
+                var str = _pdaCrSvc.AgvTransport2(model.SoNo,model.PalletNo, model.AreaNo, uId, _config.WcsHost + _config.GenAgvSchedulingTask);
+                var msgStr = "";
+                if (str.Contains("0"))
+                {
+                    msgStr += "鎴愬姛";
+                }
+                if (str.Contains("1"))
+                {
+                    msgStr += "閮ㄥ垎鎵樼洏宸叉湁灏忚溅绛夊緟鎵ц鎴栨鍦ㄦ墽琛岀殑浠诲姟";
+                }
+                 
+
+                return Ok(new { data = "", code = 0, msg = msgStr });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
         #endregion
 
     }

--
Gitblit v1.8.0