Browse Source

智诺云AI场景识别

zhj 2 years ago
parent
commit
0103b994ab

+ 18 - 0
src/main/java/com/welampiot/controller/NewLampPoleController2.java

@@ -70,6 +70,8 @@ public class NewLampPoleController2 {
     private LightStripDevService lightStripDevService;
     @Autowired
     private OnlineLogService onlineLogService;
+    @Autowired
+    private VideoEventInfoLogService videoEventInfoLogService;
 
     /**
      * 智诺云智慧灯杆列表
@@ -857,4 +859,20 @@ public class NewLampPoleController2 {
         }
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,operationDataVO);
     }
+
+    /**
+     * 智诺云场景识别(智慧城管)
+     * @param request 灯杆id
+     * @return 场景识别
+     */
+    @RequestMapping(value = "/videoEventInfo", method = RequestMethod.POST)
+    public BaseResult<?> videoEventInfo(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request, "version", 1);
+        Integer lampPoleId = (Integer) toolUtils.getRequestContent(request, "lampPoleId", 1);
+        if (lampPoleId == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        List<VideoEventInfoLogDTO> list = videoEventInfoLogService.getVideoEventListByLampPoleId(lampPoleId);
+        VideoEventInfoLogVO videoEventInfoLogVO = new VideoEventInfoLogVO();
+        videoEventInfoLogVO.setList(list);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,videoEventInfoLogVO);
+    }
 }

+ 19 - 0
src/main/java/com/welampiot/dao/VideoEventInfoLogDao.java

@@ -0,0 +1,19 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.VideoEventInfoLogDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoEventInfoLogDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/14 - 9:55
+ * @Version: v1.0
+ */
+public interface VideoEventInfoLogDao {
+    List<VideoEventInfoLogDTO> getVideoEventListByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+}

+ 37 - 0
src/main/java/com/welampiot/dto/VideoEventInfoLogDTO.java

@@ -0,0 +1,37 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: VideoEventInfoLogDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/14 - 9:46
+ * @Version: v1.0
+ */
+@Data
+public class VideoEventInfoLogDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    private Integer lampPoleId;
+
+    private String videoMac; // 灯杆摄像头mac地址
+
+    private String address;
+
+    private String messageType; // 说明类型
+
+    private String messageInfo; // 说明描述
+
+    private String updateTime; // 事件时间
+
+    private String eventType; // 事件类型
+
+    private String imgUrl; // 事件图片地址
+}

+ 18 - 0
src/main/java/com/welampiot/service/VideoEventInfoLogService.java

@@ -0,0 +1,18 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.VideoEventInfoLogDTO;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoEventInfoLogService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/14 - 9:56
+ * @Version: v1.0
+ */
+public interface VideoEventInfoLogService {
+    List<VideoEventInfoLogDTO> getVideoEventListByLampPoleId(Integer lampPoleId);
+}

+ 29 - 0
src/main/java/com/welampiot/service/impl/VideoEventInfoLogServiceImpl.java

@@ -0,0 +1,29 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.VideoEventInfoLogDao;
+import com.welampiot.dto.VideoEventInfoLogDTO;
+import com.welampiot.service.VideoEventInfoLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoEventInfoLogServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/14 - 9:56
+ * @Version: v1.0
+ */
+@Service
+public class VideoEventInfoLogServiceImpl implements VideoEventInfoLogService {
+    @Autowired
+    private VideoEventInfoLogDao videoEventInfoLogDao;
+
+    @Override
+    public List<VideoEventInfoLogDTO> getVideoEventListByLampPoleId(Integer lampPoleId) {
+        return videoEventInfoLogDao.getVideoEventListByLampPoleId(lampPoleId);
+    }
+}

+ 23 - 0
src/main/java/com/welampiot/vo/VideoEventInfoLogVO.java

@@ -0,0 +1,23 @@
+package com.welampiot.vo;
+
+import com.welampiot.dto.VideoEventInfoLogDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: VideoEventInfoLogVO
+ * Package: com.welampiot.vo
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/14 - 10:00
+ * @Version: v1.0
+ */
+@Data
+public class VideoEventInfoLogVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private List<VideoEventInfoLogDTO> list;
+}

+ 12 - 0
src/main/resources/mapper/VideoEventInfoLogMapper.xml

@@ -0,0 +1,12 @@
+<?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.welampiot.dao.VideoEventInfoLogDao">
+
+    <select id="getVideoEventListByLampPoleId" resultType="VideoEventInfoLogDTO">
+        select v.id,v.event_type as eventType,v.message_info as messageInfo,v.updatetime as updateTime,
+               v.video_mac as address,v.img_url as imgUrl
+        from video_event_info_log v
+        where v.lamp_pole_id = #{lampPoleId}
+    </select>
+
+</mapper>