ソースを参照

时间字段更改,查询机车视频实时流

buzhanyi 1 年間 前
コミット
5a2afd535e

+ 4 - 4
business-service/src/main/resources/mapper/BaseDeviceDynamicManagementMapper.xml

@@ -38,7 +38,7 @@
 		l.travel_mile AS travelMile,
 		l.terminal_longitude as terminalLongitude,
 		l.terminal_latitude as terminalLatitude,
-		l.current_time
+		l.curren_time
 		FROM
 		base_vehicle_terminal AS a ,
 		(
@@ -47,8 +47,8 @@
 		where not exists (
 		select 1
 		from vehicle_position df
-		where df.current_time IS NOT NULL and df.vehicle_code = vp.vehicle_code
-		and df.current_time > vp.current_time )
+		where df.curren_time IS NOT NULL and df.vehicle_code = vp.vehicle_code
+		and df.curren_time > vp.curren_time )
 		GROUP BY vp.vehicle_code ) AS l
 		<where>
 			a.terminal_code=l.terminal_code
@@ -56,6 +56,6 @@
 				and l.railway_code like concat("%",#{railwayCode},"%")
 			</if>
 		</where>
-		ORDER BY l.current_time DESC
+		ORDER BY l.curren_time DESC
 	</select>
 </mapper>

+ 7 - 1
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseVehicleController.java

@@ -1,5 +1,7 @@
 package com.ozs.web.controller.accountmanagment;
 
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ozs.common.annotation.Log;
@@ -9,6 +11,7 @@ import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.core.redis.RedisCache;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.utils.ChineseToPingyin;
+import com.ozs.common.utils.HeartbeatUtils;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.file.FileUtils;
 import com.ozs.common.utils.poi.ExcelUtil;
@@ -68,6 +71,8 @@ public class BaseVehicleController extends BaseController {
     BaseDeviceDynamicManagementService baseDeviceDynamicManagementService;
     @Autowired
     private RedisCache redisCache;
+    @Autowired
+    private HeartbeatUtils heartbeatUtils;
 
     /**
      * 车载终端挂载列表
@@ -343,7 +348,8 @@ public class BaseVehicleController extends BaseController {
     @GetMapping("/vehicleCurrentStream")
     @Log(title = "通过终端编码获取流", businessType = BusinessType.SELECT)
     public AjaxResult vehicleCurrentStream(String zdCode) {
-        Map<String, Object> cacheMap = redisCache.getCacheMap(Constant.HERTBEA_KEY + zdCode);
+        String heartbeat = heartbeatUtils.getHeartbeat(zdCode);
+        Map<String, Object> cacheMap = JSON.parseObject(heartbeat);
         if (!ObjectUtils.isEmpty(cacheMap)) {
             Map<String, String> ccMap = new HashMap<>();
             Object cameraCode = cacheMap.get("cameraCode");