From d4cae5c48af02e109b1febce8c7c21e560cd6525 Mon Sep 17 00:00:00 2001
From: xxyy <cathay_xy@163.com>
Date: 星期二, 18 三月 2025 14:23:55 +0800
Subject: [PATCH] 更新配置和代码逻辑,优化查询及日志

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
index a60279f..2d7637b 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
@@ -1,4 +1,5 @@
-锘縰sing SqlSugar;
+锘縰sing Masuit.Tools;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -98,7 +99,11 @@
                 }
                 visitedRoutes.Add(routeKey);
 
-                List<Dt_Router> dt_Routers = BaseDal.QueryData(x => x.NextPosi == endPosi || x.ChildPosi == endPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } });
+                List<Dt_Router> dt_Routers = BaseDal.QueryData(x => (x.NextPosi == endPosi || x.ChildPosi == endPosi) && x.StartPosi == startPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } });
+                if (dt_Routers.IsNullOrEmpty())
+                {
+                    dt_Routers = BaseDal.QueryData(x => x.NextPosi == endPosi || x.ChildPosi == endPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } });
+                }
                 if (dt_Routers.Count > 0)
                 {
                     foreach (var item in dt_Routers)
@@ -264,7 +269,7 @@
                     {
                         if (routerType == (int)RouterInOutType.Out)
                             router.ChildPosi = routersAddDTOs[i + 1].ChildPositionCode;
-                         router.IsEnd = true;
+                        router.IsEnd = true;
                     }
                     routers.Add(router);
                 }

--
Gitblit v1.9.3