设备在线状态
This commit is contained in:
@ -163,6 +163,8 @@ public class Device extends TenantEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线状态(0离线,1在线,2异常)
|
* 在线状态(0离线,1在线,2异常)
|
||||||
|
* online_status
|
||||||
*/
|
*/
|
||||||
private Integer onlineStatus;
|
private Integer onlineStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,7 +117,8 @@ public class DeviceQueryCriteria extends BaseEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备在线状态
|
* 设备在线状态
|
||||||
* 0:离线;1:在线
|
* 0:离线;1:在线;2:故障
|
||||||
|
* online_status
|
||||||
*/
|
*/
|
||||||
private Integer onlineStatus;
|
private Integer onlineStatus;
|
||||||
|
|
||||||
|
|||||||
@ -342,6 +342,9 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
|
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
DeviceAssignments deviceAssignment = deviceAssignmentsMapper.selectById(id);
|
DeviceAssignments deviceAssignment = deviceAssignmentsMapper.selectById(id);
|
||||||
|
if (deviceAssignment == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Device device = deviceMapper.selectById(deviceAssignment.getDeviceId());
|
Device device = deviceMapper.selectById(deviceAssignment.getDeviceId());
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(deviceAssignment.getAssigneeName())) {
|
if (StringUtils.isNotEmpty(deviceAssignment.getAssigneeName())) {
|
||||||
@ -814,11 +817,11 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
if (StringUtils.isNotBlank(device.getDeviceImei())) {
|
if (StringUtils.isNotBlank(device.getDeviceImei())) {
|
||||||
DeviceAlarmVo latestAlarm = deviceAlarmMapper.selectLatestByDeviceImei(device.getDeviceImei());
|
DeviceAlarmVo latestAlarm = deviceAlarmMapper.selectLatestByDeviceImei(device.getDeviceImei());
|
||||||
// 判断是否正在告警:未处理的告警(treatmentState=1)且不是电子围栏告警(deviceAction!=3)
|
// 判断是否正在告警:未处理的告警(treatmentState=1)且不是电子围栏告警(deviceAction!=3)
|
||||||
if (latestAlarm != null &&
|
if (latestAlarm != null &&
|
||||||
latestAlarm.getTreatmentState() != null &&
|
latestAlarm.getTreatmentState() != null &&
|
||||||
latestAlarm.getTreatmentState() == 1 &&
|
latestAlarm.getTreatmentState() == 1 &&
|
||||||
latestAlarm.getDeviceAction() != null &&
|
latestAlarm.getDeviceAction() != null &&
|
||||||
latestAlarm.getDeviceAction() != 3) {
|
latestAlarm.getDeviceAction() != 3) {
|
||||||
vo.setIsAlarming(true);
|
vo.setIsAlarming(true);
|
||||||
} else {
|
} else {
|
||||||
vo.setIsAlarming(false);
|
vo.setIsAlarming(false);
|
||||||
@ -834,5 +837,4 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,6 +71,9 @@
|
|||||||
<if test="criteria.deviceStatus != null">
|
<if test="criteria.deviceStatus != null">
|
||||||
and da.active = #{criteria.deviceStatus}
|
and da.active = #{criteria.deviceStatus}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="criteria.onlineStatus != null">
|
||||||
|
and d.online_status = #{criteria.onlineStatus}
|
||||||
|
</if>
|
||||||
<if test="criteria.groupId != null">
|
<if test="criteria.groupId != null">
|
||||||
and d.group_id = #{criteria.groupId}
|
and d.group_id = #{criteria.groupId}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user