Compare commits

...

3 Commits

2 changed files with 18 additions and 1 deletions

View File

@@ -357,7 +357,14 @@ public class AiConfigServiceImpl implements IAiConfigService {
camOut.put("camera_id", cameraId);
camOut.put("enabled", true);
camOut.put("rtsp_url", proxy.getSrcUrl());
camOut.put("camera_name", proxy.getGbName() != null ? proxy.getGbName() : cameraId);
String cameraName = proxy.getCameraName();
if (cameraName == null || cameraName.isBlank()) {
cameraName = proxy.getGbName();
}
if (cameraName == null || cameraName.isBlank()) {
cameraName = cameraId;
}
camOut.put("camera_name", cameraName);
cameraList.add(camOut);
validCameraIds.add(cameraId);
log.debug("[AiConfig] 添加摄像头: cameraCode={}, srcUrl={}", cameraId, proxy.getSrcUrl());

View File

@@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.aiot.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.aiot.dao.AiCameraSnapshotMapper;
import com.genersoft.iot.vmp.aiot.dao.AiRoiMapper;
import com.genersoft.iot.vmp.aiot.service.IAiScreenshotService;
import com.genersoft.iot.vmp.aiot.util.CosUtil;
import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy;
@@ -55,6 +56,9 @@ public class AiScreenshotServiceImpl implements IAiScreenshotService {
@Autowired
private AiCameraSnapshotMapper snapshotMapper;
@Autowired
private AiRoiMapper roiMapper;
@Autowired
private CosUtil cosUtil;
@@ -114,6 +118,12 @@ public class AiScreenshotServiceImpl implements IAiScreenshotService {
fields.put("callback_url", callbackUrl);
}
// 查询摄像头关联的 device_id供 Edge 按设备过滤
String deviceId = roiMapper.queryDeviceIdByCameraId(cameraCode);
if (deviceId != null && !deviceId.isEmpty()) {
fields.put("device_id", deviceId);
}
// 查询 rtsp_url 放入请求,供 Edge 对无 ROI 摄像头临时连接截图
StreamProxy proxy = streamProxyMapper.selectByCameraCode(cameraCode);
if (proxy != null) {