From 87110c04df904eb4947587a34f3fc5a1eb45eb7e Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期日, 12 十月 2025 16:21:11 +0800
Subject: [PATCH] 入库单据开发导入入库单功能;

---
 Wms/Wms/Controllers/BllAsnController.cs |   51 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/Wms/Wms/Controllers/BllAsnController.cs b/Wms/Wms/Controllers/BllAsnController.cs
index 47d4317..f9aa4a9 100644
--- a/Wms/Wms/Controllers/BllAsnController.cs
+++ b/Wms/Wms/Controllers/BllAsnController.cs
@@ -16,6 +16,9 @@
 using System.Diagnostics;
 using Model.ModelDto.SysDto;
 using static System.Reflection.Metadata.BlobBuilder;
+using WMS.DAL;
+using static System.Net.WebRequestMethods;
+using WMS.IBLL;
 
 namespace Wms.Controllers
 {
@@ -35,10 +38,11 @@
         private readonly IBllLabelBoxNoServer _labelBox;                            // 绠辩爜鏍囩
         private readonly IProcurePlanServer _procurePlanSvc;                            // 绠辩爜鏍囩
         private readonly IPalletUpShelfServer _palletUpShelfSvc;                            // 涓婃灦璁板綍
+        private readonly IHttpServer _http;
         #endregion
 
         #region 鏋勯�犲嚱鏁�
-        public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc, IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc, IOperationASNServer logSvc, IPalletUnbindServer palletUnbind, IAuditLogServer auditLog, IBllLabelBoxNoServer labelBox, IProcurePlanServer procurePlanSvc, IPalletUpShelfServer palletUpShelfSvc)
+        public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc, IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc, IOperationASNServer logSvc, IPalletUnbindServer palletUnbind, IAuditLogServer auditLog, IBllLabelBoxNoServer labelBox, IProcurePlanServer procurePlanSvc, IPalletUpShelfServer palletUpShelfSvc, IHttpServer http)
         {
             _arrivalNoticeSvc = arrivalNoticeSvc;
             _PalletBindSvc = palletBindSvc;
@@ -50,6 +54,8 @@
             _labelBox = labelBox;
             _procurePlanSvc = procurePlanSvc;
             _palletUpShelfSvc = palletUpShelfSvc;
+
+            _http = http;
         }
         #endregion
 
@@ -63,6 +69,7 @@
         [ServiceFilter(typeof(ApiResponseActionFilter))]
         public async Task<SqlSugarPagedList> GetArrivalNoticeList(ArrivalNoticeVm model)
         {
+            var models = Common.GetCarPath("141401", "040401", 1,"1");
 
             RefAsync<int> count = new RefAsync<int>();
             var bolls = await _arrivalNoticeSvc.GetArrivalNoticeList(model, count);
@@ -148,6 +155,44 @@
                 else
                 {
                     return Ok(new { code = 1, msg = strMesage });
+                }
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+        /// <summary>
+        /// 鍏ュ簱鍗曟嵁瀵煎叆
+        /// </summary>
+        /// <param name="models"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult ImportArrivalNotice(ArrivalNoticeVms models)
+        {
+            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("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+                }
+
+                models.CreateUser = int.Parse(UserId);
+                string strMessage = _arrivalNoticeSvc.ImportArrivalNotice(models);
+
+                if (strMessage.Contains("-1"))
+                {
+                    return Ok(new { code = 1, msg = strMessage });
+                }
+                else
+                {
+                    return Ok(new { code = 0, msg = strMessage });
                 }
             }
             catch (Exception e)
@@ -758,8 +803,8 @@
                 {
                     return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
                 }
-                _PalletBindSvc.ArrivalSuccessBack(taskNo, int.Parse(userId));
-
+                //_PalletBindSvc.ArrivalSuccessBack(taskNo, int.Parse(userId));
+                _http.ArrivalSuccess2(taskNo, int.Parse(userId));
                 return Ok(new { code = 0, msg = "鎴愬姛瀹屾垚浠诲姟", data = "" });
 
 

--
Gitblit v1.8.0