From 5953113240802cd0545fb94e6c4e6d413ece74cc Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 24 三月 2026 11:50:07 +0800
Subject: [PATCH] WMS新增缺失前端页面并接入路由

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs |   43 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
index c7ad96a..a4c4868 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
@@ -7,16 +7,38 @@
 namespace WIDESEA_StockService
 {
     /// <summary>
-    /// 搴撳瓨鏈嶅姟
+    /// 搴撳瓨鏈嶅姟鑱氬悎瀹炵幇绫�
     /// </summary>
-    public class StockSerivce : IStockService
+    public class StockService : IStockService
     {
+        /// <summary>
+        /// 搴撳瓨鏄庣粏鏈嶅姟
+        /// </summary>
         public IStockInfoDetailService StockInfoDetailService { get; }
+
+        /// <summary>
+        /// 搴撳瓨淇℃伅鏈嶅姟
+        /// </summary>
         public IStockInfoService StockInfoService { get; }
+
+        /// <summary>
+        /// 搴撳瓨鏄庣粏鍘嗗彶鏈嶅姟
+        /// </summary>
         public IStockInfoDetail_HtyService StockInfoDetail_HtyService { get; }
+
+        /// <summary>
+        /// 搴撳瓨鍘嗗彶鏈嶅姟
+        /// </summary>
         public IStockInfo_HtyService StockInfo_HtyService { get; }
 
-        public StockSerivce(
+        /// <summary>
+        /// 鏋勯�犲嚱鏁�
+        /// </summary>
+        /// <param name="stockInfoDetailService">搴撳瓨鏄庣粏鏈嶅姟</param>
+        /// <param name="stockInfoService">搴撳瓨淇℃伅鏈嶅姟</param>
+        /// <param name="stockInfoDetail_HtyService">搴撳瓨鏄庣粏鍘嗗彶鏈嶅姟</param>
+        /// <param name="stockInfo_HtyService">搴撳瓨鍘嗗彶鏈嶅姟</param>
+        public StockService(
             IStockInfoDetailService stockInfoDetailService,
             IStockInfoService stockInfoService,
             IStockInfoDetail_HtyService stockInfoDetail_HtyService,
@@ -79,6 +101,7 @@
         /// </summary>
         public async Task<WebResponseContent> ChangePalletAsync(StockDTO stock)
         {
+
             WebResponseContent content = new WebResponseContent();
             if (stock == null ||
                 string.IsNullOrWhiteSpace(stock.TargetPalletNo) ||
@@ -88,7 +111,7 @@
                 return content.Error("婧愭墭鐩樺彿涓庣洰鏍囨墭鐩樺彿鐩稿悓");
             }
 
-            var sourceStock = StockInfoService.Repository.QueryFirst(s => s.PalletCode == stock.SourcePalletNo);
+            var sourceStock = await StockInfoService.Repository.QueryDataNavFirstAsync(s => s.PalletCode == stock.SourcePalletNo);
             if (sourceStock == null) return content.Error("婧愭墭鐩樹笉瀛樺湪");
 
             var targetStock = StockInfoService.Repository.QueryFirst(s => s.PalletCode == stock.TargetPalletNo);
@@ -98,8 +121,8 @@
                 {
                     PalletCode = stock.TargetPalletNo,
                     WarehouseId = sourceStock.WarehouseId,
-                    StockStatus = sourceStock.StockStatus,
-                    Creater = "system"
+                    StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.GetHashCode(),
+                    Creater = "system",
                 };
 
                 var newId = StockInfoService.Repository.AddData(newStock);
@@ -109,11 +132,11 @@
                 targetStock.Id = newId;
             }
 
-            var serialNumbers = stock.Details.Select(d => d.CellBarcode).Distinct().ToList();
+            var serialNumbers = stock.Details.Select(d => d.Channel).Distinct().ToList();
             if (!serialNumbers.Any()) return content.Error("鏈壘鍒版湁鏁堢殑搴忓垪鍙�");
 
             var detailEntities = StockInfoDetailService.Repository.QueryData(
-                d => d.StockId == sourceStock.Id && serialNumbers.Contains(d.SerialNumber));
+                d => d.StockId == sourceStock.Id && serialNumbers.Contains(d.InboundOrderRowNo));
             if (!detailEntities.Any()) return content.Error("鏈壘鍒版湁鏁堢殑搴撳瓨鏄庣粏");
 
             if (await StockInfoDetail_HtyService.Repository.AddDataAsync(CreateDetailHistory(detailEntities, "鎹㈢洏")) <= 0)
@@ -231,7 +254,9 @@
                 Creater = s.Creater,
                 CreateDate = s.CreateDate,
                 Modifier = s.Modifier,
-                ModifyDate = s.ModifyDate
+                ModifyDate = s.ModifyDate,
+                LocationId = s.LocationId,
+                OutboundDate = s.OutboundDate
             }).ToList();
         }
     }

--
Gitblit v1.9.3