|
@@ -879,11 +879,7 @@ public class GeoHazardMonitorTokenController {
|
|
base.eq(BaseCameraManagement::getRailwayCode, heartbeatVo.getRailwayCode());
|
|
base.eq(BaseCameraManagement::getRailwayCode, heartbeatVo.getRailwayCode());
|
|
base.eq(BaseCameraManagement::getOnline, 2);
|
|
base.eq(BaseCameraManagement::getOnline, 2);
|
|
base.eq(BaseCameraManagement::getEnableOrNot, 1);
|
|
base.eq(BaseCameraManagement::getEnableOrNot, 1);
|
|
- if (array[0].getCameraStream().equals("")) {
|
|
|
|
- base.last("limit 1");
|
|
|
|
- } else {
|
|
|
|
- base.last("limit 1,1");
|
|
|
|
- }
|
|
|
|
|
|
+ base.last("limit 2");
|
|
BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(base);
|
|
BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(base);
|
|
//根据相机ID找出分组并排序
|
|
//根据相机ID找出分组并排序
|
|
if (!ObjectUtils.isEmpty(baseCameraManagement)) {
|
|
if (!ObjectUtils.isEmpty(baseCameraManagement)) {
|
|
@@ -1038,51 +1034,48 @@ public class GeoHazardMonitorTokenController {
|
|
respHeartbeatVo.setCameraList(cameraVosList);
|
|
respHeartbeatVo.setCameraList(cameraVosList);
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
}
|
|
}
|
|
-
|
|
|
|
- //获取机车前一路视频
|
|
|
|
- int miles = heartbeatVo.getVisualDistance() + heartbeatVo.getCurrentMile();
|
|
|
|
- LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
|
|
|
|
- if (heartbeatVo.getLineDir() == 1) {
|
|
|
|
- base.orderByAsc(BaseCameraManagement::getGrou).orderByAsc(BaseCameraManagement::getSort);
|
|
|
|
- base.gt(BaseCameraManagement::getInstallMile, miles);
|
|
|
|
- }
|
|
|
|
- if (heartbeatVo.getLineDir() == 2) {
|
|
|
|
- base.orderByDesc(BaseCameraManagement::getGrou).orderByDesc(BaseCameraManagement::getSort);
|
|
|
|
- base.lt(BaseCameraManagement::getInstallMile, miles);
|
|
|
|
- }
|
|
|
|
- base.eq(BaseCameraManagement::getRailwayCode, heartbeatVo.getRailwayCode());
|
|
|
|
- base.eq(BaseCameraManagement::getOnline, 2);
|
|
|
|
- base.eq(BaseCameraManagement::getEnableOrNot, 1);
|
|
|
|
- if (respHeartbeatVo.getCameraList().get(0).getCurrentStream().equals("")) {
|
|
|
|
- base.last("limit 1");
|
|
|
|
- } else {
|
|
|
|
- base.last("limit 1,1");
|
|
|
|
- }
|
|
|
|
- BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(base);
|
|
|
|
- //根据相机ID找出分组并排序
|
|
|
|
- if (!ObjectUtils.isEmpty(baseCameraManagement)) {
|
|
|
|
- List<BaseCameraManagement> baseCameraManagementList1 = cameraUtil.getBaseCameraManagementList(baseCameraManagement.getId(), heartbeatVo.getLineDir());
|
|
|
|
- if (!ObjectUtils.isEmpty(baseCameraManagementList1)) {
|
|
|
|
- for (BaseCameraManagement cameraManagement : baseCameraManagementList1) {
|
|
|
|
- boolean finalType2 = type;
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
- String playFlv = cameraUtil.heartbeatgetPlayFlv(cameraManagement.getCameraCode(), cameraManagement.getGraphicsCard(), finalType2);
|
|
|
|
- if (StringUtils.isEmpty(playFlv)) {
|
|
|
|
- try {
|
|
|
|
- cameraUtil.heartbeatgetUrl(cameraManagement.getCameraCode(), cameraManagement.getGraphicsCard(), finalType2, httpUrl);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
|
|
BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
|
|
responseList.add(preAlarmListResponse);
|
|
responseList.add(preAlarmListResponse);
|
|
}
|
|
}
|
|
respHeartbeatVo.setPreAlarmList(responseList);
|
|
respHeartbeatVo.setPreAlarmList(responseList);
|
|
|
|
+ //获取机车前一路视频
|
|
|
|
+ int miles = heartbeatVo.getVisualDistance() + heartbeatVo.getCurrentMile();
|
|
|
|
+ LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
|
|
|
|
+ if (heartbeatVo.getLineDir() == 1) {
|
|
|
|
+ base.orderByAsc(BaseCameraManagement::getGrou).orderByAsc(BaseCameraManagement::getSort);
|
|
|
|
+ base.gt(BaseCameraManagement::getInstallMile, miles);
|
|
|
|
+ }
|
|
|
|
+ if (heartbeatVo.getLineDir() == 2) {
|
|
|
|
+ base.orderByDesc(BaseCameraManagement::getGrou).orderByDesc(BaseCameraManagement::getSort);
|
|
|
|
+ base.lt(BaseCameraManagement::getInstallMile, miles);
|
|
|
|
+ }
|
|
|
|
+ base.eq(BaseCameraManagement::getRailwayCode, heartbeatVo.getRailwayCode());
|
|
|
|
+ base.eq(BaseCameraManagement::getOnline, 2);
|
|
|
|
+ base.eq(BaseCameraManagement::getEnableOrNot, 1);
|
|
|
|
+ if (respHeartbeatVo.getCameraList().get(0).getCurrentStream().equals("")) {
|
|
|
|
+ base.last("limit 2");
|
|
|
|
+ }
|
|
|
|
+ BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(base);
|
|
|
|
+ //根据相机ID找出分组并排序
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement)) {
|
|
|
|
+ List<BaseCameraManagement> baseCameraManagementList1 = cameraUtil.getBaseCameraManagementList(baseCameraManagement.getId(), heartbeatVo.getLineDir());
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagementList1)) {
|
|
|
|
+ for (BaseCameraManagement cameraManagement : baseCameraManagementList1) {
|
|
|
|
+ boolean finalType2 = type;
|
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
|
+ String playFlv = cameraUtil.heartbeatgetPlayFlv(cameraManagement.getCameraCode(), cameraManagement.getGraphicsCard(), finalType2);
|
|
|
|
+ if (StringUtils.isEmpty(playFlv)) {
|
|
|
|
+ try {
|
|
|
|
+ cameraUtil.heartbeatgetUrl(cameraManagement.getCameraCode(), cameraManagement.getGraphicsCard(), finalType2, httpUrl);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
//没有报警信息的时候
|
|
//没有报警信息的时候
|
|
if (heartbeatVo.getLineDir() == 1) {
|
|
if (heartbeatVo.getLineDir() == 1) {
|
|
@@ -1356,50 +1349,48 @@ public class GeoHazardMonitorTokenController {
|
|
respHeartbeatVo.setCameraList(cameraVosList);
|
|
respHeartbeatVo.setCameraList(cameraVosList);
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
}
|
|
}
|
|
- //获取机车前一路视频
|
|
|
|
- int miles = heartbeatVo.getVisualDistance() + heartbeatVo.getCurrentMile();
|
|
|
|
- LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
|
|
|
|
- if (heartbeatVo.getLineDir() == 1) {
|
|
|
|
- base.orderByAsc(BaseCameraManagement::getGrou).orderByAsc(BaseCameraManagement::getSort);
|
|
|
|
- base.gt(BaseCameraManagement::getInstallMile, miles);
|
|
|
|
- }
|
|
|
|
- if (heartbeatVo.getLineDir() == 2) {
|
|
|
|
- base.orderByDesc(BaseCameraManagement::getGrou).orderByDesc(BaseCameraManagement::getSort);
|
|
|
|
- base.lt(BaseCameraManagement::getInstallMile, miles);
|
|
|
|
- }
|
|
|
|
- base.eq(BaseCameraManagement::getRailwayCode, heartbeatVo.getRailwayCode());
|
|
|
|
- base.eq(BaseCameraManagement::getOnline, 2);
|
|
|
|
- base.eq(BaseCameraManagement::getEnableOrNot, 1);
|
|
|
|
- if (respHeartbeatVo.getCameraList().get(0).getCurrentStream().equals("")) {
|
|
|
|
- base.last("limit 1");
|
|
|
|
- } else {
|
|
|
|
- base.last("limit 1,1");
|
|
|
|
- }
|
|
|
|
- BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(base);
|
|
|
|
- //根据相机ID找出分组并排序
|
|
|
|
- if (!ObjectUtils.isEmpty(baseCameraManagement)) {
|
|
|
|
- List<BaseCameraManagement> baseCameraManagementList1 = cameraUtil.getBaseCameraManagementList(baseCameraManagement.getId(), heartbeatVo.getLineDir());
|
|
|
|
- if (!ObjectUtils.isEmpty(baseCameraManagementList1)) {
|
|
|
|
- for (BaseCameraManagement cameraManagement : baseCameraManagementList1) {
|
|
|
|
- boolean finalType2 = type;
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
- String playFlv = cameraUtil.heartbeatgetPlayFlv(cameraManagement.getCameraCode(), cameraManagement.getGraphicsCard(), finalType2);
|
|
|
|
- if (StringUtils.isEmpty(playFlv)) {
|
|
|
|
- try {
|
|
|
|
- cameraUtil.heartbeatgetUrl(cameraManagement.getCameraCode(), cameraManagement.getGraphicsCard(), finalType2, httpUrl);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
|
|
BeanUtils.copyProperties(preAlarmList.get(i), preAlarmListResponse);
|
|
responseList.add(preAlarmListResponse);
|
|
responseList.add(preAlarmListResponse);
|
|
}
|
|
}
|
|
respHeartbeatVo.setPreAlarmList(responseList);
|
|
respHeartbeatVo.setPreAlarmList(responseList);
|
|
|
|
+ //获取机车前一路视频
|
|
|
|
+ int miles = heartbeatVo.getVisualDistance() + heartbeatVo.getCurrentMile();
|
|
|
|
+ LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
|
|
|
|
+ if (heartbeatVo.getLineDir() == 1) {
|
|
|
|
+ base.orderByAsc(BaseCameraManagement::getGrou).orderByAsc(BaseCameraManagement::getSort);
|
|
|
|
+ base.gt(BaseCameraManagement::getInstallMile, miles);
|
|
|
|
+ }
|
|
|
|
+ if (heartbeatVo.getLineDir() == 2) {
|
|
|
|
+ base.orderByDesc(BaseCameraManagement::getGrou).orderByDesc(BaseCameraManagement::getSort);
|
|
|
|
+ base.lt(BaseCameraManagement::getInstallMile, miles);
|
|
|
|
+ }
|
|
|
|
+ base.eq(BaseCameraManagement::getRailwayCode, heartbeatVo.getRailwayCode());
|
|
|
|
+ base.eq(BaseCameraManagement::getOnline, 2);
|
|
|
|
+ base.eq(BaseCameraManagement::getEnableOrNot, 1);
|
|
|
|
+ if (respHeartbeatVo.getCameraList().get(0).getCurrentStream().equals("")) {
|
|
|
|
+ base.last("limit 2");
|
|
|
|
+ }
|
|
|
|
+ BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(base);
|
|
|
|
+ //根据相机ID找出分组并排序
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement)) {
|
|
|
|
+ List<BaseCameraManagement> baseCameraManagementList1 = cameraUtil.getBaseCameraManagementList(baseCameraManagement.getId(), heartbeatVo.getLineDir());
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagementList1)) {
|
|
|
|
+ for (BaseCameraManagement cameraManagement : baseCameraManagementList1) {
|
|
|
|
+ boolean finalType2 = type;
|
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
|
+ String playFlv = cameraUtil.heartbeatgetPlayFlv(cameraManagement.getCameraCode(), cameraManagement.getGraphicsCard(), finalType2);
|
|
|
|
+ if (StringUtils.isEmpty(playFlv)) {
|
|
|
|
+ try {
|
|
|
|
+ cameraUtil.heartbeatgetUrl(cameraManagement.getCameraCode(), cameraManagement.getGraphicsCard(), finalType2, httpUrl);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
//没有报警信息的时候
|
|
//没有报警信息的时候
|
|
LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
|