From a65ac07c6cc7eba2dfb8416750f875f8a6ec636c Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-JIE70N9>
Date: 星期三, 11 六月 2025 11:28:46 +0800
Subject: [PATCH] 修改打印标签

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

diff --git a/Wms/Wms/Controllers/PdaAsnController.cs b/Wms/Wms/Controllers/PdaAsnController.cs
index 1522b14..699280a 100644
--- a/Wms/Wms/Controllers/PdaAsnController.cs
+++ b/Wms/Wms/Controllers/PdaAsnController.cs
@@ -1,17 +1,20 @@
 锘縰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;
 using Model.ModelVm;
 using Model.ModelVm.BllAsnVm;
 using Model.ModelVm.PdaVm;
+using Model.ModelVm.SysVm;
 using Newtonsoft.Json;
 using System;
 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 +27,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 +183,7 @@
         {
             try
             {
-                var models = _PdaAsnSvc.GetBindBoxInfos(model);
+                var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.GetBoxUrl);
 
                 return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models });
             }
@@ -254,7 +259,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)
@@ -265,8 +270,6 @@
 
 
         #endregion
-
-
 
         #region 鍏敤鏂规硶
         /// <summary>
@@ -700,7 +703,6 @@
 
         #endregion
          
-
         #region 骞冲簱鍏ュ簱
         /// <summary>
         /// 骞冲簱纭鍏ュ簱
@@ -818,5 +820,58 @@
 
 
         #endregion
+
+        #region 绾跨紪鏍囩
+        /// <summary>
+        /// 骞冲簱纭鍏ュ簱
+        /// </summary>
+        /// <param name="model">鐗╂枡缂栫爜锛涚墿鏂欏悕绉�</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetSkuInfo(GetMaterialsVm model)
+        {
+            try
+            {
+                var models = _PdaAsnSvc.GetSkuInfo(model);
+
+                return Ok(new { code = 0, msg = "鑾峰彇鐗╂枡淇℃伅鎴愬姛!", data = models });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
+        /// <summary>
+        /// 鐢熸垚鏂版爣绛� 骞惰繑鍥炴墦鍗版暟鎹�
+        /// </summary>
+        /// <param name="model">鏍囩淇℃伅</param>
+        /// <returns>鎵撳嵃鏁版嵁</returns>
+        [HttpPost]
+        public IActionResult AddLabels(LabelsVm model) 
+        {
+            try
+            {
+                var claimsIdentity = this.User.Identity as ClaimsIdentity;
+                if (claimsIdentity == null)
+                {
+                    throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+                }
+                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+                if (string.IsNullOrWhiteSpace(UserId))
+                {
+                    throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+                }
+                model.userId = int.Parse(UserId);
+                var models = _PdaAsnSvc.AddLabels(model);
+
+                return Ok(new { code = 0, msg = "绠辩爜鐢熸垚鎴愬姛!", data = models });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+        #endregion
     }
 }

--
Gitblit v1.8.0