Browse Source

雷达视频下载加3秒延迟

develop
王兴琳 3 months ago
parent
commit
28e8bd6931
  1. 11
      zc-business/src/main/java/com/zc/business/controller/RadarController.java

11
zc-business/src/main/java/com/zc/business/controller/RadarController.java

@ -80,6 +80,8 @@ public class RadarController {
try { try {
// 获取雷达事件视频 // 获取雷达事件视频
String baseUrl = dcWarningService.getRadarIncidentVideo(radar.getId()); String baseUrl = dcWarningService.getRadarIncidentVideo(radar.getId());
//String baseUrl = replacedUrl.replace(" ", "_");
// System.out.println("雷达视频原始地址:" + replacedUrl);
System.out.println("雷达视频地址:" + baseUrl); System.out.println("雷达视频地址:" + baseUrl);
if (baseUrl == null || baseUrl.isEmpty()) { if (baseUrl == null || baseUrl.isEmpty()) {
@ -91,10 +93,10 @@ public class RadarController {
int port= Integer.parseInt(configService.selectConfigByKey("FTP-PORT")); int port= Integer.parseInt(configService.selectConfigByKey("FTP-PORT"));
String username= configService.selectConfigByKey("FTP-USER");//密钥 String username= configService.selectConfigByKey("FTP-USER");//密钥
String password= configService.selectConfigByKey("FPT-PASSWORD");//密钥 String password= configService.selectConfigByKey("FPT-PASSWORD");//密钥
// String ftpServer = "192.168.3.1"; /* String ftpServer = "192.168.3.1";
// int port = 21; int port = 21;
// String username = "1911390090@qq.com"; String username = "1911390090@qq.com";
// String password = "989878wxl"; String password = "989878wxl";*/
String[] split = StringUtils.split(baseUrl, "/"); String[] split = StringUtils.split(baseUrl, "/");
// 拼接文件名 // 拼接文件名
@ -128,6 +130,7 @@ public class RadarController {
// 空格编码并构建URL // 空格编码并构建URL
String encodedUrl = encodeUriComponent(baseUrl); String encodedUrl = encodeUriComponent(baseUrl);
System.out.println("encodedUrl: " + encodedUrl); System.out.println("encodedUrl: " + encodedUrl);
Thread.sleep(3000);//延迟3秒,等待服务器响应
URI uri = new URI(encodedUrl); URI uri = new URI(encodedUrl);
URL url = uri.toURL(); URL url = uri.toURL();

Loading…
Cancel
Save