Explorar o código

添加心跳接口相机记录表

gao.qiang hai 1 ano
pai
achega
7f99a1f23b

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

@@ -0,0 +1,45 @@
+package com.ozs.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.ozs.common.annotation.Excel;
+import com.ozs.common.core.domain.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * <p>
+ * 心跳接口相机记录表 
+ * </p>
+ *
+ * @author ozs
+ * @since 2023-02-17
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class TerminalHeartbeatLog extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 相机编码
+     */
+    private String cameraCode;
+    
+    
+}

+ 13 - 0
business-service/src/main/java/com/ozs/mapper/TerminalHeartbeatLogMapper.java

@@ -0,0 +1,13 @@
+package com.ozs.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ozs.entity.TerminalHeartbeatLog;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 心跳接口相机记录表 Mapper 接口
+ */
+@Mapper
+public interface TerminalHeartbeatLogMapper extends BaseMapper<TerminalHeartbeatLog> {
+}

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

@@ -0,0 +1,11 @@
+package com.ozs.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ozs.entity.TerminalHeartbeatLog;
+
+/**
+ * 心跳接口相机记录表 服务类
+ * @author Administrator
+ */
+public interface TerminalHeartbeatLogService extends IService<TerminalHeartbeatLog> {
+}

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

@@ -0,0 +1,14 @@
+package com.ozs.service.impl;
+
+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;
+
+/**
+ * 心跳接口相机记录表 服务类实现类
+ */
+@Service
+public class TerminalHeartbeatLogServiceImpl extends ServiceImpl<TerminalHeartbeatLogMapper, TerminalHeartbeatLog> implements TerminalHeartbeatLogService {
+}

+ 5 - 0
business-service/src/main/resources/mapper/TerminalHeartbeatLogMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ozs.mapper.TerminalHeartbeatLogMapper">
+
+</mapper>

+ 12 - 7
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -1,14 +1,11 @@
 package com.ozs.web.controller.accountmanagment;
 
-import com.alibaba.fastjson2.JSONArray;
-import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ozs.common.annotation.Log;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.core.domain.R;
 import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.enums.BusinessType;
@@ -22,14 +19,11 @@ import com.ozs.common.utils.http.HttpUtils;
 import com.ozs.common.utils.poi.ExcelUtil;
 import com.ozs.entity.*;
 import com.ozs.entity.vo.*;
-import com.ozs.framework.config.ServerConfig;
 import com.ozs.service.*;
 import com.ozs.system.service.DataScoreUtil;
 import com.ozs.system.service.ISysDeptService;
 import com.ozs.system.service.ISysDictTypeService;
 import com.ozs.utils.CameraUtil;
-import com.ozs.utils.CaneraConfig;
-import com.ozs.utils.RtspToMP4;
 import com.ozs.web.core.config.GetCameraPreviewURL;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -49,7 +43,6 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 /**
@@ -87,6 +80,8 @@ public class BaseCameraManagementController extends BaseController {
     private CameraUtil cameraUtil;
     @Autowired
     private ISysDictTypeService dictTypeService;
+    @Autowired
+    private  TerminalHeartbeatLogService terminalHeartbeatLogService;
 
 
     /**
@@ -1032,5 +1027,15 @@ public class BaseCameraManagementController extends BaseController {
         cameraUtil.videoCompression(code);
         return AjaxResult.success();
     }
+
+    @GetMapping(value = "/terminalHeartbeatLog")
+    public AjaxResult terminalHeartbeatLog() {
+        TerminalHeartbeatLog terminalHeartbeatLog=new TerminalHeartbeatLog();
+        terminalHeartbeatLog.setId(terminalHeartbeatLogService.count()+1);
+        terminalHeartbeatLog.setCameraCode("111");
+        terminalHeartbeatLog.setCreateTime(new Date());
+        boolean save = terminalHeartbeatLogService.save(terminalHeartbeatLog);
+        return AjaxResult.success(save);
+    }
 }