|
@@ -709,7 +709,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
twoMap.put("currentStream", playFlv1);
|
|
|
twoMap.put("cameraCode", baseCameraManagementList.get(0).getCameraCode());
|
|
|
} else {
|
|
|
- AjaxResults1 = new AjaxResults(0, "报警里程无可用相机",respHeartbeatVo);
|
|
|
+ AjaxResults1 = new AjaxResults(0, "报警里程无可用相机", respHeartbeatVo);
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
}
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
@@ -825,7 +825,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if (!ObjectUtils.isEmpty(preAlarm.getPreAlarmList())) {
|
|
|
+ } else if (!ObjectUtils.isEmpty(preAlarm.getPreAlarmList()) && preAlarm.getPreAlarmList().length() > 0) {
|
|
|
+ log.info("preAlarm.getPreAlarmList()------"+preAlarm.getPreAlarmList());
|
|
|
List<PreAlarmListResponse> responseList = new ArrayList<>();
|
|
|
List<PreAlarmResponse.PreAlarmList> preAlarmList = JSON.parseArray(preAlarm.getPreAlarmList(), PreAlarmResponse.PreAlarmList.class);
|
|
|
Comparator<PreAlarmResponse.PreAlarmList> distanceComparator = new Comparator<PreAlarmResponse.PreAlarmList>() {
|
|
@@ -838,7 +839,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
preAlarmList.sort(distanceComparator);
|
|
|
for (int i = 0; i < preAlarmList.size(); i++) {
|
|
|
PreAlarmListResponse preAlarmListResponse = new PreAlarmListResponse();
|
|
|
- int mile=0;
|
|
|
+ int mile = 0;
|
|
|
LambdaQueryWrapper<BaseCameraManagement> wrapper1 = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
if (heartbeatVo.getLineDir() == 1) {
|
|
|
mile = preAlarmList.get(i).getDistance() + heartbeatVo.getCurrentMile();
|
|
@@ -879,7 +880,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
preAlarmListResponse.setCameraStream(cameraUtil.heartbeatgetPlayFlv(baseCameraManagement.getCameraCode(), baseCameraManagement.getGraphicsCard(), type));
|
|
|
}
|
|
|
if (i == 0) {
|
|
|
- playFlv1 =cameraUtil.heartbeatgetPlayFlv(code, graphicsCard, type);
|
|
|
+ playFlv1 = cameraUtil.heartbeatgetPlayFlv(code, graphicsCard, type);
|
|
|
if (StringUtils.isEmpty(playFlv1)) {
|
|
|
playFlv1 = cameraUtil.heartbeatgetUrl(code, graphicsCard, type);
|
|
|
if (playFlv1.contains("无视频")) {
|
|
@@ -900,7 +901,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
twoMap.put("currentStream", playFlv1);
|
|
|
twoMap.put("cameraCode", baseCameraManagementList.get(0).getCameraCode());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
preAlarmListResponse.setCameraCode("");
|
|
|
preAlarmListResponse.setCameraStream("");
|
|
|
}
|
|
@@ -931,7 +932,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
camera.last("limit 2");
|
|
|
List<BaseCameraManagement> list1 = baseCameraManagementService.list(camera);
|
|
|
if (list1.size() <= 0) {
|
|
|
- AjaxResults1 = new AjaxResults(0, "前方没有摄像机",respHeartbeatVo);
|
|
|
+ AjaxResults1 = new AjaxResults(0, "前方没有摄像机", respHeartbeatVo);
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
}
|
|
|
log.info("流程1----------------->");
|
|
@@ -1017,7 +1018,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
twoMap.put("cameraCode", list1.get(0).getCameraCode());
|
|
|
respHeartbeatVo.setIsAlarm(2);
|
|
|
}
|
|
|
- }else if (!ObjectUtils.isEmpty(preAlarm.getPreAlarmList())){
|
|
|
+ } else if (!ObjectUtils.isEmpty(preAlarm.getPreAlarmList()) && preAlarm.getPreAlarmList().length() > 0) {
|
|
|
List<PreAlarmListResponse> responseList = new ArrayList<>();
|
|
|
List<PreAlarmResponse.PreAlarmList> preAlarmList = JSON.parseArray(preAlarm.getPreAlarmList(), PreAlarmResponse.PreAlarmList.class);
|
|
|
Comparator<PreAlarmResponse.PreAlarmList> distanceComparator = new Comparator<PreAlarmResponse.PreAlarmList>() {
|
|
@@ -1030,7 +1031,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
preAlarmList.sort(distanceComparator);
|
|
|
for (int i = 0; i < preAlarmList.size(); i++) {
|
|
|
PreAlarmListResponse preAlarmListResponse = new PreAlarmListResponse();
|
|
|
- int mile=0;
|
|
|
+ int mile = 0;
|
|
|
LambdaQueryWrapper<BaseCameraManagement> wrapper1 = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
if (heartbeatVo.getLineDir() == 1) {
|
|
|
mile = preAlarmList.get(i).getDistance() + heartbeatVo.getCurrentMile();
|
|
@@ -1071,7 +1072,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
preAlarmListResponse.setCameraStream(cameraUtil.heartbeatgetPlayFlv(baseCameraManagement.getCameraCode(), baseCameraManagement.getGraphicsCard(), type));
|
|
|
}
|
|
|
if (i == 0) {
|
|
|
- playFlv1 =cameraUtil.heartbeatgetPlayFlv(code, graphicsCard, type);
|
|
|
+ playFlv1 = cameraUtil.heartbeatgetPlayFlv(code, graphicsCard, type);
|
|
|
if (StringUtils.isEmpty(playFlv1)) {
|
|
|
playFlv1 = cameraUtil.heartbeatgetUrl(code, graphicsCard, type);
|
|
|
if (playFlv1.contains("无视频")) {
|
|
@@ -1092,7 +1093,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
twoMap.put("currentStream", playFlv1);
|
|
|
twoMap.put("cameraCode", baseCameraManagementList.get(0).getCameraCode());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
preAlarmListResponse.setCameraCode("");
|
|
|
preAlarmListResponse.setCameraStream("");
|
|
|
}
|
|
@@ -1123,7 +1124,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
base.last("limit 2");
|
|
|
List<BaseCameraManagement> list1 = baseCameraManagementService.list(base);
|
|
|
if (list1.size() <= 0) {
|
|
|
- AjaxResults1 = new AjaxResults(0, "前方没有摄像机",respHeartbeatVo);
|
|
|
+ AjaxResults1 = new AjaxResults(0, "前方没有摄像机", respHeartbeatVo);
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
}
|
|
|
log.info("流程2----------------->");
|
|
@@ -1244,7 +1245,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
} else {
|
|
|
AjaxResults1 = new AjaxResults(0, "视频加载中", respHeartbeatVo);
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
AjaxResults1 = new AjaxResults(1, "ok", respHeartbeatVo);
|
|
|
}
|
|
|
long end = System.currentTimeMillis();
|