Explorar o código

心跳接口修改

gao.qiang hai 1 ano
pai
achega
b1e902703c

+ 1 - 0
business-service/src/main/java/com/ozs/entity/BaseCameraManagement.java

@@ -206,6 +206,7 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
      * 相机是否启用 1启用,2弃用
      */
     @TableField(exist = false)
+    @Excel(name = "相机状态")
     private String enableOrNotName;
 
     private String rtspUrl;

+ 2 - 0
business-service/src/main/java/com/ozs/entity/TerminalHeartbeatLog.java

@@ -40,6 +40,8 @@ public class TerminalHeartbeatLog extends BaseEntity implements Serializable {
      * 相机编码
      */
     private String cameraCode;
+
+    private String channel;
     
     
 }

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

@@ -48,7 +48,7 @@ public class VehiclePosition implements Serializable {
     /**
      *终端编码
      */
-    @Excel(name = "终端编码")
+    @TableField(exist = false)
     private String terminalCodes;
 
     /**

+ 6 - 0
business-service/src/main/java/com/ozs/entity/vo/BaseCameraManagementVos.java

@@ -89,4 +89,10 @@ public class BaseCameraManagementVos implements Serializable {
 
     @Excel(name = "监视方向")
     private String monitoringDirectionName;
+
+    /**
+     * 相机是否启用 1启用,2弃用
+     */
+    @Excel(name = "相机状态")
+    private String enableOrNotName;
 }

+ 2 - 0
business-service/src/main/java/com/ozs/service/TerminalHeartbeatLogService.java

@@ -8,4 +8,6 @@ import com.ozs.entity.TerminalHeartbeatLog;
  * @author Administrator
  */
 public interface TerminalHeartbeatLogService extends IService<TerminalHeartbeatLog> {
+
+     void add(String code,String channel);
 }

+ 6 - 0
business-service/src/main/java/com/ozs/service/impl/BaseCameraManagementServiceImpl.java

@@ -165,6 +165,9 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
                                         }
                                     }
                                 }
+                                if (!StringUtils.isEmpty(cameraManagementVos.getEnableOrNotName())) {
+                                    accountManagement.setEnableOrNot(cameraManagementVos.getEnableOrNotName().equals("启用") ? 1 : 2);
+                                }
                                 baseCameraManagementMapper.insert(accountManagement);
                                 BaseDeviceDynamicManagement baseDeviceDynamicManagement = new BaseDeviceDynamicManagement();
                                 baseDeviceDynamicManagement.setCameraCode(accountManagement.getCameraCode());
@@ -205,6 +208,9 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
                             }
                         }
                     }
+                    if (!StringUtils.isEmpty(cameraManagementVos.getEnableOrNotName())) {
+                        accountManagement.setEnableOrNot(cameraManagementVos.getEnableOrNotName().equals("启用") ? 1 : 2);
+                    }
                     baseCameraManagementMapper.update(accountManagement, lw);
                     LambdaQueryWrapper<BaseDeviceDynamicManagement> wrapper = new LambdaQueryWrapper<BaseDeviceDynamicManagement>();
                     if (!StringUtils.isEmptySunhh(baseAccountManagement.getCameraCode())) {

+ 16 - 0
business-service/src/main/java/com/ozs/service/impl/TerminalHeartbeatLogServiceImpl.java

@@ -1,14 +1,30 @@
 package com.ozs.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.entity.TerminalHeartbeatLog;
 import com.ozs.mapper.TerminalHeartbeatLogMapper;
 import com.ozs.service.TerminalHeartbeatLogService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.Date;
+
 /**
  * 心跳接口相机记录表 服务类实现类
  */
 @Service
 public class TerminalHeartbeatLogServiceImpl extends ServiceImpl<TerminalHeartbeatLogMapper, TerminalHeartbeatLog> implements TerminalHeartbeatLogService {
+    
+    
+    
+    @Override
+    public void add(String code,String channel){
+        TerminalHeartbeatLog terminalHeartbeatLog=new TerminalHeartbeatLog();
+        terminalHeartbeatLog.setId((long) (baseMapper.selectCount(new QueryWrapper<>()) + 1));
+        terminalHeartbeatLog.setCameraCode(code);
+        terminalHeartbeatLog.setChannel(channel);
+        terminalHeartbeatLog.setCreateTime(new Date());
+        baseMapper.insert(terminalHeartbeatLog);
+    }
 }

+ 12 - 0
business-service/src/main/java/com/ozs/utils/CameraUtil.java

@@ -968,6 +968,18 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         }
     }
 
+//    public  String stopStream(String cameraIndexCode, String channel) {
+//        try {
+//            log.info("code---------->" + httpUrl + "/api/gateway/stop?streamPath=" + cameraIndexCode + "/" + channel);
+//            String code = HttpUtils.sendGet(httpUrl + "/api/gateway/stop?stream=" + cameraIndexCode + "/" + channel);
+//            log.info("code---------->" + code);
+//            return code;
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        return null;
+//    }
+
     /**
      * web页面实时流调用的远程天网接口
      * @param camerasVo

BIN=BIN
vehicle-admin/src/main/resources/template/baseCameraManagement.xlsx


+ 0 - 1
vehicle-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

@@ -289,7 +289,6 @@ public class GeoHazardMonitorTokenController {
                 wrapper.le(BaseCameraManagement::getBeginMile, reqMsgAlarmVo.getAlarmMile());
                 wrapper.ge(BaseCameraManagement::getEndMile, reqMsgAlarmVo.getAlarmMile());
                 wrapper.eq(BaseCameraManagement::getRailwayCode, reqMsgAlarmVo.getAlarmRailway());
-                wrapper.eq(BaseCameraManagement::getLineDir, reqMsgAlarmVo.getLineDir());
                 wrapper.eq(BaseCameraManagement::getEnableOrNot, 1);
             }
             List<BaseCameraManagement> baseCameraManagementList = baseCameraManagementService.list(wrapper);