|
@@ -16,6 +16,7 @@ import com.ozs.common.utils.stateSecrets.SM4Utils;
|
|
import com.ozs.config.Constant;
|
|
import com.ozs.config.Constant;
|
|
import com.ozs.entity.BaseCameraManagement;
|
|
import com.ozs.entity.BaseCameraManagement;
|
|
import com.ozs.entity.BaseRailwayManagement;
|
|
import com.ozs.entity.BaseRailwayManagement;
|
|
|
|
+import com.ozs.entity.BaseRouteMassage;
|
|
import com.ozs.entity.BaseTerminal;
|
|
import com.ozs.entity.BaseTerminal;
|
|
import com.ozs.entity.BaseUser;
|
|
import com.ozs.entity.BaseUser;
|
|
import com.ozs.entity.BaseVehicleTerminal;
|
|
import com.ozs.entity.BaseVehicleTerminal;
|
|
@@ -52,6 +53,7 @@ import com.ozs.mapper.MsgHeartbeatAlarmMessageMapper;
|
|
import com.ozs.mapper.SkynetHeartbeatLogMapper;
|
|
import com.ozs.mapper.SkynetHeartbeatLogMapper;
|
|
import com.ozs.service.BaseCameraManagementService;
|
|
import com.ozs.service.BaseCameraManagementService;
|
|
import com.ozs.service.BaseRailwayManagementService;
|
|
import com.ozs.service.BaseRailwayManagementService;
|
|
|
|
+import com.ozs.service.BaseRouteMassageService;
|
|
import com.ozs.service.BaseTerminalService;
|
|
import com.ozs.service.BaseTerminalService;
|
|
import com.ozs.service.BaseUserService;
|
|
import com.ozs.service.BaseUserService;
|
|
import com.ozs.service.BaseVehicleTerminalService;
|
|
import com.ozs.service.BaseVehicleTerminalService;
|
|
@@ -144,6 +146,9 @@ public class GeoHazardMonitorTokenController {
|
|
private AlarmHeartbeatLogMapper alarmHeartbeatLogMapper;
|
|
private AlarmHeartbeatLogMapper alarmHeartbeatLogMapper;
|
|
@Resource
|
|
@Resource
|
|
private MsgHeartbeatAlarmMessageMapper msgHearbeatAlarmMessageMapper;
|
|
private MsgHeartbeatAlarmMessageMapper msgHearbeatAlarmMessageMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private BaseRouteMassageService baseRouteMassageService;
|
|
|
|
+
|
|
@Value("${base.env}")
|
|
@Value("${base.env}")
|
|
private String env;
|
|
private String env;
|
|
@Value("${sdk.publish}")
|
|
@Value("${sdk.publish}")
|
|
@@ -587,15 +592,15 @@ public class GeoHazardMonitorTokenController {
|
|
terminal.eq(BaseTerminal::getTerminalCode, vehiclePosition.getTerminalCode());
|
|
terminal.eq(BaseTerminal::getTerminalCode, vehiclePosition.getTerminalCode());
|
|
boolean update = baseTerminalService.update(baseTerminal1, terminal);
|
|
boolean update = baseTerminalService.update(baseTerminal1, terminal);
|
|
//获取心跳接口相机记录表信息
|
|
//获取心跳接口相机记录表信息
|
|
- List<TerminalHeartbeatLog> heartbeatLogList = terminalHeartbeatLogService.terminalHeartbeatLogList();
|
|
|
|
- List<String> codeList = new ArrayList<>();
|
|
|
|
- log.info("-----heartbeatLogList----->" + heartbeatLogList);
|
|
|
|
- if (!ObjectUtils.isEmpty(heartbeatLogList)) {
|
|
|
|
- codeList = heartbeatLogList.stream().map(TerminalHeartbeatLog::getCameraCode).collect(Collectors.toList());
|
|
|
|
- log.info("-----codeList----->" + codeList);
|
|
|
|
- } else {
|
|
|
|
- terminalHeartbeatLogService.add("111", "111");
|
|
|
|
- }
|
|
|
|
|
|
+ //List<TerminalHeartbeatLog> heartbeatLogList = terminalHeartbeatLogService.terminalHeartbeatLogList();
|
|
|
|
+ //List<String> codeList = new ArrayList<>();
|
|
|
|
+ //log.info("-----heartbeatLogList----->" + heartbeatLogList);
|
|
|
|
+ //if (!ObjectUtils.isEmpty(heartbeatLogList)) {
|
|
|
|
+ // codeList = heartbeatLogList.stream().map(TerminalHeartbeatLog::getCameraCode).collect(Collectors.toList());
|
|
|
|
+ // log.info("-----codeList----->" + codeList);
|
|
|
|
+ //} else {
|
|
|
|
+ // terminalHeartbeatLogService.add("111", "111");
|
|
|
|
+ //}
|
|
|
|
|
|
//目视距离和里程位置
|
|
//目视距离和里程位置
|
|
if (save && update) {
|
|
if (save && update) {
|
|
@@ -694,7 +699,7 @@ public class GeoHazardMonitorTokenController {
|
|
// //添加心跳相机日志信息
|
|
// //添加心跳相机日志信息
|
|
// int add = terminalHeartbeatLogService.add(baseCameraManagementList.get(0).getCameraCode(), baseCameraManagementList.get(0).getChannel());
|
|
// int add = terminalHeartbeatLogService.add(baseCameraManagementList.get(0).getCameraCode(), baseCameraManagementList.get(0).getChannel());
|
|
// log.info("-----add----" + add);
|
|
// log.info("-----add----" + add);
|
|
-
|
|
|
|
|
|
+/**
|
|
ArrayList<String> list3 = new ArrayList<>();
|
|
ArrayList<String> list3 = new ArrayList<>();
|
|
//添加缓存
|
|
//添加缓存
|
|
String code = baseCameraManagementList.get(0).getCameraCode() + "/" + baseCameraManagementList.get(0).getChannel();
|
|
String code = baseCameraManagementList.get(0).getCameraCode() + "/" + baseCameraManagementList.get(0).getChannel();
|
|
@@ -725,17 +730,17 @@ public class GeoHazardMonitorTokenController {
|
|
if (parts.length == 2) {
|
|
if (parts.length == 2) {
|
|
CompletableFuture.runAsync(() -> {
|
|
CompletableFuture.runAsync(() -> {
|
|
try {
|
|
try {
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ TimeUnit.SECONDS.sleep(3);
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ **/
|
|
respHeartbeatVo.setCurrentStream(playFlv1);
|
|
respHeartbeatVo.setCurrentStream(playFlv1);
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
respHeartbeatVo.setCameraCode(baseCameraManagementList.get(0).getCameraCode());
|
|
respHeartbeatVo.setCameraCode(baseCameraManagementList.get(0).getCameraCode());
|
|
@@ -797,12 +802,11 @@ public class GeoHazardMonitorTokenController {
|
|
//获取所有报警安装里程位置的相机
|
|
//获取所有报警安装里程位置的相机
|
|
List<BaseCameraManagement> baseList = baseCameraManagementService.list(ment);
|
|
List<BaseCameraManagement> baseList = baseCameraManagementService.list(ment);
|
|
if (baseList.size() > 0) {
|
|
if (baseList.size() > 0) {
|
|
- for (int o = 0; o < baseList.size(); o++) {
|
|
|
|
//判断流媒体是否有流
|
|
//判断流媒体是否有流
|
|
String playFlv = null;
|
|
String playFlv = null;
|
|
- playFlv = cameraUtil.heartbeatgetPlayFlv(baseList.get(o).getCameraCode(), baseList.get(o).getChannel(), type);
|
|
|
|
|
|
+ playFlv = cameraUtil.heartbeatgetPlayFlv(baseList.get(0).getCameraCode(), baseList.get(0).getChannel(), type);
|
|
if (StringUtils.isEmpty(playFlv)) {
|
|
if (StringUtils.isEmpty(playFlv)) {
|
|
- playFlv = cameraUtil.heartbeatgetUrl(baseList.get(o).getCameraCode(), baseList.get(o).getChannel(), type);
|
|
|
|
|
|
+ playFlv = cameraUtil.heartbeatgetUrl(baseList.get(0).getCameraCode(), baseList.get(0).getChannel(), type);
|
|
}
|
|
}
|
|
// //判断心跳相机日志表后两条数据是否包含该相机编码
|
|
// //判断心跳相机日志表后两条数据是否包含该相机编码
|
|
// if (!ObjectUtils.isEmpty(codeList)) {
|
|
// if (!ObjectUtils.isEmpty(codeList)) {
|
|
@@ -819,8 +823,8 @@ public class GeoHazardMonitorTokenController {
|
|
// log.info("-----add1----" + add1);
|
|
// log.info("-----add1----" + add1);
|
|
AlarmListVo alarmListVo = new AlarmListVo();
|
|
AlarmListVo alarmListVo = new AlarmListVo();
|
|
//alarmList对象
|
|
//alarmList对象
|
|
- alarmListVo.setCameraStream(playFlv);
|
|
|
|
- alarmListVo.setCameraCode(baseList.get(o).getCameraCode());
|
|
|
|
|
|
+ alarmListVo.setCameraStream(playFlv);
|
|
|
|
+ alarmListVo.setCameraCode(baseList.get(0).getCameraCode());
|
|
//alarmInfo对象
|
|
//alarmInfo对象
|
|
AlarmInfoVo alarmInfoVo1 = new AlarmInfoVo();
|
|
AlarmInfoVo alarmInfoVo1 = new AlarmInfoVo();
|
|
alarmInfoVo1.setAlarmId(list.get(i).getAlarmId());
|
|
alarmInfoVo1.setAlarmId(list.get(i).getAlarmId());
|
|
@@ -841,55 +845,55 @@ public class GeoHazardMonitorTokenController {
|
|
}
|
|
}
|
|
alarmInfoVo1.setAlarmFiles(vo);
|
|
alarmInfoVo1.setAlarmFiles(vo);
|
|
}
|
|
}
|
|
- alarmListVo.setAlarmInfo(alarmInfoVo1);
|
|
|
|
- listVos.add(alarmListVo);
|
|
|
|
- }
|
|
|
|
- ArrayList<String> list3 = new ArrayList<>();
|
|
|
|
- //添加缓存
|
|
|
|
- List<String> stringList = redisCache.getCacheObject("heartbeat");
|
|
|
|
- for (BaseCameraManagement baseCameraManagement : baseList) {
|
|
|
|
- String code = baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel();
|
|
|
|
- list3.add(code);
|
|
|
|
- }
|
|
|
|
- if (!ObjectUtils.isEmpty(stringList)) {
|
|
|
|
- list3.addAll(stringList);
|
|
|
|
- }
|
|
|
|
- log.info("--------------heartbeat--------------:" + list3);
|
|
|
|
- redisCache.setCacheObject("heartbeat", list3);
|
|
|
|
- //获取缓冲
|
|
|
|
- List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
- log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
|
|
- List<String> cameraPlayList = redisCache.getCacheObject("cameraPlay");
|
|
|
|
- log.info("--------------cameraPlayList--------------:" + cameraPlayList);
|
|
|
|
- if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
- if (!ObjectUtils.isEmpty(cameraPlayList)) {
|
|
|
|
- heartbeat.addAll(cameraPlayList);
|
|
|
|
- }
|
|
|
|
- log.info("--------------heartbeat222--------------:" + heartbeat);
|
|
|
|
- List<String> rtspApiList = cameraUtil.rtspApiList();
|
|
|
|
- log.info("--------------rtspApiList1111--------------:" + rtspApiList);
|
|
|
|
- if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
- rtspApiList.removeAll(heartbeat);
|
|
|
|
- }
|
|
|
|
- log.info("--------------rtspApiList2222--------------:" + rtspApiList);
|
|
|
|
- if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
- for (String str : rtspApiList) {
|
|
|
|
- log.info("--------------str--------------:" + str);
|
|
|
|
- String[] parts = str.split("/");
|
|
|
|
- log.info("--------------parts--------------:" + parts);
|
|
|
|
- if (parts.length == 2) {
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
- try {
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ alarmListVo.setAlarmInfo(alarmInfoVo1);
|
|
|
|
+ listVos.add(alarmListVo);
|
|
|
|
+ break;
|
|
|
|
+ //ArrayList<String> list3 = new ArrayList<>();
|
|
|
|
+ ////添加缓存
|
|
|
|
+ //List<String> stringList = redisCache.getCacheObject("heartbeat");
|
|
|
|
+ //for (BaseCameraManagement baseCameraManagement : baseList) {
|
|
|
|
+ // String code = baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel();
|
|
|
|
+ // list3.add(code);
|
|
|
|
+ //}
|
|
|
|
+ //if (!ObjectUtils.isEmpty(stringList)) {
|
|
|
|
+ // list3.addAll(stringList);
|
|
|
|
+ //}
|
|
|
|
+ //log.info("--------------heartbeat--------------:" + list3);
|
|
|
|
+ //redisCache.setCacheObject("heartbeat", list3);
|
|
|
|
+ ////获取缓冲
|
|
|
|
+ //List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
+ //log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
|
|
+ //List<String> cameraPlayList = redisCache.getCacheObject("cameraPlay");
|
|
|
|
+ //log.info("--------------cameraPlayList--------------:" + cameraPlayList);
|
|
|
|
+ //if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
+ // if (!ObjectUtils.isEmpty(cameraPlayList)) {
|
|
|
|
+ // heartbeat.addAll(cameraPlayList);
|
|
|
|
+ // }
|
|
|
|
+ // log.info("--------------heartbeat222--------------:" + heartbeat);
|
|
|
|
+ // List<String> rtspApiList = cameraUtil.rtspApiList();
|
|
|
|
+ // log.info("--------------rtspApiList1111--------------:" + rtspApiList);
|
|
|
|
+ // if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
+ // rtspApiList.removeAll(heartbeat);
|
|
|
|
+ // }
|
|
|
|
+ // log.info("--------------rtspApiList2222--------------:" + rtspApiList);
|
|
|
|
+ // if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
+ // for (String str : rtspApiList) {
|
|
|
|
+ // log.info("--------------str--------------:" + str);
|
|
|
|
+ // String[] parts = str.split("/");
|
|
|
|
+ // log.info("--------------parts--------------:" + parts);
|
|
|
|
+ // if (parts.length == 2) {
|
|
|
|
+ // CompletableFuture.runAsync(() -> {
|
|
|
|
+ // try {
|
|
|
|
+ // TimeUnit.SECONDS.sleep(3);
|
|
|
|
+ // } catch (InterruptedException e) {
|
|
|
|
+ // e.printStackTrace();
|
|
|
|
+ // }
|
|
|
|
+ // cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
AlarmListVo[] array = listVos.toArray(new AlarmListVo[]{});
|
|
AlarmListVo[] array = listVos.toArray(new AlarmListVo[]{});
|
|
@@ -928,50 +932,50 @@ public class GeoHazardMonitorTokenController {
|
|
}
|
|
}
|
|
ArrayList<String> list3 = new ArrayList<>();
|
|
ArrayList<String> list3 = new ArrayList<>();
|
|
//添加缓存
|
|
//添加缓存
|
|
- List<String> stringList = redisCache.getCacheObject("heartbeat");
|
|
|
|
|
|
+ //List<String> stringList = redisCache.getCacheObject("heartbeat");
|
|
for (BaseCameraManagement baseCameraManagement : list1) {
|
|
for (BaseCameraManagement baseCameraManagement : list1) {
|
|
- String code = baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel();
|
|
|
|
|
|
+ String code = baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel() + "/h264_720";
|
|
list3.add(code);
|
|
list3.add(code);
|
|
}
|
|
}
|
|
- if (!ObjectUtils.isEmpty(stringList)) {
|
|
|
|
- list3.addAll(stringList);
|
|
|
|
- }
|
|
|
|
|
|
+ //if (!ObjectUtils.isEmpty(stringList)) {
|
|
|
|
+ // list3.addAll(stringList);
|
|
|
|
+ //}
|
|
log.info("--------------heartbeat--------------:" + list3);
|
|
log.info("--------------heartbeat--------------:" + list3);
|
|
redisCache.setCacheObject("heartbeat", list3);
|
|
redisCache.setCacheObject("heartbeat", list3);
|
|
//获取缓冲
|
|
//获取缓冲
|
|
- List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
- log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
|
|
- List<String> cameraPlayList = redisCache.getCacheObject("cameraPlay");
|
|
|
|
- log.info("--------------cameraPlayList--------------:" + cameraPlayList);
|
|
|
|
- if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
- if (!ObjectUtils.isEmpty(cameraPlayList)) {
|
|
|
|
- heartbeat.addAll(cameraPlayList);
|
|
|
|
- }
|
|
|
|
- log.info("--------------heartbeat222--------------:" + heartbeat);
|
|
|
|
- List<String> rtspApiList = cameraUtil.rtspApiList();
|
|
|
|
- log.info("--------------rtspApiList1111--------------:" + rtspApiList);
|
|
|
|
- if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
- rtspApiList.removeAll(heartbeat);
|
|
|
|
- }
|
|
|
|
- log.info("--------------rtspApiList2222--------------:" + rtspApiList);
|
|
|
|
- if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
- for (String str : rtspApiList) {
|
|
|
|
- log.info("--------------str--------------:" + str);
|
|
|
|
- String[] parts = str.split("/");
|
|
|
|
- log.info("--------------parts--------------:" + parts);
|
|
|
|
- if (parts.length == 2) {
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
- try {
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
+ //log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
|
|
+ //List<String> cameraPlayList = redisCache.getCacheObject("cameraPlay");
|
|
|
|
+ //log.info("--------------cameraPlayList--------------:" + cameraPlayList);
|
|
|
|
+ //if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
+ // if (!ObjectUtils.isEmpty(cameraPlayList)) {
|
|
|
|
+ // heartbeat.addAll(cameraPlayList);
|
|
|
|
+ // }
|
|
|
|
+ // log.info("--------------heartbeat222--------------:" + heartbeat);
|
|
|
|
+ // List<String> rtspApiList = cameraUtil.rtspApiList();
|
|
|
|
+ // log.info("--------------rtspApiList1111--------------:" + rtspApiList);
|
|
|
|
+ // if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
+ // rtspApiList.removeAll(heartbeat);
|
|
|
|
+ // }
|
|
|
|
+ // log.info("--------------rtspApiList2222--------------:" + rtspApiList);
|
|
|
|
+ // if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
+ // for (String str : rtspApiList) {
|
|
|
|
+ // log.info("--------------str--------------:" + str);
|
|
|
|
+ // String[] parts = str.split("/");
|
|
|
|
+ // log.info("--------------parts--------------:" + parts);
|
|
|
|
+ // if (parts.length == 2) {
|
|
|
|
+ // CompletableFuture.runAsync(() -> {
|
|
|
|
+ // try {
|
|
|
|
+ // TimeUnit.SECONDS.sleep(3);
|
|
|
|
+ // } catch (InterruptedException e) {
|
|
|
|
+ // e.printStackTrace();
|
|
|
|
+ // }
|
|
|
|
+ // cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
} else {
|
|
} else {
|
|
//没有报警信息的时候
|
|
//没有报警信息的时候
|
|
if (heartbeatVo.getLineDir() == 1) {
|
|
if (heartbeatVo.getLineDir() == 1) {
|
|
@@ -1016,38 +1020,38 @@ public class GeoHazardMonitorTokenController {
|
|
ArrayList<String> list3 = new ArrayList<>();
|
|
ArrayList<String> list3 = new ArrayList<>();
|
|
//添加缓存
|
|
//添加缓存
|
|
for (BaseCameraManagement baseCameraManagement : list1) {
|
|
for (BaseCameraManagement baseCameraManagement : list1) {
|
|
- String code = baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel();
|
|
|
|
|
|
+ String code = baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel() + "/h264_720";
|
|
list3.add(code);
|
|
list3.add(code);
|
|
}
|
|
}
|
|
log.info("--------------heartbeat--------------:" + list3);
|
|
log.info("--------------heartbeat--------------:" + list3);
|
|
redisCache.setCacheObject("heartbeat", list3);
|
|
redisCache.setCacheObject("heartbeat", list3);
|
|
//获取缓冲
|
|
//获取缓冲
|
|
- List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
- log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
|
|
- List<String> cameraPlayList = redisCache.getCacheObject("cameraPlay");
|
|
|
|
- log.info("--------------cameraPlayList--------------:" + cameraPlayList);
|
|
|
|
- if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
- if (!ObjectUtils.isEmpty(cameraPlayList)) {
|
|
|
|
- heartbeat.addAll(cameraPlayList);
|
|
|
|
- }
|
|
|
|
- log.info("--------------heartbeat222--------------:" + heartbeat);
|
|
|
|
- List<String> rtspApiList = cameraUtil.rtspApiList();
|
|
|
|
- log.info("--------------rtspApiList1111--------------:" + rtspApiList);
|
|
|
|
- if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
- rtspApiList.removeAll(heartbeat);
|
|
|
|
- }
|
|
|
|
- log.info("--------------rtspApiList2222--------------:" + rtspApiList);
|
|
|
|
- if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
- for (String str : rtspApiList) {
|
|
|
|
- log.info("--------------str--------------:" + str);
|
|
|
|
- String[] parts = str.split("/");
|
|
|
|
- log.info("--------------parts--------------:" + parts);
|
|
|
|
- if (parts.length == 2) {
|
|
|
|
- cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
+ //log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
|
|
+ //List<String> cameraPlayList = redisCache.getCacheObject("cameraPlay");
|
|
|
|
+ //log.info("--------------cameraPlayList--------------:" + cameraPlayList);
|
|
|
|
+ //if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
+ // if (!ObjectUtils.isEmpty(cameraPlayList)) {
|
|
|
|
+ // heartbeat.addAll(cameraPlayList);
|
|
|
|
+ // }
|
|
|
|
+ // log.info("--------------heartbeat222--------------:" + heartbeat);
|
|
|
|
+ // List<String> rtspApiList = cameraUtil.rtspApiList();
|
|
|
|
+ // log.info("--------------rtspApiList1111--------------:" + rtspApiList);
|
|
|
|
+ // if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
+ // rtspApiList.removeAll(heartbeat);
|
|
|
|
+ // }
|
|
|
|
+ // log.info("--------------rtspApiList2222--------------:" + rtspApiList);
|
|
|
|
+ // if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
+ // for (String str : rtspApiList) {
|
|
|
|
+ // log.info("--------------str--------------:" + str);
|
|
|
|
+ // String[] parts = str.split("/");
|
|
|
|
+ // log.info("--------------parts--------------:" + parts);
|
|
|
|
+ // if (parts.length == 2) {
|
|
|
|
+ // cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
} else {
|
|
} else {
|
|
log.info("-------------->>已进入拉一路视频");
|
|
log.info("-------------->>已进入拉一路视频");
|
|
log.info("list1-------------->>" + list1.size());
|
|
log.info("list1-------------->>" + list1.size());
|
|
@@ -1060,45 +1064,45 @@ public class GeoHazardMonitorTokenController {
|
|
ArrayList<String> list3 = new ArrayList<>();
|
|
ArrayList<String> list3 = new ArrayList<>();
|
|
//添加缓存
|
|
//添加缓存
|
|
for (BaseCameraManagement baseCameraManagement : list1) {
|
|
for (BaseCameraManagement baseCameraManagement : list1) {
|
|
- String code = baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel();
|
|
|
|
|
|
+ String code = baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel() + "/h264_720";
|
|
list3.add(code);
|
|
list3.add(code);
|
|
}
|
|
}
|
|
log.info("--------------heartbeat--------------:" + list3);
|
|
log.info("--------------heartbeat--------------:" + list3);
|
|
redisCache.setCacheObject("heartbeat", list3);
|
|
redisCache.setCacheObject("heartbeat", list3);
|
|
//获取缓冲
|
|
//获取缓冲
|
|
- List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
- log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
|
|
- List<String> cameraPlayList = redisCache.getCacheObject("cameraPlay");
|
|
|
|
- log.info("--------------cameraPlayList--------------:" + cameraPlayList);
|
|
|
|
- if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
- if (!ObjectUtils.isEmpty(cameraPlayList)) {
|
|
|
|
- heartbeat.addAll(cameraPlayList);
|
|
|
|
- }
|
|
|
|
- log.info("--------------heartbeat222--------------:" + heartbeat);
|
|
|
|
- List<String> rtspApiList = cameraUtil.rtspApiList();
|
|
|
|
- log.info("--------------rtspApiList1111--------------:" + rtspApiList);
|
|
|
|
- if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
- rtspApiList.removeAll(heartbeat);
|
|
|
|
- }
|
|
|
|
- log.info("--------------rtspApiList2222--------------:" + rtspApiList);
|
|
|
|
- if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
- for (String str : rtspApiList) {
|
|
|
|
- log.info("--------------str--------------:" + str);
|
|
|
|
- String[] parts = str.split("/");
|
|
|
|
- log.info("--------------parts--------------:" + parts);
|
|
|
|
- if (parts.length == 2) {
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
- try {
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
+ //log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
|
|
+ //List<String> cameraPlayList = redisCache.getCacheObject("cameraPlay");
|
|
|
|
+ //log.info("--------------cameraPlayList--------------:" + cameraPlayList);
|
|
|
|
+ //if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
+ // if (!ObjectUtils.isEmpty(cameraPlayList)) {
|
|
|
|
+ // heartbeat.addAll(cameraPlayList);
|
|
|
|
+ // }
|
|
|
|
+ // log.info("--------------heartbeat222--------------:" + heartbeat);
|
|
|
|
+ // List<String> rtspApiList = cameraUtil.rtspApiList();
|
|
|
|
+ // log.info("--------------rtspApiList1111--------------:" + rtspApiList);
|
|
|
|
+ // if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
+ // rtspApiList.removeAll(heartbeat);
|
|
|
|
+ // }
|
|
|
|
+ // log.info("--------------rtspApiList2222--------------:" + rtspApiList);
|
|
|
|
+ // if (!ObjectUtils.isEmpty(rtspApiList)) {
|
|
|
|
+ // for (String str : rtspApiList) {
|
|
|
|
+ // log.info("--------------str--------------:" + str);
|
|
|
|
+ // String[] parts = str.split("/");
|
|
|
|
+ // log.info("--------------parts--------------:" + parts);
|
|
|
|
+ // if (parts.length == 2) {
|
|
|
|
+ // CompletableFuture.runAsync(() -> {
|
|
|
|
+ // try {
|
|
|
|
+ // TimeUnit.SECONDS.sleep(3);
|
|
|
|
+ // } catch (InterruptedException e) {
|
|
|
|
+ // e.printStackTrace();
|
|
|
|
+ // }
|
|
|
|
+ // cameraUtil.stopStream(parts[0], parts[1]);
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
twoMap.put("currentStream", playFlv);
|
|
twoMap.put("currentStream", playFlv);
|
|
twoMap.put("cameraCode", list1.get(0).getCameraCode());
|
|
twoMap.put("cameraCode", list1.get(0).getCameraCode());
|
|
@@ -1262,6 +1266,13 @@ public class GeoHazardMonitorTokenController {
|
|
twoMap.put("currentStream", playFlv);
|
|
twoMap.put("currentStream", playFlv);
|
|
twoMap.put("cameraCode", list1.get(0).getCameraCode());
|
|
twoMap.put("cameraCode", list1.get(0).getCameraCode());
|
|
respHeartbeatVo.setCurrentStream(playFlv);
|
|
respHeartbeatVo.setCurrentStream(playFlv);
|
|
|
|
+ //赋值--股道
|
|
|
|
+ List<BaseRouteMassage> list = baseRouteMassageService.list();
|
|
|
|
+ if (!ObjectUtils.isEmpty(list)) {
|
|
|
|
+ if (list.get(0).getMileagePosition() - heartbeatVo.getCurrentMile() <= 500 && list.get(0).getMileagePosition() - heartbeatVo.getCurrentMile() >= 0) {
|
|
|
|
+ respHeartbeatVo.setRouteTrack(list.get(0).getRouteStationTrack());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
respHeartbeatVo.setIsAlarm(2);
|
|
respHeartbeatVo.setIsAlarm(2);
|
|
respHeartbeatVo.setCameraCode(list1.get(0).getCameraCode());
|
|
respHeartbeatVo.setCameraCode(list1.get(0).getCameraCode());
|
|
respHeartbeatVo.setAlarmList(null);
|
|
respHeartbeatVo.setAlarmList(null);
|
|
@@ -1946,4 +1957,58 @@ public class GeoHazardMonitorTokenController {
|
|
String s1 = JSONObject.toJSONString(vo);
|
|
String s1 = JSONObject.toJSONString(vo);
|
|
return SM4Utils.encryptData_ECB(s1, "4370780c9a8c43e5");
|
|
return SM4Utils.encryptData_ECB(s1, "4370780c9a8c43e5");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 添加进路信息
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/api/addRouteMassage")
|
|
|
|
+ public String addRouteMassage(@RequestBody BaseRouteMassage baseRouteMassage) {
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseRouteMassage) && !ObjectUtils.isEmpty(baseRouteMassage.getStationCode())) {
|
|
|
|
+ BaseRouteMassage one = baseRouteMassageService.getOne(new LambdaQueryWrapper<BaseRouteMassage>().eq(BaseRouteMassage::getStationCode, baseRouteMassage.getStationCode()));
|
|
|
|
+ if (!ObjectUtils.isEmpty(one)) {
|
|
|
|
+ return "车站编码已存在!";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ baseRouteMassage.setCreateTime(new Date());
|
|
|
|
+ baseRouteMassage.setStationName("博野站");
|
|
|
|
+ baseRouteMassageService.save(baseRouteMassage);
|
|
|
|
+ return "200";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询进路信息
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/api/getRouteMassageList")
|
|
|
|
+ public List<BaseRouteMassage> getRouteMassageList() {
|
|
|
|
+ return baseRouteMassageService.list();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除进路信息
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/api/deleteRouteMassage")
|
|
|
|
+ public String deleteRouteMassage(@RequestBody BaseRouteMassage baseRouteMassage) {
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseRouteMassage) && !ObjectUtils.isEmpty(baseRouteMassage.getId())) {
|
|
|
|
+ baseRouteMassageService.removeById(baseRouteMassage.getId());
|
|
|
|
+ return "200";
|
|
|
|
+ } else {
|
|
|
|
+ return "ID不存在";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * ttt
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/api/ttt")
|
|
|
|
+ public void ttt() {
|
|
|
|
+ cameraUtil.heartbeatGetPlayFlv();
|
|
|
|
+ }
|
|
}
|
|
}
|