|
@@ -215,7 +215,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
return JSONObject.toJSONString(AjaxResults1);
|
|
|
}
|
|
|
ArrayList<String> objects = apiTokenUtils.createGeoHazardMonitorToken(svcAddress.getGrantType().toString(), svcAddress.getClientId(), sm4);
|
|
|
- if (objects.size() > 0) {
|
|
|
+ if (!ObjectUtils.isEmpty(objects)) {
|
|
|
RespGeoHazardMonitorVo respGeoHazardMonitorVo = new RespGeoHazardMonitorVo();
|
|
|
respGeoHazardMonitorVo.setAccessToken(objects.get(1));
|
|
|
Long l = Long.valueOf(objects.get(0));
|
|
@@ -673,7 +673,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
List<BaseCameraManagement> baseCameraManagementList = baseCameraManagementService.list(camera);
|
|
|
log.info("-------baseCameraManagementList123111--------" + baseCameraManagementList);
|
|
|
List<AlarmListVo> listVos = new ArrayList<>();
|
|
|
- if (baseCameraManagementList.size() > 0) {
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagementList)) {
|
|
|
int minDifference = Integer.MAX_VALUE;
|
|
|
String code = null;
|
|
|
String graphicsCard = null;
|
|
@@ -783,7 +783,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
//获取所有报警安装里程位置的相机
|
|
|
List<BaseCameraManagement> baseList = baseCameraManagementService.list(ment);
|
|
|
- if (baseList.size() > 0) {
|
|
|
+ if (!ObjectUtils.isEmpty(baseList)) {
|
|
|
if (i == 0) {
|
|
|
int minDifference = Integer.MAX_VALUE;
|
|
|
String code = null;
|
|
@@ -839,7 +839,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
LambdaQueryWrapper<MsgAlarmExt> alarm = new LambdaQueryWrapper<>();
|
|
|
alarm.eq(MsgAlarmExt::getAlarmId, list.get(i).getAlarmId());
|
|
|
List<MsgAlarmExt> list1 = msgAlarmExtService.list(alarm);
|
|
|
- if (list1.size() > 0) {
|
|
|
+ if (!ObjectUtils.isEmpty(list1)) {
|
|
|
AlarmFilesVo[] vo = new AlarmFilesVo[list1.size()];
|
|
|
for (int i1 = 0; i1 < list1.size(); i1++) {
|
|
|
vo[i1] = new AlarmFilesVo();
|
|
@@ -920,7 +920,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
List<BaseCameraManagement> baseCameraManagementList = baseCameraManagementService.list(wrapper1);
|
|
|
log.info("-------baseCameraManagementList123111--------" + baseCameraManagementList);
|
|
|
- if (baseCameraManagementList.size() > 0) {
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagementList)) {
|
|
|
int minDifference = Integer.MAX_VALUE;
|
|
|
String code = null;
|
|
|
String graphicsCard = null;
|
|
@@ -965,7 +965,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
|
}
|
|
|
} else {
|
|
|
- if (i == 0 && respHeartbeatVo.getCameraList().size() == 0) {
|
|
|
+ if (i == 0) {
|
|
|
LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
|
|
|
if (heartbeatVo.getLineDir() == 1) {
|
|
|
distance = heartbeatVo.getVisualDistance() + heartbeatVo.getCurrentMile();
|
|
@@ -1049,7 +1049,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
camera.eq(BaseCameraManagement::getEnableOrNot, 1);
|
|
|
camera.last("limit 2");
|
|
|
List<BaseCameraManagement> list1 = baseCameraManagementService.list(camera);
|
|
|
- if (list1.size() <= 0) {
|
|
|
+ if (ObjectUtils.isEmpty(list1)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "前方没有摄像机", respHeartbeatVo);
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
}
|
|
@@ -1195,7 +1195,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
List<BaseCameraManagement> baseCameraManagementList = baseCameraManagementService.list(wrapper1);
|
|
|
log.info("-------baseCameraManagementList123111--------" + baseCameraManagementList);
|
|
|
- if (baseCameraManagementList.size() > 0) {
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagementList)) {
|
|
|
int minDifference = Integer.MAX_VALUE;
|
|
|
String code = null;
|
|
|
String graphicsCard = null;
|
|
@@ -1241,7 +1241,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
|
}
|
|
|
} else {
|
|
|
- if (i == 0 && respHeartbeatVo.getCameraList().size() == 0) {
|
|
|
+ if (i == 0) {
|
|
|
LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
|
|
|
if (heartbeatVo.getLineDir() == 1) {
|
|
|
distance = heartbeatVo.getVisualDistance() + heartbeatVo.getCurrentMile();
|
|
@@ -1325,7 +1325,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
base.eq(BaseCameraManagement::getEnableOrNot, 1);
|
|
|
base.last("limit 2");
|
|
|
List<BaseCameraManagement> list1 = baseCameraManagementService.list(base);
|
|
|
- if (list1.size() <= 0) {
|
|
|
+ if (ObjectUtils.isEmpty(list1)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "前方没有摄像机", respHeartbeatVo);
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
}
|
|
@@ -1594,7 +1594,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
wrapper.orderByAsc(BaseCameraManagement::getGrou).orderByAsc(BaseCameraManagement::getSort);
|
|
|
}
|
|
|
List<BaseCameraManagement> list = baseCameraManagementService.list(wrapper);
|
|
|
- if (list.size() <= 0) {
|
|
|
+ if (ObjectUtils.isEmpty(list)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "没有该线路编码或行别的相机信息");
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
}
|
|
@@ -1776,7 +1776,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
wrapper.orderByDesc(MsgAlarm::getAlarmTime);
|
|
|
List<MsgAlarm> list = msgAlarmService.list(wrapper);
|
|
|
- if (list.size() <= 0) {
|
|
|
+ if (ObjectUtils.isEmpty(list)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "没有该报警线路或行别的报警信息");
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
}
|
|
@@ -1795,7 +1795,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
LambdaQueryWrapper<MsgAlarmExt> alarm = new LambdaQueryWrapper<>();
|
|
|
alarm.eq(MsgAlarmExt::getAlarmId, msgAlarm.getAlarmId());
|
|
|
List<MsgAlarmExt> list1 = msgAlarmExtService.list(alarm);
|
|
|
- if (list1.size() > 0) {
|
|
|
+ if (!ObjectUtils.isEmpty(list1)) {
|
|
|
AlarmFilesVo[] vo = new AlarmFilesVo[list1.size()];
|
|
|
for (int i1 = 0; i1 < list1.size(); i1++) {
|
|
|
vo[i1] = new AlarmFilesVo();
|