From 9a6e0187d0994bcfc30cd48bad65b8b17a6f4ba1 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 09 三月 2026 09:33:44 +0800
Subject: [PATCH] config: 注册 RoundRobinService 为单例服务

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
index 31d8b0d..6ade9de 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
@@ -1,5 +1,4 @@
-锘縰sing AutoMapper;
-using WIDESEA_Common.StockEnum;
+锘縰sing WIDESEA_Common.StockEnum;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
 using WIDESEA_IStockService;
@@ -9,52 +8,59 @@
 {
     public partial class StockInfoService : ServiceBase<Dt_StockInfo, IRepository<Dt_StockInfo>>, IStockInfoService
     {
-        private readonly IMapper _mapper;
-
         public IRepository<Dt_StockInfo> Repository => BaseDal;
 
-        public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IMapper mapper) : base(BaseDal)
+        public StockInfoService(IRepository<Dt_StockInfo> BaseDal) : base(BaseDal)
         {
-            _mapper = mapper;
         }
 
         /// <summary>
         /// 鑾峰彇搴撳瓨淇℃伅鍒楄〃锛堝嚭搴撴棩鏈熷皬浜庡綋鍓嶆椂闂翠笖搴撳瓨鐘舵�佷负鍏ュ簱瀹屾垚鐨勮褰曪級
         /// </summary>
-        /// <returns></returns>
         public async Task<List<Dt_StockInfo>> GetStockInfoAsync()
         {
-            return await BaseDal.QueryDataAsync(x => x.OutboundDate < DateTime.Now && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode());
+            return await BaseDal.QueryDataAsync(x =>
+                x.OutboundDate < DateTime.Now &&
+                x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode());
         }
 
         /// <summary>
         /// 鑾峰彇搴撳瓨淇℃伅鍒楄〃锛堝嚭搴撴棩鏈熷皬浜庡綋鍓嶆椂闂翠笖搴撳瓨鐘舵�佷负鍏ュ簱瀹屾垚鐨勮褰曪紝涓斾粨搴揑D鍖归厤锛�
         /// </summary>
-        /// <param name="WarehouseId"></param>
-        /// <returns></returns>
-        public async Task<List<Dt_StockInfo>> GetStockInfoAsync(int WarehouseId)
+        public async Task<List<Dt_StockInfo>> GetStockInfoAsync(int warehouseId)
         {
-            return await BaseDal.QueryDataAsync(x => x.OutboundDate < DateTime.Now && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode() && x.WarehouseId == WarehouseId);
+            return await BaseDal.QueryDataAsync(x =>
+                x.OutboundDate < DateTime.Now &&
+                x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode() &&
+                x.WarehouseId == warehouseId);
         }
 
         /// <summary>
         /// 鑾峰彇搴撳瓨淇℃伅锛堟牴鎹墭鐩樼爜鏌ヨ锛�
         /// </summary>
-        /// <param name="PalletCode"></param>
-        /// <returns></returns>
-        public async Task<Dt_StockInfo> GetStockInfoAsync(string PalletCode)
+        public async Task<Dt_StockInfo> GetStockInfoAsync(string palletCode)
         {
-            return await BaseDal.QueryFirstAsync(x => x.PalletCode == PalletCode);
+            return await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode);
         }
 
         /// <summary>
         /// 鏇存柊搴撳瓨鏁版嵁
         /// </summary>
-        /// <param name="stockInfo"></param>
-        /// <returns></returns>
         public async Task<bool> UpdateStockAsync(Dt_StockInfo stockInfo)
         {
             return await BaseDal.UpdateDataAsync(stockInfo);
         }
+
+
+        /// <summary>
+        /// 妫�绱㈡寚瀹氭墭鐩樺湪缁欏畾浣嶇疆鐨勫簱瀛樿缁嗕俊鎭��
+        /// </summary>
+        /// <param name="palletCode">璇锋眰搴撳瓨淇℃伅鐨勬墭鐩樺敮涓�鏍囪瘑绗︺�備笉鑳戒负 null 鎴栫┖銆�</param>
+        /// <param name="locationCode">琛ㄧず鎵樼洏瀛樺偍浣嶇疆鐨勪唬鐮併�備笉鑳戒负 null 鎴栫┖銆�</param>
+        /// <returns>琛ㄧず寮傛鎿嶄綔鐨勪换鍔°�備换鍔$粨鏋滃寘鍚竴涓� <see cref="Dt_StockInfo"/> 瀵硅薄锛岃瀵硅薄鍖呭惈鎸囧畾鎵樼洏鍜屼綅缃殑搴撳瓨璇︾粏淇℃伅銆傚鏋滄湭鎵惧埌鍖归厤鐨勫簱瀛樹俊鎭紝鍒欒繑鍥� null銆�</returns>
+        public async Task<Dt_StockInfo> GetStockInfoAsync(string palletCode, string locationCode)
+        {
+            return await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode && x.LocationCode == locationCode);
+        }
     }
 }

--
Gitblit v1.9.3