From 32cfcc52c647b5dab8db7c5ca7b54ab3041e9d36 Mon Sep 17 00:00:00 2001
From: chengsc <11752@DESKTOP-DS49RCP>
Date: 星期三, 04 六月 2025 14:54:33 +0800
Subject: [PATCH] 修改车间出入库

---
 Wms/Wms/Controllers/PdaAsnController.cs |   64 ++++++++++++++++++++++++++++++-
 1 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/Wms/Wms/Controllers/PdaAsnController.cs b/Wms/Wms/Controllers/PdaAsnController.cs
index 1522b14..9d57717 100644
--- a/Wms/Wms/Controllers/PdaAsnController.cs
+++ b/Wms/Wms/Controllers/PdaAsnController.cs
@@ -1,6 +1,7 @@
 锘縰sing Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Identity;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
 using Model.InterFaceModel;
 using Model.ModelDto.BllAsnDto;
 using Model.ModelDto.DataDto;
@@ -12,6 +13,7 @@
 using System.Security.Claims;
 using Utility;
 using Utility.Tools;
+using Wms.Tools;
 using WMS.BLL.LogServer;
 using WMS.Entity.BllAsnEntity;
 using WMS.Entity.DataEntity;
@@ -24,11 +26,13 @@
     [Authorize]
     public class PdaAsnController : ControllerBase
     {
+        private readonly ApiUrlConfig _config; //鎺ュ彛浜や簰璺緞
         private readonly IPdaAsnServer _PdaAsnSvc;
         private readonly UserManager _userManager;
 
-        public PdaAsnController(IPdaAsnServer pdaAsnSvc,UserManager userManager)
+        public PdaAsnController(IOptions<ApiUrlConfig> setting, IPdaAsnServer pdaAsnSvc,UserManager userManager)
         {
+            _config = setting.Value;
             _PdaAsnSvc = pdaAsnSvc; 
             _userManager = userManager;
         }
@@ -178,7 +182,27 @@
         {
             try
             {
-                var models = _PdaAsnSvc.GetBindBoxInfos(model);
+                var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.GetBoxUrl);
+
+                return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁绠辩爜鑾峰彇鏍囩绠辩爜淇℃伅锛堣溅闂村叆搴�-鑾峰彇WMS鐢熸垚鐨勭淇℃伅锛�
+        /// </summary>
+        /// <param name="boxNo">BoxNo:绠卞彿</param>
+        /// <returns></returns>
+        [HttpGet]
+        public IActionResult GetWmsBoxInfos(string boxNo)
+        {
+            try
+            {
+                var models = _PdaAsnSvc.GetWmsBoxInfos(boxNo);
 
                 return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models });
             }
@@ -239,6 +263,40 @@
         }
 
 
+        /// <summary>
+        /// 缁戝畾鎵樼洏
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost] 
+        public IActionResult ChejianIn(PdaPalletBindVm model)
+        {
+            try
+            {
+                 
+                if (_userManager.UserId ==0)
+                {
+                    throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+                }
+
+                if (model.TableType == 0)
+                {
+                    _PdaAsnSvc.ChejianIn(model.PalletNo,model.BoxNo,model.SkuQty,model.AreaNo, _userManager.UserId);
+                }
+                else if (model.TableType == 1)
+                {
+                    _PdaAsnSvc.ChejianQtyIn(model.PalletNo,model.SkuNo,model.LotNo,model.SkuQty,model.AreaNo, _userManager.UserId);
+                }
+
+                return Ok(new { code = 0, msg = "缁戝畾鎴愬姛!" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
+
         //---------------------------------------------鐢宠鍏ュ簱椤甸潰----------------------------------------------------------------------
 
 
@@ -254,7 +312,7 @@
             {
                 _PdaAsnSvc.SaveAppointLocate(model.PalletNo, model.LocatNo, _userManager.UserId);
 
-                return Ok(new HttpReturnModel{ Success = "0", Message = "鏍规嵁鍗曟嵁鑾峰彇鏍囩鏁伴噺" });
+                return Ok(new HttpReturnModel{ Success = "0", Message = "鎴愬姛鎸囧畾鍌ㄤ綅" });
 
             }
             catch (Exception e)

--
Gitblit v1.8.0