Bladeren bron

摄像头列表、资产日志信息

zhj 2 jaren geleden
bovenliggende
commit
5bfc178cb3

+ 35 - 0
src/main/java/com/welampiot/controller/DataController.java

@@ -209,4 +209,39 @@ public class DataController {
         operationDataVO.setData(sysInfoCount);
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,operationDataVO);
     }
+
+    /**
+     * 日志信息
+     * @param request 设备类型,操作类型
+     * @return 日志信息
+     */
+    @RequestMapping(value = "/sysLog", method = RequestMethod.POST)
+    public BaseResult<?> sysLog(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer type = (Integer) toolUtils.getRequestContent(request,"type",1);
+        Integer operaType = (Integer) toolUtils.getRequestContent(request,"operaType",1);
+        if (type == 0 || operaType == 0)
+            return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+
+        if (type == 4) { // 视频监控
+            VideoMonitorVO vo = videoMonitorService.getVideoListBySectionList(toolUtils.getSectionList(request));
+            return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
+        } else if (type == 3) { // 待处理故障
+            AllAlarmInfoLogVO allAlarmInfoLogVO = new AllAlarmInfoLogVO();
+            allAlarmInfoLogVO.setSectionList(toolUtils.getSectionList(request));
+            allAlarmInfoLogVO.setVersion(version);
+            List<AllAlarmInfoLogDTO> alarmList = alarmInfoLogService.getAlarmOperationList(allAlarmInfoLogVO);
+            AllAlarmInfoLogVO vo = new AllAlarmInfoLogVO();
+            vo.setList(alarmList);
+            return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
+        } else { // 路灯、灯杆
+            OperationLogVO operationLogVO = new OperationLogVO();
+            operationLogVO.setDevType(type);
+            operationLogVO.setOperaType(operaType);
+            List<OperationLogDTO> operationLogList = operationLogService.getOperationLogList(operationLogVO);
+            OperationLogVO vo = new OperationLogVO();
+            vo.setList(operationLogList);
+            return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
+        }
+    }
 }

+ 66 - 0
src/main/java/com/welampiot/controller/NewLampPoleController.java

@@ -61,6 +61,8 @@ public class NewLampPoleController {
     private LampPoleAlarmLogService lampPoleAlarmLogService;
     @Autowired
     private LampInfoLogNewService lampInfoLogNewService;
+    @Autowired
+    private VideoMonitorService videoMonitorService;
 
     @RequestMapping(value = "/info",method = RequestMethod.POST)
     public BaseResult info(HttpServletRequest request){
@@ -830,4 +832,68 @@ public class NewLampPoleController {
         lampDataVO.setConDayEle(formatConDayEle);
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampDataVO);
     }
+
+    /**
+     * 摄像头列表
+     * @param request sectionList、areaId、sectionId
+     * @return 摄像头列表
+     */
+    @RequestMapping(value = "/videoInfoList", method = RequestMethod.POST)
+    public BaseResult<?> videoInfoList(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request, "version", 1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request, "areaId", 1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request, "sectionId", 1);
+        int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
+        int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
+
+        VideoMonitorVO videoMonitorVO = new VideoMonitorVO();
+        videoMonitorVO.setLimit(count * (page - 1));
+        videoMonitorVO.setOffset(count);
+        videoMonitorVO.setAreaId(areaId);
+        videoMonitorVO.setSectionId(sectionId);
+        videoMonitorVO.setSectionList(toolUtils.getSectionList(request));
+        List<VideoMonitorDTO> videoInfoList = videoMonitorService.getVideoInfoList(videoMonitorVO);
+        List<VideoMonitorDTO> list = new ArrayList<>();
+        videoInfoList.forEach(dto ->  {
+            if (dto.getLampPoleName() == null) {
+                dto.setLampPoleName("");
+            }
+            dto.setToken("");
+            dto.setEzOpen("");
+            dto.setEzOpenHd("");
+            dto.setIsMse(0);
+            dto.setMseUrl("");
+            dto.setUuid("");
+            list.add(dto);
+        });
+        Integer videoTotal = videoMonitorService.getVideoTotal(videoMonitorVO);
+        VideoMonitorVO vo = new VideoMonitorVO();
+        vo.setList(list);
+        vo.setTotal(videoTotal);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
+    }
+
+    /**
+     * 摄像头数据概览
+     * @param request sectionList、areaId、sectionId
+     * @return 摄像头数据概览
+     */
+    @RequestMapping(value = "/videoInfo", method = RequestMethod.POST)
+    public BaseResult<?> videoInfo(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request, "version", 1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request, "areaId", 1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request, "sectionId", 1);
+        VideoMonitorVO videoMonitorVO = new VideoMonitorVO();
+        videoMonitorVO.setAreaId(areaId);
+        videoMonitorVO.setSectionId(sectionId);
+        videoMonitorVO.setSectionList(toolUtils.getSectionList(request));
+        Integer videoTotal = videoMonitorService.getVideoTotal(videoMonitorVO);
+        Integer videoUsableTotal = videoMonitorService.getVideoUsableTotal(videoMonitorVO);
+        Integer videoOnlineTotal = videoMonitorService.getVideoOnlineTotal(videoMonitorVO);
+        VideoMonitorVO vo = new VideoMonitorVO();
+        vo.setTotal(videoTotal);
+        vo.setOnlineCount(videoOnlineTotal);
+        vo.setUseCount(videoUsableTotal);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
+    }
 }

