Explorar o código

流媒体推流增加预留时间

gao.qiang hai 1 ano
pai
achega
46410f5143

+ 18 - 0
business-service/src/main/java/com/ozs/entity/vo/BaseVehicleTerminalDto.java

@@ -1,9 +1,11 @@
 package com.ozs.entity.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.core.domain.BaseEntity;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * 车载终端和日志信息表
@@ -58,4 +60,20 @@ public class BaseVehicleTerminalDto implements Serializable {
      * 线路编码(四位数字)
      */
     private String railwayCode;
+
+    /**
+     * 相机编码
+     */
+    private  String cameraCode;
+
+    /**
+     * 流
+     */
+    private String url;
+
+    /**
+     * 当前时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date time;
 }

+ 1 - 1
business-service/src/main/java/com/ozs/service/BaseCameraManagementService.java

@@ -44,5 +44,5 @@ public interface BaseCameraManagementService extends IService<BaseCameraManageme
 
     AjaxResult nonContactAlarmCamera(String cameraCode);
 
-    List<String> videoCaptureUrl(BaseVehicleTerminalDto baseVehicleTerminalDto);
+    List<BaseVehicleTerminalDto> videoCaptureUrl(BaseVehicleTerminalDto baseVehicleTerminalDto);
 }

+ 13 - 3
business-service/src/main/java/com/ozs/service/impl/BaseCameraManagementServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.generator.config.IFileCreate;
 import com.github.pagehelper.PageHelper;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.exception.ServiceException;
+import com.ozs.common.utils.AppendUtils;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.bean.BeanUtils;
 import com.ozs.common.utils.bean.BeanValidators;
@@ -60,6 +61,8 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
     private BaseRailwayManagementService baseRailwayManagementService;
     @Autowired
     private SkynetHeartbeatLogMapper skynetHeartbeatLogMapper;
+    @Autowired
+    private BaseRailwayManagementMapper baseRailwayManagementMapper;
 
     /**
      * 相机台账管理表导入
@@ -415,8 +418,8 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
     }
 
     @Override
-    public List<String> videoCaptureUrl(BaseVehicleTerminalDto baseVehicleTerminalDto) {
-        List<String> urlList = new ArrayList<>();
+    public List<BaseVehicleTerminalDto> videoCaptureUrl(BaseVehicleTerminalDto baseVehicleTerminalDto) {
+        List<BaseVehicleTerminalDto> urlList = new ArrayList<>();
         LambdaQueryWrapper<BaseCameraManagement> camera = new LambdaQueryWrapper<BaseCameraManagement>();
         camera.ge(BaseCameraManagement::getBeginMile, baseVehicleTerminalDto.getTravelMile());
         camera.eq(BaseCameraManagement::getLineDir, baseVehicleTerminalDto.getLineDir());
@@ -430,7 +433,14 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
             List<BaseCameraManagement> list = new ArrayList<>(baseCameraManagementList);
             for (BaseCameraManagement baseCameraManagement : list) {
                 String flv = CameraUtil.getPlayFlv(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel());
-                urlList.add(flv);
+                BaseVehicleTerminalDto dto=new BaseVehicleTerminalDto();
+                dto.setUrl(flv);
+                dto.setCameraCode(baseCameraManagement.getCameraCode());
+                dto.setTime(new Date());
+                BaseRailwayManagement baseRailwayManagement = baseRailwayManagementMapper.selectOne(new QueryWrapper<BaseRailwayManagement>().eq("railway_code", baseVehicleTerminalDto.getRailwayCode()));
+                dto.setRailwayName(baseRailwayManagement.getRailwayName());
+                dto.setLineDir(baseVehicleTerminalDto.getLineDir());
+                String mils = AppendUtils.stringAppend(baseVehicleTerminalDto.getTravelMile());
             }
         }
         return urlList;