Browse Source

修复质物检测连接摄像头失败的bug

master
yangzongjia 2 years ago
parent
commit
9507ca9701
  1. 21
      yxt-supervise-monitor-biz/src/main/java/com/yxt/supervise/monitor/biz/deviceImage/YDeviceImageRest.java

21
yxt-supervise-monitor-biz/src/main/java/com/yxt/supervise/monitor/biz/deviceImage/YDeviceImageRest.java

@ -2,6 +2,7 @@ package com.yxt.supervise.monitor.biz.deviceImage;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yxt.common.core.result.ResultBean;
import com.yxt.supervise.monitor.api.entity.Device;
import com.yxt.supervise.monitor.api.vo.PageVo;
@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(tags = "设备控制器")
@ -50,7 +52,14 @@ public class YDeviceImageRest {
@ApiOperation("质物检测获取正常视频流")
@GetMapping("/getShiPinNormalByChannelNo")
public ResultBean getShiPinByChannelNo(@RequestParam String channelNo) {
public ResultBean getShiPinByChannelNo(@RequestParam Map<String, String> searchVo) {
QueryWrapper<Device> wrapper = new QueryWrapper<>();
wrapper.eq("serialNumber", searchVo.get("deviceSerial"));
List<Device> devices = yDeviceService.list(wrapper);
Device device = new Device();
if (devices != null && devices.size() > 0) {
device = devices.get(0);
}
String spToken = "";
String url = "https://api2.hik-cloud.com/v1/ezviz/account/info";
try {
@ -63,12 +72,12 @@ public class YDeviceImageRest {
System.out.println(e);
}
String vCode = "yxt123"; // 网络录像机验证码
String deviceSerial = "L20560109"; //网络录像机序列号
// String vCode = "yxt123"; // 网络录像机验证码
// String deviceSerial = "L20560109"; //网络录像机序列号
String spUrl = "https://open.ys7.com/console/jssdk/pc.html?url=ezopen://"
+ vCode + "@open.ys7.com/"
+ deviceSerial + "/"
+ channelNo + ".hd.live&accessToken="
+ device.getNvrCode() + "@open.ys7.com/"
+ device.getSerialNumber() + "/"
+ searchVo.get("channelNo") + ".hd.live&accessToken="
+ spToken + "&themeId=pcLive";
ResultBean rb = ResultBean.fireSuccess();

Loading…
Cancel
Save