From 157abc191c34e57c1b958ae74fc3de6518ca8a30 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期五, 28 二月 2025 11:06:36 +0800
Subject: [PATCH] 修改客户需求

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

diff --git a/Wms/Wms/Controllers/PdaAsnController.cs b/Wms/Wms/Controllers/PdaAsnController.cs
index 1fd89c2..8e48743 100644
--- a/Wms/Wms/Controllers/PdaAsnController.cs
+++ b/Wms/Wms/Controllers/PdaAsnController.cs
@@ -1,10 +1,13 @@
 锘縰sing Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
 using Model.ModelVm;
 using Model.ModelVm.BllAsnVm;
 using Model.ModelVm.PdaVm;
 using System;
 using System.Security.Claims;
+using Wms.Tools;
+using WMS.Entity.BllAsnEntity;
 using WMS.IBLL.IPdaServer;
 
 namespace Wms.Controllers
@@ -16,11 +19,37 @@
     {
         #region 渚濊禆娉ㄥ叆
         private readonly IPdaAsnServer _PdaAsnSvc;
+        private readonly ApiUrlConfig _config; //鎺ュ彛浜や簰璺緞
 
-        public PdaAsnController(IPdaAsnServer pdaAsnSvc)
+        public PdaAsnController(IPdaAsnServer pdaAsnSvc, IOptions<ApiUrlConfig> setting)
         {
-            _PdaAsnSvc = pdaAsnSvc;
+            _PdaAsnSvc = pdaAsnSvc; 
+            _config = setting.Value;
         }
+        #endregion
+
+        #region MyRegion
+
+        /// <summary>
+        /// 鑾峰彇鍗曟嵁鏄庣粏鏄剧ず鐨勭墿鏂�
+        /// </summary>
+        /// <param name="model">Type:鍗曟嵁绫诲瀷</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetArrivalNoticesInfo(ArrivalNoticeVm model)
+        {
+            try
+            {
+                var models = _PdaAsnSvc.GetArrivalNoticesInfo(model);
+
+                return Ok(new { code = 0, msg = "鍏ュ簱鍗曚俊鎭�", data = models });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
         #endregion
 
         #region 鍏敤鏂规硶
@@ -37,6 +66,33 @@
                 var models = _PdaAsnSvc.GetArrivalNotices(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">ASNNo:鍏ュ簱鍗曞彿</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetArrivalNotice(ArrivalNoticeVm model)
+        {
+            try
+            {
+                var models = _PdaAsnSvc.GetArrivalNotice(model);
+
+                if (models == null)
+                {
+                    return Ok(new { code = 1, msg = "鍏ュ簱鍗曚俊鎭�", data = models });
+                }
+                else
+                {
+                    return Ok(new { code = 0, msg = "鍏ュ簱鍗曚俊鎭�", data = models });
+                }
             }
             catch (Exception e)
             {
@@ -64,6 +120,33 @@
                 {
                     return Ok(new { code = 1, msg = strMsg });
                 }                
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
+        /// <summary>
+        /// 鍒ゆ柇鎵樼洏鏄惁鍙敤
+        /// </summary>
+        /// <param name="model">PalletNo锛氭墭鐩樻潯鐮�</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult IsEnableLocatNo(PalletBindVm model)
+        {
+            try
+            {
+                var strMsg = _PdaAsnSvc.IsEnableLocatNo(model.LocatNo);
+
+                if (strMsg == "")
+                {
+                    return Ok(new { code = 0, msg = "鍦扮爜鍙敤!" });
+                }
+                else
+                {
+                    return Ok(new { code = 1, msg = strMsg });
+                }
             }
             catch (Exception e)
             {
@@ -132,6 +215,26 @@
         }
 
         /// <summary>
+        /// 鏍规嵁鎵樼洏鍙锋垨绠辩爜鑾峰彇鎵樼洏淇℃伅
+        /// </summary>
+        /// <param name="model">PalletNo:鎵樼洏鍙�</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetPalletBindInfo(BllPalletBind model)
+        {
+            try
+            {
+                var models = _PdaAsnSvc.GetPalletBindInfo(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">Id锛氱瀛愪富閿�</param>
@@ -155,6 +258,47 @@
                 model.CreateUser = int.Parse(UserId);
 
                 var strMsg = _PdaAsnSvc.DelBoxInfo(model);
+
+                if (strMsg == "")
+                {
+                    return Ok(new { code = 0, msg = "鍒犻櫎缁勬墭鎴愬姛!" });
+                }
+                else
+                {
+                    return Ok(new { code = 1, msg = strMsg });
+                }
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+
+        }
+
+        /// <summary>
+        /// 鍒犻櫎鎵樼洏淇℃伅
+        /// </summary>
+        /// <param name="model">ID\鎵樼洏鍙�</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult DelPalletBind(BllPalletBind 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.CreateUser = int.Parse(UserId);
+
+                var strMsg = _PdaAsnSvc.DelPalletBind(model);
 
                 if (strMsg == "")
                 {
@@ -321,6 +465,26 @@
                 return Ok(new { code = 1, msg = e.Message });
             }
         }
+
+        /// <summary>
+        /// 楠岃瘉鍌ㄤ綅(鍦扮爜)鏄惁鍙敤
+        /// </summary>
+        /// <param name="model">LocatNo鍌ㄤ綅鍦板潃</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult CheckLocatNo(PalletBindVm model) 
+        {
+            try
+            {
+                var result = _PdaAsnSvc.CheckLocatNo(model.LocatNo);
+
+                return Ok(new { code = 0, msg = "楠岃瘉鎴愬姛!", data = result });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
         #endregion
 
         #region 闆剁鍏ュ簱
@@ -391,7 +555,7 @@
         {
             try
             {
-                var models = _PdaAsnSvc.GetBindBoxInfos(model);
+                var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.FuMaGetBoxUrl, _config.BoxHost + _config.FuMaGetTokenUrl);
 
                 return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models });
             }
@@ -401,6 +565,40 @@
             }
         }
 
+        /// <summary>
+        /// 鏍规嵁绠辩爜鑾峰彇鏍囩鏈�灏忚拷婧爜淇℃伅
+        /// </summary>
+        /// <param name="model">BoxNo:绠卞彿</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetBindBoxInfo2s(BoxInfoVm model)
+        {
+            try
+            {
+                var models = _PdaAsnSvc.GetBindBoxInfo2s(model, _config.BoxHost + _config.FuMaGetBoxUrl, _config.BoxHost + _config.FuMaGetTokenUrl);
+
+                return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
+        [HttpPost]
+        public IActionResult GetBindArrivalNoticeDetails(ArrivalNoticeVm model)
+        {
+            try
+            {
+                var models = _PdaAsnSvc.GetBindArrivalNoticeDetails(model);
+
+                return Ok(new { code = 0, msg = "鍏ュ簱鍗曟槑缁嗕俊鎭�", data = models });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
 
         /// <summary>
         /// 缁戝畾鎵樼洏
@@ -433,5 +631,38 @@
             }
         }
         #endregion
+
+        #region 骞冲簱鍏ュ簱
+        /// <summary>
+        /// 骞冲簱纭鍏ュ簱
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult ConfirmInStock(PalletBindVm 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.CreateUser = int.Parse(UserId);
+                _PdaAsnSvc.ConfirmInStock(model);
+
+                return Ok(new { code = 0, msg = "鍏ュ簱鎴愬姛!" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+        #endregion
     }
 }

--
Gitblit v1.8.0