修复:截图请求 device_id 优先用 ROI 表,降级用 stream_proxy.edge_device_id

This commit is contained in:
2026-03-22 00:52:13 +08:00
parent 0eb2053c6f
commit e868fb8530

View File

@@ -131,9 +131,10 @@ public class AiScreenshotServiceImpl implements IAiScreenshotService {
if (rtspUrl != null && !rtspUrl.isEmpty()) { if (rtspUrl != null && !rtspUrl.isEmpty()) {
fields.put("rtsp_url", rtspUrl); fields.put("rtsp_url", rtspUrl);
} }
// 多 Edge 设备隔离:带上绑定的 edge_device_id // 多 Edge 设备隔离:优先用 ROI 表的 device_id没有则用 stream_proxy 的 edge_device_id
String edgeDeviceId = proxy.getEdgeDeviceId(); if (!fields.containsKey("device_id")) {
if (edgeDeviceId != null && !edgeDeviceId.isEmpty()) { String edgeDeviceId = proxy.getEdgeDeviceId();
if (edgeDeviceId != null && !edgeDeviceId.isEmpty()) {
fields.put("device_id", edgeDeviceId); fields.put("device_id", edgeDeviceId);
} }
} }