+ 2 - 0
src/main/java/com/welampiot/dao/AllAlarmInfoLogDao.java

@@ -44,4 +44,6 @@ public interface AllAlarmInfoLogDao {
     AllAlarmInfoLogDTO getAlarmInfoDTOById(@Param("id") Integer id, @Param("version") Integer version);
 
     void deleteAlarmData(@Param("id") Integer id);
+
+    List<AllAlarmInfoLogDTO> getAlarmOperationList(AllAlarmInfoLogVO vo);
 }

+ 3 - 1
src/main/java/com/welampiot/dao/OperationLogDao.java

@@ -17,5 +17,7 @@ public interface OperationLogDao {
 
     Integer getRoleByUsername(OperationLogVO vo);
 
-    Integer deleteLogListById(@Param("id") Integer id);
+    void deleteLogListById(@Param("id") Integer id);
+
+    List<OperationLogDTO> getOperationLogList(OperationLogVO vo);
 }

+ 6 - 0
src/main/java/com/welampiot/dao/VideoMonitorDao.java

@@ -10,4 +10,10 @@ public interface VideoMonitorDao {
     List<VideoMonitorDTO> getListByVO(VideoMonitorVO vo);
     List<VideoMonitorDTO> getVideoListBySectionList(@Param("sectionList") List<Integer> sectionList);
     void changeVideoMonitorLocationById(VideoMonitorDTO dto);
+    List<VideoMonitorDTO> getVideoInfoListByVO(VideoMonitorVO vo);
+    Integer getVideoTotal(VideoMonitorVO vo);
+
+    Integer getVideoOnlineTotal(VideoMonitorVO vo);
+
+    Integer getVideoUsableTotal(VideoMonitorVO vo);
 }

+ 51 - 0
src/main/java/com/welampiot/dto/VideoMonitorDTO.java

