gao.qiang hai 1 ano
pai
achega
272c7320ca

+ 0 - 1
business-service/src/main/java/com/ozs/entity/BaseVehicle.java

@@ -75,7 +75,6 @@ public class BaseVehicle implements Serializable {
     @TableField(exist = false)
     @Excel(name = "车载终端")
     private String terminalName;
-    
 
     /**
      * 备注

+ 3 - 0
business-service/src/main/java/com/ozs/service/BaseCameraManagementService.java

@@ -7,6 +7,7 @@ import com.ozs.entity.BaseCameraManagement;
 import com.ozs.entity.vo.BaseCameraManagementHomeVo;
 import com.ozs.entity.vo.BaseCameraManagementVo;
 import com.ozs.entity.vo.BaseCameraManagementVos;
+import com.ozs.entity.vo.BaseVehicleTerminalDto;
 
 import java.util.List;
 import java.util.Map;
@@ -42,4 +43,6 @@ public interface BaseCameraManagementService extends IService<BaseCameraManageme
     Map<String, Integer> getMessageStatisticsCamera();
 
     AjaxResult nonContactAlarmCamera();
+
+    List<String> videoCaptureUrl(BaseVehicleTerminalDto baseVehicleTerminalDto);
 }

+ 1 - 1
business-service/src/main/java/com/ozs/service/BaseVehicleService.java

@@ -49,7 +49,7 @@ public interface BaseVehicleService extends IService<BaseVehicle> {
      *
      * @return
      */
-    List<BaseVehicle> vehicleListDT();
+    List<BaseVehicle> vehicleListDT(BaseVehicleVo baseVehicle);
 
     AjaxResult vehicleTerminalUnmount(BaseVehicleTerminal baseTerminal);
 

+ 25 - 3
business-service/src/main/java/com/ozs/service/impl/BaseCameraManagementServiceImpl.java

@@ -15,10 +15,12 @@ import com.ozs.entity.*;
 import com.ozs.entity.vo.BaseCameraManagementHomeVo;
 import com.ozs.entity.vo.BaseCameraManagementVo;
 import com.ozs.entity.vo.BaseCameraManagementVos;
+import com.ozs.entity.vo.BaseVehicleTerminalDto;
 import com.ozs.mapper.*;
 import com.ozs.service.BaseCameraManagementService;
 import com.ozs.service.BaseRailwayManagementService;
 import com.ozs.service.BaseUserService;
+import com.ozs.utils.CameraUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
@@ -398,14 +400,34 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
                 camera.le(BaseCameraManagement::getBeginMile, msgAlarm.getAlarmMile());
                 camera.eq(BaseCameraManagement::getLineDir, msgAlarm.getLineDir());
                 camera.eq(BaseCameraManagement::getRailwayCode, msgAlarm.getRailwayCode());
-                camera.eq(BaseCameraManagement::getOnline,2);
-                camera.eq(BaseCameraManagement::getEnableOrNot,1);
+                camera.eq(BaseCameraManagement::getOnline, 2);
+                camera.eq(BaseCameraManagement::getEnableOrNot, 1);
                 List<BaseCameraManagement> baseCameraManagementList = this.list(camera);
-                if (!ObjectUtils.isEmpty(baseCameraManagementList)){
+                if (!ObjectUtils.isEmpty(baseCameraManagementList)) {
                     list.addAll(baseCameraManagementList);
                 }
             }
         }
         return AjaxResult.success(list);
     }
+
+    @Override
+    public List<String> videoCaptureUrl(BaseVehicleTerminalDto baseVehicleTerminalDto) {
+        List<String> urlList = new ArrayList<>();
+        LambdaQueryWrapper<BaseCameraManagement> camera = new LambdaQueryWrapper<BaseCameraManagement>();
+        camera.ge(BaseCameraManagement::getEndMile, baseVehicleTerminalDto.getTravelMile());
+        camera.eq(BaseCameraManagement::getLineDir, baseVehicleTerminalDto.getLineDir());
+        camera.eq(BaseCameraManagement::getRailwayCode, baseVehicleTerminalDto.getRailwayCode());
+        camera.eq(BaseCameraManagement::getOnline, 2);
+        camera.eq(BaseCameraManagement::getEnableOrNot, 1);
+        List<BaseCameraManagement> baseCameraManagementList = this.list(camera);
+        if (!ObjectUtils.isEmpty(baseCameraManagementList)) {
+            List<BaseCameraManagement> list = new ArrayList<>(baseCameraManagementList);
+            for (BaseCameraManagement baseCameraManagement : list) {
+                String flv = CameraUtil.getPlayFlv(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel());
+                urlList.add(flv);
+            }
+        }
+        return urlList;
+    }
 }

+ 6 - 2
business-service/src/main/java/com/ozs/service/impl/BaseVehicleServiceImpl.java

@@ -348,9 +348,13 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
     }
 
     @Override
-    public List<BaseVehicle> vehicleListDT() {
+    public List<BaseVehicle> vehicleListDT(BaseVehicleVo baseVehicle) {
         //查到所有机车数据
-        List<BaseVehicle> baseVehicles = baseVehicleMapper.selectList(new LambdaQueryWrapper<>());
+        LambdaQueryWrapper<BaseVehicle> wrapper = new LambdaQueryWrapper<>();
+        if (!StringUtils.isEmptySunhh(baseVehicle) && !StringUtils.isEmptySunhh(baseVehicle.getVehicleCode())) {
+            wrapper.like(BaseVehicle::getVehicleCode, baseVehicle.getVehicleCode());
+        }
+        List<BaseVehicle> baseVehicles = baseVehicleMapper.selectList(wrapper);
         //查到机车关联的终端
         if (!StringUtils.isEmptySunhh(baseVehicles)) {
             List<String> terminalCodeList = new ArrayList<>();

+ 15 - 3
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseVehicleController.java

@@ -390,10 +390,22 @@ public class BaseVehicleController extends BaseController {
      * @return
      */
     @ApiOperation(value = "机车信息表 列表查询")
-    @GetMapping("/vehicleList")
+    @PostMapping("/homeVehicleList")
     @Log(title = "机车信息管理", businessType = BusinessType.SELECT)
-    public AjaxResult vehicleList() {
-        return AjaxResult.success(baseVehicleService.vehicleListDT());
+    public AjaxResult homeVehicleList(@RequestBody BaseVehicleVo baseVehicle) {
+        return AjaxResult.success(baseVehicleService.vehicleListDT(baseVehicle));
+    }
+
+    /**
+     * 点击机车获取前方四路视频 (首页地图中的机车信息)
+     *
+     * @return
+     */
+    @ApiOperation(value = "机车信息表 列表查询")
+    @PostMapping("/videoCaptureUrl")
+    @Log(title = "机车信息管理", businessType = BusinessType.SELECT)
+    public AjaxResult videoCaptureUrl(@RequestBody BaseVehicleTerminalDto baseVehicleTerminalDto) {
+        return AjaxResult.success(baseCameraManagementService.videoCaptureUrl(baseVehicleTerminalDto));
     }
 
     /**