From 57be7d35e105350c8828e6ab0a411a9f69f203a2 Mon Sep 17 00:00:00 2001
From: test <15284381150@163.com>
Date: 星期一, 15 九月 2025 13:45:56 +0800
Subject: [PATCH] 修改PDA库存查询

---
 Wms/Wms/Controllers/PdaCrController.cs |  194 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 189 insertions(+), 5 deletions(-)

diff --git a/Wms/Wms/Controllers/PdaCrController.cs b/Wms/Wms/Controllers/PdaCrController.cs
index 86c1d5e..7634087 100644
--- a/Wms/Wms/Controllers/PdaCrController.cs
+++ b/Wms/Wms/Controllers/PdaCrController.cs
@@ -15,6 +15,9 @@
 using Model.ModelDto.PdaDto;
 using Microsoft.AspNetCore.Identity;
 using System.Security.Cryptography;
+using Wms.Tools;
+using Microsoft.Extensions.Options;
+using Model.ModelDto.DataDto;
 
 namespace Wms.Controllers
 {
@@ -23,11 +26,13 @@
     [Authorize]
     public class PdaCrController : ControllerBase
     {
+        private readonly ApiUrlConfig _config; //鎺ュ彛浜や簰璺緞
         private readonly IPdaCrServer _pdaCrSvc;
         private readonly UserManager _userManager;
 
-        public PdaCrController(IPdaCrServer pdaCrSvc, UserManager userManager)
+        public PdaCrController(IOptions<ApiUrlConfig> setting, IPdaCrServer pdaCrSvc, UserManager userManager)
         {
+            _config = setting.Value;
             _pdaCrSvc = pdaCrSvc;
             _userManager = userManager;
         }
@@ -113,13 +118,13 @@
         /// </summary>
         /// <param name="locatNo">鍌ㄤ綅缂栧彿</param>
         /// <param name="palletNo">鎵樼洏鍙�</param>
-        /// <param name="skuName">鐗╂枡鍚嶇О</param>
+        /// <param name="boxno">绠辩爜</param>
         /// <returns></returns>
         [HttpGet]
         [ServiceFilter(typeof(ApiResponseActionFilter))]
-        public async Task<List<DataStockDetail>> GetStockQueryList(string locatNo, string palletNo)
+        public async Task<List<DataStockDetail>> GetStockQueryList(string locatNo, string palletNo, string boxno)
         {
-            return await _pdaCrSvc.GetStockQueryList(locatNo, palletNo);
+            return await _pdaCrSvc.GetStockQueryList(locatNo, palletNo, boxno);
         }
 
         #endregion
@@ -231,7 +236,19 @@
         [UnitOfWork]
         public async Task AgvTransport(PdaAgvTransportVm model)
         {
-            await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _userManager.UserId);
+            await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _config.WcsHost+ _config.IssueComApiUrl, _userManager.UserId);
+        }
+        /// <summary>
+        /// 鍛煎彨agv杞繍绌烘墭鐩�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ServiceFilter(typeof(ApiResponseActionFilter))]
+        [UnitOfWork]
+        public async Task AgvNullPallet(PdaAgvTransportVm model)
+        {
+            await _pdaCrSvc.AgvNullPallet(model.PalletNo, model.AreaNo, model.LocatNo, _config.WcsHost + _config.IssueComApiUrl, _userManager.UserId);
         }
         /// <summary>
         /// agv杞繍鍛煎彨灏忚溅鍙栬揣
@@ -282,5 +299,172 @@
             }
         }
         #endregion
+
+        #region 鎷嗙璐存爣
+
+        /// <summary>
+        /// 鎷嗙璐存爣
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult AddLableByDevanning(PdaDevaningVm 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 list = _pdaCrSvc.AddLableByDevanning(model.BoxNo, model.DevanQty,uId);
+
+                return Ok(new { data = list, code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
+        #endregion
+
+        #region 纭鏀惰揣
+
+        /// <summary>
+        /// 鏍规嵁鏀惰揣鎵樼洏鑾峰彇鍑哄簱鍗曚俊鎭�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetReceiptSoNoByPallet(PdaReceiptVm model)
+        {
+            try
+            {
+
+                var soNo = _pdaCrSvc.GetReceiptSoNoByPallet(model.PalletNo);
+
+                return Ok(new { data = soNo, code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
+
+        /// <summary>
+        /// 纭鏀惰揣
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult ConfirmReceipt(PdaReceiptVm model)
+        {
+            try
+            {
+                _pdaCrSvc.ConfirmReceipt(model.PalletNo, _userManager.UserId);
+
+                return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
+
+        #endregion
+
+
+        #region 鐗╂枡鎷嗘墭
+
+        /// <summary>
+        /// 鏌ヨ绠变俊鎭�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetBoxInfo(PdaUpPalletVm model)
+        {
+            try
+            {  
+                _pdaCrSvc.GetBoxInfo(model.BoxNo, model.PalletNo);
+
+                return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
+
+        /// <summary>
+        /// 鐗╂枡鎷嗘墭
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult UpPalletByBox(PdaUpPalletVm model)
+        {
+            try
+            {
+                _pdaCrSvc.UpPalletByBox(model.BoxNo, model.PalletNo,model.PalletNoNew,_userManager.UserId);
+
+                return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁鎵樼洏鑾峰彇鎵樼洏涓婄殑鐗╂枡鎵规淇℃伅
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetSelectSkuLotNo(PdaUpPalletVm model)
+        {
+            try
+            {
+                var list = _pdaCrSvc.GetSelectSkuLotNo(model.PalletNo);
+
+                return Ok(new { data = list, code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
+
+        /// <summary>
+        /// 鐗╂枡鎷嗘墭 - 鏁伴噺椤电
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult UpPalletByQty(PdaUpPalletVm model)
+        {
+            try
+            {
+                _pdaCrSvc.UpPalletByQty(model.PalletNo, model.PalletNoNew, model.DetailId,model.Qty, _userManager.UserId);
+
+                return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+            }
+        }
+
+        #endregion
+
     }
 }

--
Gitblit v1.8.0