|
@@ -169,7 +169,7 @@ public class GeoHazardMonitorTokenController {
|
|
public String getWebToken(@RequestBody SvcAddress svcAddress) {
|
|
public String getWebToken(@RequestBody SvcAddress svcAddress) {
|
|
// 生成令牌
|
|
// 生成令牌
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
- if (ObjectUtils.isEmpty(svcAddress)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(svcAddress)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "svcAddress参数不能为空");
|
|
jsonObject.put("data", "svcAddress参数不能为空");
|
|
@@ -498,7 +498,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
@@ -700,36 +700,36 @@ 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<>();
|
|
|
|
- //添加缓存
|
|
|
|
- String code = baseCameraManagementList.get(0).getCameraCode() + "/" + baseCameraManagementList.get(0).getChannel();
|
|
|
|
- list3.add(code);
|
|
|
|
- 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--------------:" + Arrays.toString(parts));
|
|
|
|
- if (parts.length == 2) {
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
- try {
|
|
|
|
|
|
+ ArrayList<String> list3 = new ArrayList<>();
|
|
|
|
+ //添加缓存
|
|
|
|
+ String code = baseCameraManagementList.get(0).getCameraCode() + "/" + baseCameraManagementList.get(0).getChannel();
|
|
|
|
+ list3.add(code);
|
|
|
|
+ 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--------------:" + Arrays.toString(parts));
|
|
|
|
+ if (parts.length == 2) {
|
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
|
+ try {
|
|
TimeUnit.SECONDS.sleep(3);
|
|
TimeUnit.SECONDS.sleep(3);
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -802,12 +802,12 @@ public class GeoHazardMonitorTokenController {
|
|
//获取所有报警安装里程位置的相机
|
|
//获取所有报警安装里程位置的相机
|
|
List<BaseCameraManagement> baseList = baseCameraManagementService.list(ment);
|
|
List<BaseCameraManagement> baseList = baseCameraManagementService.list(ment);
|
|
if (baseList.size() > 0) {
|
|
if (baseList.size() > 0) {
|
|
- //判断流媒体是否有流
|
|
|
|
- String playFlv = null;
|
|
|
|
|
|
+ //判断流媒体是否有流
|
|
|
|
+ String playFlv = null;
|
|
playFlv = cameraUtil.heartbeatgetPlayFlv(baseList.get(0).getCameraCode(), baseList.get(0).getChannel(), type);
|
|
playFlv = cameraUtil.heartbeatgetPlayFlv(baseList.get(0).getCameraCode(), baseList.get(0).getChannel(), type);
|
|
- if (StringUtils.isEmpty(playFlv)) {
|
|
|
|
- playFlv = cameraUtil.heartbeatgetUrl(baseList.get(0).getCameraCode(), baseList.get(0).getChannel(), type);
|
|
|
|
- }
|
|
|
|
|
|
+ if (StringUtils.isEmpty(playFlv)) {
|
|
|
|
+ playFlv = cameraUtil.heartbeatgetUrl(baseList.get(0).getCameraCode(), baseList.get(0).getChannel(), type);
|
|
|
|
+ }
|
|
// //判断心跳相机日志表后两条数据是否包含该相机编码
|
|
// //判断心跳相机日志表后两条数据是否包含该相机编码
|
|
// if (!ObjectUtils.isEmpty(codeList)) {
|
|
// if (!ObjectUtils.isEmpty(codeList)) {
|
|
// if (!codeList.contains(baseList.get(o).getCameraCode())) {
|
|
// if (!codeList.contains(baseList.get(o).getCameraCode())) {
|
|
@@ -821,45 +821,40 @@ public class GeoHazardMonitorTokenController {
|
|
// //添加心跳相机日志信息
|
|
// //添加心跳相机日志信息
|
|
// int add1 = terminalHeartbeatLogService.add(baseList.get(o).getCameraCode(), baseList.get(o).getChannel());
|
|
// int add1 = terminalHeartbeatLogService.add(baseList.get(o).getCameraCode(), baseList.get(o).getChannel());
|
|
// log.info("-----add1----" + add1);
|
|
// log.info("-----add1----" + add1);
|
|
- AlarmListVo alarmListVo = new AlarmListVo();
|
|
|
|
- //alarmList对象
|
|
|
|
|
|
+ AlarmListVo alarmListVo = new AlarmListVo();
|
|
|
|
+ //alarmList对象
|
|
alarmListVo.setCameraStream(playFlv);
|
|
alarmListVo.setCameraStream(playFlv);
|
|
alarmListVo.setCameraCode(baseList.get(0).getCameraCode());
|
|
alarmListVo.setCameraCode(baseList.get(0).getCameraCode());
|
|
- //alarmInfo对象
|
|
|
|
- AlarmInfoVo alarmInfoVo1 = new AlarmInfoVo();
|
|
|
|
- alarmInfoVo1.setAlarmId(list.get(i).getAlarmId());
|
|
|
|
- alarmInfoVo1.setAlarmMile(list.get(i).getAlarmMile());
|
|
|
|
- alarmInfoVo1.setAlarmTime(list.get(i).getAlarmTime().getTime());
|
|
|
|
- alarmInfoVo1.setAlarmType(list.get(i).getAlarmType());
|
|
|
|
- alarmInfoVo1.setAlarmContent(list.get(i).getContent());
|
|
|
|
- alarmInfoVo1.setAlarmLevel(list.get(i).getAlarmLevel());
|
|
|
|
- LambdaQueryWrapper<MsgAlarmExt> alarm = new LambdaQueryWrapper<>();
|
|
|
|
- alarm.eq(MsgAlarmExt::getAlarmId, list.get(i).getAlarmId());
|
|
|
|
- List<MsgAlarmExt> list1 = msgAlarmExtService.list(alarm);
|
|
|
|
- if (list1.size() > 0) {
|
|
|
|
- AlarmFilesVo[] vo = new AlarmFilesVo[list1.size()];
|
|
|
|
- for (int i1 = 0; i1 < list1.size(); i1++) {
|
|
|
|
- vo[i1] = new AlarmFilesVo();
|
|
|
|
- vo[i1].setAlarmAttType(list1.get(i1).getAlarmAttType());
|
|
|
|
- vo[i1].setAlarmAttPath(list1.get(i1).getAlarmAttPath());
|
|
|
|
- }
|
|
|
|
- alarmInfoVo1.setAlarmFiles(vo);
|
|
|
|
|
|
+ //alarmInfo对象
|
|
|
|
+ AlarmInfoVo alarmInfoVo1 = new AlarmInfoVo();
|
|
|
|
+ alarmInfoVo1.setAlarmId(list.get(i).getAlarmId());
|
|
|
|
+ alarmInfoVo1.setAlarmMile(list.get(i).getAlarmMile());
|
|
|
|
+ alarmInfoVo1.setAlarmTime(list.get(i).getAlarmTime().getTime());
|
|
|
|
+ alarmInfoVo1.setAlarmType(list.get(i).getAlarmType());
|
|
|
|
+ alarmInfoVo1.setAlarmContent(list.get(i).getContent());
|
|
|
|
+ alarmInfoVo1.setAlarmLevel(list.get(i).getAlarmLevel());
|
|
|
|
+ LambdaQueryWrapper<MsgAlarmExt> alarm = new LambdaQueryWrapper<>();
|
|
|
|
+ alarm.eq(MsgAlarmExt::getAlarmId, list.get(i).getAlarmId());
|
|
|
|
+ List<MsgAlarmExt> list1 = msgAlarmExtService.list(alarm);
|
|
|
|
+ if (list1.size() > 0) {
|
|
|
|
+ AlarmFilesVo[] vo = new AlarmFilesVo[list1.size()];
|
|
|
|
+ for (int i1 = 0; i1 < list1.size(); i1++) {
|
|
|
|
+ vo[i1] = new AlarmFilesVo();
|
|
|
|
+ vo[i1].setAlarmAttType(list1.get(i1).getAlarmAttType());
|
|
|
|
+ vo[i1].setAlarmAttPath(list1.get(i1).getAlarmAttPath());
|
|
}
|
|
}
|
|
|
|
+ alarmInfoVo1.setAlarmFiles(vo);
|
|
|
|
+ }
|
|
alarmListVo.setAlarmInfo(alarmInfoVo1);
|
|
alarmListVo.setAlarmInfo(alarmInfoVo1);
|
|
listVos.add(alarmListVo);
|
|
listVos.add(alarmListVo);
|
|
- break;
|
|
|
|
- //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 : 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);
|
|
|
|
|
|
+ String code = baseList.get(0).getCameraCode() + "/" + baseList.get(0).getChannel()+ "/h264_720";
|
|
|
|
+ list3.add(code);
|
|
|
|
+ log.info("--------------heartbeat--------------:" + list3);
|
|
|
|
+ redisCache.setCacheObject("heartbeat", list3);
|
|
|
|
+ break;
|
|
////获取缓冲
|
|
////获取缓冲
|
|
//List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
//List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
//log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
//log.info("--------------heartbeat111--------------:" + heartbeat);
|
|
@@ -932,14 +927,14 @@ 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() + "/h264_720";
|
|
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);
|
|
//获取缓冲
|
|
//获取缓冲
|
|
@@ -1324,7 +1319,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
@@ -1400,7 +1395,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
@@ -1494,7 +1489,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
@@ -1560,7 +1555,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
@@ -1616,7 +1611,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
@@ -1705,7 +1700,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
@@ -1791,7 +1786,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
@@ -1873,7 +1868,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
String[] split = token.split("-");
|
|
String[] split = token.split("-");
|
|
String key = split[split.length - 1];
|
|
String key = split[split.length - 1];
|
|
- if (ObjectUtils.isEmpty(parameterVo)){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(parameterVo)) {
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("resultCode", 0);
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("message", "失败");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|
|
jsonObject.put("data", "parameterVo参数不能为空");
|