|
@@ -10,6 +10,7 @@ import com.ozs.common.core.domain.AjaxResult;
|
|
|
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.AppendUtils;
|
|
|
import com.ozs.common.utils.ChineseToPingyin;
|
|
|
import com.ozs.common.utils.HeartbeatUtils;
|
|
|
import com.ozs.common.utils.StringUtils;
|
|
@@ -359,15 +360,26 @@ public class BaseVehicleController extends BaseController {
|
|
|
LambdaQueryWrapper<BaseCameraManagement> bcWrapper = new LambdaQueryWrapper<>();
|
|
|
bcWrapper.eq(BaseCameraManagement::getCameraCode, cameraCode.toString());
|
|
|
BaseCameraManagement one = cameraManagementService.getOne(bcWrapper);
|
|
|
- //相机编码和实时流
|
|
|
- ccMap.put("cameraCode", cameraCode.toString());
|
|
|
- ccMap.put("currentStream", CameraUtil.getPlayFlv(cameraCode.toString(), one.getChannel()));
|
|
|
- //行别
|
|
|
- String lineDirStr = one.getLineDir() == 1 ? "上行" : "下行";
|
|
|
- ccMap.put("lineDir", lineDirStr);
|
|
|
- //安装里程位置
|
|
|
- ccMap.put("installMile", one.getInstallMiles());
|
|
|
- return AjaxResult.success(ccMap);
|
|
|
+ if (!ObjectUtils.isEmpty(one)) {
|
|
|
+ //相机编码和实时流
|
|
|
+ ccMap.put("cameraCode", cameraCode.toString());
|
|
|
+ ccMap.put("currentStream", CameraUtil.getPlayFlv(cameraCode.toString(), one.getChannel()));
|
|
|
+ //行别
|
|
|
+ String lineDirStr = one.getLineDir() == 1 ? "上行" : "下行";
|
|
|
+ ccMap.put("lineDir", lineDirStr);
|
|
|
+ //安装里程位置
|
|
|
+ String mils = AppendUtils.stringAppend(one.getInstallMile());
|
|
|
+ ccMap.put("installMile", mils);
|
|
|
+ //线路名称
|
|
|
+ LambdaQueryWrapper<BaseRailwayManagement> queryWrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
|
|
|
+ if (!ObjectUtils.isEmpty(one.getRailwayCode())) {
|
|
|
+ queryWrapper.eq(BaseRailwayManagement::getRailwayCode, one.getRailwayCode());
|
|
|
+ }
|
|
|
+ BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
|
|
|
+ ccMap.put("railwayName", baseRailwayManagement.getRailwayName());
|
|
|
+ return AjaxResult.success(ccMap);
|
|
|
+ }
|
|
|
+ return AjaxResult.error("当前机车未绑定终端");
|
|
|
}
|
|
|
}
|
|
|
return AjaxResult.error("当前机车无实时流");
|