Compare commits
4 Commits
d6520d777a
...
994e63bcde
| Author | SHA1 | Date | |
|---|---|---|---|
| 994e63bcde | |||
| 1898fe5db9 | |||
| 5230a95865 | |||
| 4d2b7c6adf |
@ -4,6 +4,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 报警信息
|
* 报警信息
|
||||||
|
* 0-强制报警,1-撞击闯入,2-自动报警,3-电子围栏告警
|
||||||
*
|
*
|
||||||
* @author: 默苍璃
|
* @author: 默苍璃
|
||||||
* @date: 2025-09-0114:24
|
* @date: 2025-09-0114:24
|
||||||
@ -21,7 +22,6 @@ public class AlarmInformationVo {
|
|||||||
*/
|
*/
|
||||||
private Integer processingAlarm = 0;
|
private Integer processingAlarm = 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 今日报警总数
|
* 今日报警总数
|
||||||
*/
|
*/
|
||||||
@ -32,7 +32,6 @@ public class AlarmInformationVo {
|
|||||||
*/
|
*/
|
||||||
private Integer processingAlarmToday = 0;
|
private Integer processingAlarmToday = 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 强制报警
|
* 强制报警
|
||||||
*/
|
*/
|
||||||
@ -44,12 +43,12 @@ public class AlarmInformationVo {
|
|||||||
private Integer intrusionImpact = 0;
|
private Integer intrusionImpact = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手动报警
|
* 自动报警
|
||||||
*/
|
*/
|
||||||
private Integer alarmManual = 0;
|
private Integer alarmAuto = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* 电子围栏告警
|
||||||
*/
|
*/
|
||||||
private Integer fenceElectronic = 0;
|
private Integer fenceElectronic = 0;
|
||||||
|
|
||||||
|
|||||||
@ -43,10 +43,10 @@ public class AlarmStatisticsVo implements Serializable {
|
|||||||
private Integer intrusionImpactAlarms = 0;
|
private Integer intrusionImpactAlarms = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手动报警数量
|
* 自动报警数量
|
||||||
* device_action = 2
|
* device_action = 2
|
||||||
*/
|
*/
|
||||||
private Integer manualAlarms = 0;
|
private Integer autoAlarms = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电子围栏告警数量
|
* 电子围栏告警数量
|
||||||
|
|||||||
@ -33,4 +33,7 @@ public class DeviceLocationVo {
|
|||||||
@Schema(description = "进入的电子围栏信息")
|
@Schema(description = "进入的电子围栏信息")
|
||||||
private DeviceGeoFence fenceInfo;
|
private DeviceGeoFence fenceInfo;
|
||||||
|
|
||||||
|
@Schema(description = "设备是否正在告警")
|
||||||
|
private Boolean isAlarming;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -774,6 +774,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
|
|
||||||
// 注入电子围栏服务
|
// 注入电子围栏服务
|
||||||
IDeviceGeoFenceService geoFenceService = SpringUtils.getBean(IDeviceGeoFenceService.class);
|
IDeviceGeoFenceService geoFenceService = SpringUtils.getBean(IDeviceGeoFenceService.class);
|
||||||
|
// 注入设备告警Mapper
|
||||||
|
DeviceAlarmMapper deviceAlarmMapper = SpringUtils.getBean(DeviceAlarmMapper.class);
|
||||||
|
|
||||||
for (Device device : devices) {
|
for (Device device : devices) {
|
||||||
DeviceLocationVo vo = new DeviceLocationVo();
|
DeviceLocationVo vo = new DeviceLocationVo();
|
||||||
@ -808,6 +810,23 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
vo.setInFence(false);
|
vo.setInFence(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查设备是否正在告警(只要当前设备处于报警状态,且不是电子围栏告警)
|
||||||
|
if (StringUtils.isNotBlank(device.getDeviceImei())) {
|
||||||
|
DeviceAlarmVo latestAlarm = deviceAlarmMapper.selectLatestByDeviceImei(device.getDeviceImei());
|
||||||
|
// 判断是否正在告警:未处理的告警(treatmentState=1)且不是电子围栏告警(deviceAction!=3)
|
||||||
|
if (latestAlarm != null &&
|
||||||
|
latestAlarm.getTreatmentState() != null &&
|
||||||
|
latestAlarm.getTreatmentState() == 1 &&
|
||||||
|
latestAlarm.getDeviceAction() != null &&
|
||||||
|
latestAlarm.getDeviceAction() != 3) {
|
||||||
|
vo.setIsAlarming(true);
|
||||||
|
} else {
|
||||||
|
vo.setIsAlarming(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vo.setIsAlarming(false);
|
||||||
|
}
|
||||||
|
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@
|
|||||||
(SELECT COUNT(1) FROM device_alarm WHERE treatment_state = 0) AS processedAlarms,
|
(SELECT COUNT(1) FROM device_alarm WHERE treatment_state = 0) AS processedAlarms,
|
||||||
(SELECT COUNT(1) FROM device_alarm WHERE device_action = 0) AS forcedAlarms,
|
(SELECT COUNT(1) FROM device_alarm WHERE device_action = 0) AS forcedAlarms,
|
||||||
(SELECT COUNT(1) FROM device_alarm WHERE device_action = 1) AS intrusionImpactAlarms,
|
(SELECT COUNT(1) FROM device_alarm WHERE device_action = 1) AS intrusionImpactAlarms,
|
||||||
(SELECT COUNT(1) FROM device_alarm WHERE device_action = 2) AS manualAlarms,
|
(SELECT COUNT(1) FROM device_alarm WHERE device_action = 2) AS autoAlarms,
|
||||||
(SELECT COUNT(1) FROM device_alarm WHERE device_action = 3) AS geoFenceAlarms
|
(SELECT COUNT(1) FROM device_alarm WHERE device_action = 3) AS geoFenceAlarms
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -406,7 +406,7 @@
|
|||||||
SELECT COUNT (1)
|
SELECT COUNT (1)
|
||||||
FROM device_alarm
|
FROM device_alarm
|
||||||
WHERE device_action = 2
|
WHERE device_action = 2
|
||||||
) AS alarmManual
|
) AS alarmAuto
|
||||||
, (
|
, (
|
||||||
SELECT COUNT (1)
|
SELECT COUNT (1)
|
||||||
FROM device_alarm
|
FROM device_alarm
|
||||||
|
|||||||
Reference in New Issue
Block a user