@@ -9,4 +9,55 @@ public class VideoMonitorDTO {
     private String image;
     private String longitude;
     private String latitude;
+    private Integer sectionId;
+    private Integer areaId;
+    private String address;
+    private String createTime;
+    private Integer status;
+    private String devId;
+    private String password;
+    private String channel;
+    private Integer type;
+    private String hls;
+    private String hlsHd;
+    private String rtmp;
+    private String rtmpHd;
+    private Integer lampPoleId;
+    private String lampPoleName;
+    private Integer isOpen;
+    private Integer peopleCountTotal; // 总人流量
+    private Integer dayPersonCountTotal; // 当日人数统计
+    private Integer manCount; // 男性数量
+    private Integer womanCount; // 女性数量
+    private Integer age1Count; // 年龄小于10岁的数量
+    private Integer age2Count; // 10-20岁人数
+    private Integer age3Count; // 20-30岁人数
+    private Integer age4Count; // 30-40岁人数
+    private Integer age5Count; // 40-50岁人数
+    private Integer age6Count; // 50-60岁人数
+    private Integer age7Count; // 60岁以上人数
+    private Integer carCountTotal; // 总车流量
+    private Integer dayCarCountTotal; // 当日车流量统计
+    private String faceSetId; // 人脸集合标识
+    private String faceImage; // 人脸对比图
+    private Integer isInspect; // 是否开启人脸识别(0 关闭,1 开启)
+    private Integer deviceType; // 人脸监测心跳时间
+    private Integer netStatus; // 网络状态
+    private String lastTime; // 上一次查看时间
+    private Integer isAuto; // 是否开始自动巡航(0 否,1 是)
+    private String gbAddress;
+    private String gbAddress2; // 红外国标地址
+    private Integer netType; // 设备接入类型
+    private String ipAddr; // ip地址
+    private String devPwd; // 密码
+    private String steam;
+    private String backAddress; // 设备上一次回放地址
+    private String installDate; // 安装时间
+    private String expirationDate; // 过期时间
+    private String token;
+    private String ezOpen;
+    private String ezOpenHd;
+    private Integer isMse;
+    private String mseUrl;
+    private String uuid;
 }

+ 2 - 0
src/main/java/com/welampiot/service/AllAlarmInfoLogService.java

@@ -43,4 +43,6 @@ public interface AllAlarmInfoLogService {
     AllAlarmInfoLogDTO getAlarmInfoDTOById(Integer id, Integer version);
 
     void deleteAlarmData(Integer id);
+
+    List<AllAlarmInfoLogDTO> getAlarmOperationList(AllAlarmInfoLogVO vo);
 }

+ 2 - 0
src/main/java/com/welampiot/service/OperationLogService.java

@@ -11,4 +11,6 @@ public interface OperationLogService {
     OperationLogVO getLogListByVO(OperationLogVO vo);
 
     void deleteLogListById(Integer id);
+
+    List<OperationLogDTO> getOperationLogList(OperationLogVO vo);
 }

+ 4 - 0
src/main/java/com/welampiot/service/VideoMonitorService.java

