From b50c79d022c363b1d5ad582e9ef7d71fd7e7f427 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 27 三月 2026 14:30:22 +0800
Subject: [PATCH] feat(RouterService): 新增 QueryRoutersByDeviceCode 设备路由查询

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
index 5ea6ce5..e65e3b2 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
@@ -65,6 +65,22 @@
         }
 
         /// <summary>
+        /// 鏍规嵁璁惧缂栧彿鏌ヨ缁忚繃璇ヨ澶囩殑鎵�鏈夎矾鐢憋紙鍚堝苟鍏ュ彛+鍑哄彛绫诲瀷锛�
+        /// </summary>
+        /// <param name="deviceCode">璁惧缂栧彿</param>
+        /// <returns>缁忚繃璇ヨ澶囩殑璺敱鍒楄〃</returns>
+        public List<Dt_Router> QueryRoutersByDeviceCode(string deviceCode)
+        {
+            // 浠庣紦瀛樿幏鍙栧叆鍙g被鍨嬪拰鍑哄彛绫诲瀷鐨勫叏閲忚矾鐢辨暟鎹�
+            List<Dt_Router> inRouters = GetAllRoutersFromCache(RouterInOutType.In.ObjToInt());
+            List<Dt_Router> outRouters = GetAllRoutersFromCache(RouterInOutType.Out.ObjToInt());
+            // 鍚堝苟鍚庣瓫閫夊嚭缁忚繃鎸囧畾璁惧鐨勮矾鐢憋紙ChildPosiDeviceCode鍖归厤锛�
+            return inRouters.Concat(outRouters)
+                .Where(x => x.ChildPosiDeviceCode == deviceCode)
+                .ToList();
+        }
+
+        /// <summary>
         /// 鏍规嵁璧风偣/褰撳墠浣嶇疆銆佺粓鐐硅幏鍙栦笅涓�涓瓙鑺傜偣銆�
         /// </summary>
         /// <param name="startPosi">璧风偣/褰撳墠浣嶇疆銆�</param>

--
Gitblit v1.9.3