From 65a12fccec8ad0306817eb057adb102c54f2046f Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期三, 28 五月 2025 15:57:17 +0800
Subject: [PATCH] 添加出租车的视频设备号
---
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java
index 514a5a1..2e2b60b 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java
@@ -23,6 +23,7 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
@@ -50,6 +51,7 @@
* @author zhibing.pu
* @Date 2025/3/24 17:50
*/
+@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {
@@ -150,6 +152,7 @@
order.setDrivingLicenseNumber(driver.getDrivingLicenseNumber());
}
order.setVehicleNumber(car.getVehicleNumber());
+ order.setDeviceId(car.getDeviceId());
order.setEnterpriseName(enterprise.getName());
return R.ok(order);
}
@@ -182,7 +185,7 @@
public R<RealVideoResp> getOrderMonitoring(Integer id) {
Order order = orderService.getById(id);
if (null == order) {
- return R.fail("失败");
+ return R.fail("发起实时音视频失败,可能是车辆离线导致");
}
Car car = carService.getById(order.getCarId());
//手动加一次状态数据,避免定时任务结束任务线程
@@ -200,13 +203,14 @@
// live_hls(data.getUrl(), car);
// resp.setServerIp(hlsIp);
// resp.setServerPort(hlsPort);
-
- live_flv(data.getUrl(), car.getId());
+ resp.setUrl(data.getUrl());
+// live_flv(data.getUrl(), car.getId());
resp.setServerIp(flvIp);
resp.setServerPort(flvHttpPort);
return R.ok(resp);
}
- return R.fail(startupAckVoR.getMsg());
+ log.error("获取视频失败:{}", startupAckVoR.getMsg());
+ return R.fail("发起实时音视频失败,可能是车辆离线导致");
}
@@ -237,7 +241,7 @@
}
public void live_flv(String input, Integer id){
- String url = "rtsp://" + flvIp + ":" + flvRtmpPort + "/flv/" + id;
+ String url = "rtmp://" + flvIp + ":" + flvRtmpPort + "/flv/" + id;
//执行拉流和推流
ExecutorService executorService = new ThreadPoolExecutor(1, 1,
0L, TimeUnit.MILLISECONDS,
--
Gitblit v1.7.1