From 9075a1f4f3280d7fa468810fa750f3626f73ac54 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Thu, 22 Oct 2026 01:00:08 +0800 Subject: [PATCH] =?UTF-8?q?desktop:=20=E9=80=89=E8=B7=AF=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E8=90=BD=E6=97=A5=E5=BF=97=20+=20=E4=BA=91=E7=AB=AF=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E7=BB=93=E6=9E=9C=E5=B8=A6=E5=B8=A7=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ValidatePlaybackAsync 记录最终选路结论(云端/本机、有没有录像、给了哪些按钮), 现场排障不用再靠猜;跨网时也能直接从日志看出走没走云端。 - EdgeCheckOutcome 增加 Frames,与本地校验的展示保持一致。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- desktop/MainWindow.xaml.cs | 6 ++++++ desktop/Services/ApiClient.cs | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/desktop/MainWindow.xaml.cs b/desktop/MainWindow.xaml.cs index 4d92b59..f500ab5 100644 --- a/desktop/MainWindow.xaml.cs +++ b/desktop/MainWindow.xaml.cs @@ -1263,6 +1263,9 @@ public partial class MainWindow : Window DownloadButton.Visibility = hasVideo ? Visibility.Visible : Visibility.Collapsed; DownloadButton.IsEnabled = hasVideo; + AppLog.Write($"[route] {query.Code} 云端校验:hasVideo={hasVideo}" + + $"({cloud.ScannerSn},{cloud.Frames} 帧)→ 跨网只给下载"); + lines[0] = hasVideo ? $"云端校验:有录像({cloud.ScannerSn}),跨网只提供下载" : "云端校验:该时段没有录像"; @@ -1276,12 +1279,14 @@ public partial class MainWindow : Window PreviewButton.Visibility = Visibility.Collapsed; DownloadButton.Visibility = Visibility.Collapsed; + AppLog.Write($"[route] {query.Code} 云端判定无回放计划 → 不给按钮"); lines[0] = "这个运单算不出回放计划(扫码时该通道没绑定工作台)"; ShowPlayback(string.Join(Environment.NewLine, lines)); return; } // 云端判断不了(没有在线扫码服务 / 云端不可用)→ 本机自己校验 + AppLog.Write($"[route] {query.Code} 云端无法确认({(cloud is null ? "不可用" : cloud.State)})→ 本机校验"); lines.Add(cloud is null ? "[选路] 云端不可用,改由本机校验" : $"[选路] 云端无法确认({cloud.State}),改由本机校验"); @@ -1380,6 +1385,7 @@ public partial class MainWindow : Window else { lines[0] = "校验完成:没有拉到录像,不显示预览和下载"; + AppLog.Write($"[route] {query.Code} 本机校验:没有拉到录像 → 不给按钮"); } ShowPlayback(string.Join(Environment.NewLine, lines)); } diff --git a/desktop/Services/ApiClient.cs b/desktop/Services/ApiClient.cs index 81abdfe..1f754f8 100644 --- a/desktop/Services/ApiClient.cs +++ b/desktop/Services/ApiClient.cs @@ -525,7 +525,8 @@ public sealed class ApiClient /// 云端校验结论 /// ok / no-plan / no-device / no-credential /// true/false 可用;null 表示云端也判断不了 - public sealed record EdgeCheckOutcome(string State, bool? HasVideo, string? Message, string? ScannerSn); + /// 试拉到的帧数(SDK 路径不数帧,为 -1) + public sealed record EdgeCheckOutcome(string State, bool? HasVideo, int Frames, string? Message, string? ScannerSn); /// /// 边缘任务(跨公司取流用):云端入队,设备主动出站领取 @@ -718,7 +719,9 @@ public sealed class ApiClient } : null; - return new EdgeCheckOutcome(state, hasVideo, GetString(root, "message"), GetString(root, "scannerSn")); + return new EdgeCheckOutcome(state, hasVideo, + root.TryGetProperty("frames", out var frames) && frames.TryGetInt32(out var parsedFrames) ? parsedFrames : 0, + GetString(root, "message"), GetString(root, "scannerSn")); } ///