From 68776ef22ec56b45d0e75f81505b7896ec3f2baa Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Thu, 6 Aug 2026 11:51:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=89=AF=E5=AE=9E=E4=BE=8B=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=96=87=E4=BB=B6=E5=8A=A0=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E5=90=8E=E7=BC=80=EF=BC=88=E9=81=BF=E5=85=8D=E5=90=8C=E5=90=8D?= =?UTF-8?q?=E5=86=B2=E7=AA=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 同一 itemId 重复执行(残留 Running 状态重置重跑)时,旧副实例可能 仍持有旧文件句柄——同名覆盖/加载会触发 NW 原生加载失败弹窗。 model/route/secondary db 三个文件统一加 yyyyMMddHHmmssfff 后缀: - 每次执行文件唯一,不与旧执行冲突 - 工作目录按 item-{Id} 目录清理(不受影响) 验证:F1 批处理 30 秒完成;日志确认新格式 model-item-119-20260806115052022.nwd --- src/Core/Services/SectionBoxBatchDetector.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Core/Services/SectionBoxBatchDetector.cs b/src/Core/Services/SectionBoxBatchDetector.cs index 31fbf01..983601c 100644 --- a/src/Core/Services/SectionBoxBatchDetector.cs +++ b/src/Core/Services/SectionBoxBatchDetector.cs @@ -109,9 +109,13 @@ namespace NavisworksTransport.Core.Services Directory.CreateDirectory(workDirectory); string safeId = string.IsNullOrWhiteSpace(instanceId) ? Guid.NewGuid().ToString("N") : instanceId; - string localModelPath = Path.Combine(workDirectory, $"model-{safeId}.nwd"); - string routeFilePath = Path.Combine(workDirectory, $"route-{safeId}.json"); - string secondaryDbPath = Path.Combine(workDirectory, $"secondary-{safeId}.db"); + + // 文件名带时间戳后缀:同一 itemId 重复执行(残留状态重置重跑)时避免与 + // 旧执行的文件重名——旧副实例可能仍持有旧文件句柄,同名覆盖会触发加载失败弹窗 + string fileStamp = DateTime.Now.ToString("yyyyMMddHHmmssfff"); + string localModelPath = Path.Combine(workDirectory, $"model-{safeId}-{fileStamp}.nwd"); + string routeFilePath = Path.Combine(workDirectory, $"route-{safeId}-{fileStamp}.json"); + string secondaryDbPath = Path.Combine(workDirectory, $"secondary-{safeId}-{fileStamp}.db"); // 1. 路径剖面盒(复用产品路径盒语义:路径点 + 虚拟物体高度附加点 + 水平 4m/高度 2m 扩展) // 与 LogisticsControlViewModel.EnableClipBoxForCurrentRoute 一致(地面路径点上方、空中路径下方加物体高度)