Jelajahi Sumber

添加视频管理

523096025 4 tahun lalu
induk
melakukan
2960882040

+ 17 - 1
huimv-smart-management/src/main/java/com/huimv/management/service/impl/CameraInfoServiceImpl.java

@@ -2,10 +2,13 @@ package com.huimv.management.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.huimv.management.dao.CameraBrandDao;
 import com.huimv.management.dao.PastureAreaDao;
 import com.huimv.management.dao.PublicNetworkDao;
+import com.huimv.management.entity.CameraBrandEntity;
 import com.huimv.management.entity.PublicNetworkEntity;
 import org.apache.commons.lang.StringUtils;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -36,6 +39,9 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoDao, CameraInfo
     @Autowired
     private PastureAreaDao pastureAreaDao;
 
+    @Autowired
+    private CameraBrandDao cameraBrandDao;
+
 
     @Override
     public PageUtils queryPage(Map<String, Object> params) {
@@ -83,7 +89,17 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoDao, CameraInfo
         String cameraPassword = cameraInfo.getPassword();
         String camerIp = cameraInfo.getIp();
         Integer areaId = cameraInfo.getAreaId();
-        String rtsp = cameraInfo.getRtsp();
+
+
+        String rtsp ;
+        CameraBrandEntity cameraBrandEntity = cameraBrandDao.selectById(cameraInfo.getCameraBrandId());
+        Boolean type = cameraBrandEntity.getType();
+        if (type){
+            rtsp = cameraBrandEntity.getMainStream();
+        }else {
+            rtsp = cameraBrandEntity.getAssistStream();
+        }
+
         map.put("wsUrl", "ws://" + url + "/camera_relay?tcpaddr=" + cameraAccount + "%3A" + cameraPassword + "%40" + camerIp);
         map.put("rtspUrl", "rtsp://" + cameraAccount + ":" + cameraPassword + "@" + camerIp + rtsp);
         map.put("areaId", areaId);