@@ -9,4 +9,8 @@ public interface VideoMonitorService {
     List<VideoMonitorDTO> getListByVO(VideoMonitorVO vo);
     VideoMonitorVO getVideoListBySectionList(List<Integer> sectionList);
     void changeVideoMonitorLocationById(VideoMonitorDTO dto);
+    List<VideoMonitorDTO> getVideoInfoList(VideoMonitorVO vo);
+    Integer getVideoTotal(VideoMonitorVO vo);
+    Integer getVideoOnlineTotal(VideoMonitorVO vo);
+    Integer getVideoUsableTotal(VideoMonitorVO vo);
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/AllAlarmInfoLogServiceImpl.java

@@ -187,4 +187,9 @@ public class AllAlarmInfoLogServiceImpl implements AllAlarmInfoLogService {
     public void deleteAlarmData(Integer id) {
         allAlarmInfoLogDao.deleteAlarmData(id);
     }
+
+    @Override
+    public List<AllAlarmInfoLogDTO> getAlarmOperationList(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getAlarmOperationList(vo);
+    }
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/OperationLogServiceImpl.java

@@ -105,4 +105,9 @@ public class OperationLogServiceImpl implements OperationLogService {
     public void deleteLogListById(Integer id) {
         operationLogDao.deleteLogListById(id);
     }
+
+    @Override
+    public List<OperationLogDTO> getOperationLogList(OperationLogVO vo) {
+        return operationLogDao.getOperationLogList(vo);
+    }
 }

+ 20 - 0
src/main/java/com/welampiot/service/impl/VideoMonitorServiceImpl.java

@@ -28,4 +28,24 @@ public class VideoMonitorServiceImpl implements VideoMonitorService {
     public void changeVideoMonitorLocationById(VideoMonitorDTO dto) {
         videoMonitorDao.changeVideoMonitorLocationById(dto);
     }
+
+    @Override
+    public List<VideoMonitorDTO> getVideoInfoList(VideoMonitorVO vo) {
+        return videoMonitorDao.getVideoInfoListByVO(vo);
+    }
+
+    @Override
+    public Integer getVideoTotal(VideoMonitorVO vo) {
+        return videoMonitorDao.getVideoTotal(vo);
+    }
+
+    @Override
+    public Integer getVideoOnlineTotal(VideoMonitorVO vo) {
+        return videoMonitorDao.getVideoOnlineTotal(vo);
+    }
+
+    @Override
+    public Integer getVideoUsableTotal(VideoMonitorVO vo) {
+        return videoMonitorDao.getVideoUsableTotal(vo);
+    }
 }

+ 5 - 0
src/main/java/com/welampiot/vo/VideoMonitorVO.java

@@ -10,5 +10,10 @@ public class VideoMonitorVO {
     private List sectionList; // 路段筛选
     private Integer limit;
     private Integer offset;
+    private Integer areaId;
+    private Integer sectionId;
+    private Integer total;
+    private Integer onlineCount;
+    private Integer useCount;
     private List<VideoMonitorDTO> list;
 }

+ 32 - 0
src/main/resources/mapper/AllAlarmInfoLogMapper.xml

@@ -842,4 +842,36 @@
         where id = #{id};
     </delete>
 
+    <select id="getAlarmOperationList" resultType="AllAlarmInfoLogDTO">
+        select
+            l.number,
+            s.name as section,
+            a.stralarmtype as strAlarmType,
+            a.updatetime as updateTime
+            <choose>
+                <when test="version == 0">
+                    ,gl.chinese_name as area
+                </when>
+                <when test="version == 1">
+                    ,gl.english_name as area
+                </when>
+                <otherwise>
+                    ,gl.ru_name as area
+                </otherwise>
+            </choose>
+        from all_alarm_info_log a
+        left join lampinfo l on a.lampid = l.id
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        where a.devType = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        order by a.updatetime desc
+        limit 100
+    </select>
+
 </mapper>

+ 13 - 0
src/main/resources/mapper/OperationLogMapper.xml

@@ -78,5 +78,18 @@
     <delete id="deleteLogListById">
         delete from operation_log where id = #{id}
     </delete>
+    
+    <select id="getOperationLogList" resultType="OperationLogDTO">
+        select
+            o.id,o.acount,o.time,o.remark,o.operation
+        from operation_log o
+        where 1=1
+        <if test="devType != null and devType != 0">
+            and o.devtype = #{devType}
+        </if>
+        <if test="operaType != null and operaType != 0">
+            and o.operaType = #{operaType}
+        </if>
+    </select>
 
 </mapper>

+ 85 - 0
src/main/resources/mapper/VideoMonitorMapper.xml

@@ -36,5 +36,90 @@
             v.latitude = #{latitude}
         where v.id = #{id}
     </update>
+    
+    <select id="getVideoInfoListByVO" resultType="VideoMonitorDTO">
+        select
+            v.id,v.lamp_pole_id as lampPoleId,v.name,v.netStatus,v.status,v.devid as devId,
+            v.password,v.day_personCountTotal as dayPersonCountTotal,v.peopleCountTotal,
+            v.`day_ carCountTotal` as dayCarCountTotal,v.carCountTotal,v.deviceType,
+            v.type,v.net_type as netType,v.rtmp,v.rtmpHd,v.hlsHd,v.channel,v.lastTime,
+            v.gb_address as gbAddress,v.gb_address2 as gbAddress2,v.install_date as installDate,
+            v.expiration_date as expirationDate,lp.name as lampPoleName
+        from video_monitor v
+        left join lamp_pole lp on lp.id = v.lamp_pole_id
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and v.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and v.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and v.sectionid = #{sectionId}
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getVideoTotal" resultType="Integer">
+        select
+        count(*)
+        from video_monitor v
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and v.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and v.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and v.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <select id="getVideoOnlineTotal" resultType="Integer">
+        select
+        count(*)
+        from video_monitor v
+        where v.netStatus = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and v.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and v.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and v.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <select id="getVideoUsableTotal" resultType="Integer">
+        select
+        count(*)
+        from video_monitor v
+        where v.netStatus = 1 and v.status = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and v.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and v.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and v.sectionid = #{sectionId}
+        </if>
+    </select>
 
 </mapper>