| | |
| | | package com.ycl.controller.video; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.annotation.LogSave; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.entity.video.VideoPoint; |
| | | import com.ycl.service.video.impl.IVideoPointService; |
| | | import com.ycl.util.VideoUtil; |
| | | import com.ycl.vo.equipment.VideoPointVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | IVideoPointService iVideoPointService; |
| | | @Autowired |
| | | VideoUtil videoUtil; |
| | | |
| | | @GetMapping("/query") |
| | | @ApiOperation("查询") |
| | |
| | | @RequestParam Long current, |
| | | @RequestParam(required = false) Integer streetId, |
| | | @RequestParam(required = false) Integer communityId) { |
| | | return CommonResult.success(iVideoPointService.getList(streetId,communityId, current.intValue(), size.intValue())); |
| | | |
| | | IPage<VideoPointVo> pointVoIPage = iVideoPointService.getList(streetId, communityId, current.intValue(), size.intValue()); |
| | | pointVoIPage.getRecords() |
| | | .stream() |
| | | .forEach(item -> item.setUrlAddress(videoUtil.getVideo(item.getPlatResourceId(), "HLS", 0))); |
| | | return CommonResult.success(pointVoIPage); |
| | | } |
| | | |
| | | @PostMapping("/addition") |
| | |
| | | |
| | | @Override |
| | | public IPage<VideoPointVo> getList(Integer streetId, Integer communityId, Integer current, Integer size) { |
| | | Page<VideoPointVo> page = new Page<>(current, size); |
| | | IPage<VideoPointVo> page1 = baseMapper.search(page, streetId, communityId); |
| | | return page1; |
| | | return baseMapper.search(new Page<>(current, size), streetId, communityId); |
| | | } |
| | | } |
| | |
| | | @Value("${videoPoint.ip}") |
| | | private String ip; |
| | | |
| | | /* |
| | | * @Description subType:类型int,选填。码流类型,0:主码流、1:辅流1、2:辅流2。默认为0主码流。scheme:类型string,选填。协议类型,支持RTSP、FLV_HTTP、HLS三种,默认RTSP。 |
| | | * @Param [code, scheme, subType] |
| | | * @return java.lang.String |
| | | **/ |
| | | @SneakyThrows |
| | | public String getVideo(String code, String scheme,Integer subType) { |
| | | String clientType = "winpc"; |
| | |
| | | |
| | | @Data |
| | | public class BaseCaseVO { |
| | | |
| | | private Integer baseId; |
| | | private String code; |
| | | private String name; |
| | |
| | | private String latitude; |
| | | private String picData; |
| | | private String grade; |
| | | private String street; |
| | | private String community; |
| | | private String address; |
| | | |
| | | @JsonFormat(timezone = "GMT",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime alarmTime; |
| | |
| | | t3.latitude, |
| | | t4.pic_data, |
| | | t5.`name` as grade, |
| | | t6.`region_name` as street, |
| | | t7.`region_name` as community, |
| | | t3.address, |
| | | t1.alarm_time as alarmTime |
| | | FROM ums_base_case t1 |
| | | LEFT JOIN ums_violations t2 ON t1.id = t2.id |
| | | LEFT JOIN ums_video_point t3 on t2.video_point_id = t3.id |
| | | LEFT JOIN ums_video_alarm_report t4 on t4.id = t2.video_alarm_report_id |
| | | LEFT JOIN ums_data_dictionary t5 on t5.id = t2.grade_id |
| | | LEFT JOIN ums_sccg_region t6 on t6.id = t1.street_id |
| | | LEFT JOIN ums_sccg_region t7 on t7.id = t1.community_id |
| | | WHERE t1.state = 1 |
| | | group by t1.id |
| | | </select> |