From 0cff495331ea774acfbe212fb0180b99806a6e7f Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Wed, 3 Jun 2026 20:44:52 +0800 Subject: [PATCH] fix: prevent duplicate database save during XML import deserialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ParseRouteElement used route.AddPoint() which called RecalculateAndSaveRoute - This saved the path to DB with original name before ImportPathCommand could rename it - Changed to route.Points.Add() + route.RecalculateRoute() to skip DB save - Only ImportPathCommand → AddRoute → SavePathToDatabase now persists renamed path --- src/Core/PathDataManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Core/PathDataManager.cs b/src/Core/PathDataManager.cs index c78ae3f..e509919 100644 --- a/src/Core/PathDataManager.cs +++ b/src/Core/PathDataManager.cs @@ -1594,10 +1594,12 @@ namespace NavisworksTransport var point = ParsePointElement(pointNode); if (point != null) { - route.AddPoint(point); + route.Points.Add(point); } } } + // 仅在内存中重建几何/索引,不触发数据库保存 + route.RecalculateRoute("XML导入"); } return route;