wanshenmean
2026-03-27 15f1d6ad5ea19303fa8533c76d394ec3a873d061
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
@@ -409,9 +409,9 @@
                    // 返回去重后的位置列表
                    return positions.GroupBy(x => x).Select(x => x.Key).ToList();
                }
                catch
                catch (Exception ex)
                {
                    ConsoleHelper.WriteErrorLine($"RouterService.QueryAllPositions 查询失败: {ex.Message}");
                }
                finally
                {
@@ -608,7 +608,15 @@
                // 重新查询全量路由(此时才包含新增的路由),再写入缓存
                List<Dt_Router> updatedRouters = BaseDal.QueryData(x => x.InOutType == routerType);
                string cacheKey = $"Router:AllRouters:{(routerType == RouterInOutType.In.ObjToInt() ? "In" : "Out")}";
                _cacheService.AddOrUpdate(cacheKey, updatedRouters);
                try
                {
                    _cacheService.AddOrUpdate(cacheKey, updatedRouters);
                }
                catch
                {
                    // 缓存更新失败时静默忽略,下次查询会从DB自动重建缓存
                }
                content = WebResponseContent.Instance.OK();
            }