|
|
|
@ -2,10 +2,8 @@ package com.hnac.hzims.operational.station.controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.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.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
|
|
|
|
import com.hnac.hzims.common.logs.enums.BusinessType; |
|
|
|
@ -16,16 +14,15 @@ import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity;
|
|
|
|
|
import com.hnac.hzims.operational.station.response.HikDeviceResp; |
|
|
|
|
import com.hnac.hzims.operational.station.response.HikMonitorResp; |
|
|
|
|
import com.hnac.hzims.operational.station.service.IStationService; |
|
|
|
|
import com.hnac.hzims.operational.station.service.IStationVideoTypeService; |
|
|
|
|
import com.hnac.hzims.operational.station.utils.ArtemisPostUtils; |
|
|
|
|
import com.hnac.hzims.operational.station.vo.StationVO; |
|
|
|
|
import com.hnac.hzims.operational.station.vo.StationVideoTypeVO; |
|
|
|
|
import com.hnac.hzims.operational.station.vo.VideoMonitorVO; |
|
|
|
|
import com.hnac.hzims.operational.station.wrapper.StationVideoTypeWrapper; |
|
|
|
|
import com.hnac.hzims.operational.station.service.IStationVideoTypeService; |
|
|
|
|
import com.hnac.hzims.operational.station.vo.StationVideoTypeVO; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiModelProperty; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.log.annotation.ApiLog; |
|
|
|
@ -43,6 +40,7 @@ import javax.validation.Valid;
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.function.Consumer; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author hx |
|
|
|
@ -217,7 +215,23 @@ public class StationVideoTypeController extends BladeController {
|
|
|
|
|
public R<List<JSONObject>> getHikVisionStations() { |
|
|
|
|
return R.data(stationVideoTypeService.getHikVisionStations()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiLog |
|
|
|
|
@GetMapping("/getHikVideo") |
|
|
|
|
@ApiOperationSupport(order = 120) |
|
|
|
|
@ApiOperation(value = "获取海康视频区域列表", notes = "获取海康视频区域列表") |
|
|
|
|
public R getVideoMonitor(StationVideoTypeEntity req,Query query) { |
|
|
|
|
LambdaQueryWrapper<StationVideoTypeEntity> queryWrapper = com.hnac.hzims.common.utils.Condition.getQueryWrapper(StationVideoTypeEntity.class, req); |
|
|
|
|
IPage<StationVideoTypeEntity> page = stationVideoTypeService.page(com.hnac.hzims.common.utils.Condition.getPage(query), queryWrapper); |
|
|
|
|
Consumer<StationVideoTypeEntity> getFlvVideo = video -> { |
|
|
|
|
try { |
|
|
|
|
video.setLiveSourceAddress(ArtemisPostUtils.getCameraPreviewFlvURL(video.getVideoHost(), video.getAppKey(), video.getAppSecret(), video.getPointCode(), 1)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
video.setLiveSourceAddress(null); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
page.getRecords().forEach(getFlvVideo); |
|
|
|
|
return R.data(page); |
|
|
|
|
} |
|
|
|
|
@ApiLog |
|
|
|
|
@GetMapping("/getMonitorsByStation") |
|
|
|
|
@ApiOperationSupport(order = 130) |
|
|
|
|