forked from dyf/fys-Multi-tenant
设备在线状态
This commit is contained in:
@ -163,6 +163,8 @@ public class Device extends TenantEntity {
|
||||
|
||||
/**
|
||||
* 在线状态(0离线,1在线,2异常)
|
||||
* online_status
|
||||
*/
|
||||
private Integer onlineStatus;
|
||||
|
||||
}
|
||||
|
||||
@ -117,7 +117,8 @@ public class DeviceQueryCriteria extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 设备在线状态
|
||||
* 0:离线;1:在线
|
||||
* 0:离线;1:在线;2:故障
|
||||
* online_status
|
||||
*/
|
||||
private Integer onlineStatus;
|
||||
|
||||
|
||||
@ -342,6 +342,9 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
|
||||
for (Long id : ids) {
|
||||
DeviceAssignments deviceAssignment = deviceAssignmentsMapper.selectById(id);
|
||||
if (deviceAssignment == null) {
|
||||
continue;
|
||||
}
|
||||
Device device = deviceMapper.selectById(deviceAssignment.getDeviceId());
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceAssignment.getAssigneeName())) {
|
||||
@ -814,11 +817,11 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
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) {
|
||||
if (latestAlarm != null &&
|
||||
latestAlarm.getTreatmentState() != null &&
|
||||
latestAlarm.getTreatmentState() == 1 &&
|
||||
latestAlarm.getDeviceAction() != null &&
|
||||
latestAlarm.getDeviceAction() != 3) {
|
||||
vo.setIsAlarming(true);
|
||||
} else {
|
||||
vo.setIsAlarming(false);
|
||||
@ -834,5 +837,4 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -71,6 +71,9 @@
|
||||
<if test="criteria.deviceStatus != null">
|
||||
and da.active = #{criteria.deviceStatus}
|
||||
</if>
|
||||
<if test="criteria.onlineStatus != null">
|
||||
and d.online_status = #{criteria.onlineStatus}
|
||||
</if>
|
||||
<if test="criteria.groupId != null">
|
||||
and d.group_id = #{criteria.groupId}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user