控制中心优化
This commit is contained in:
@ -65,13 +65,22 @@ public class RedisKeyExpirationListener implements MessageListener {
|
||||
if (lockInfo != null) {
|
||||
try {
|
||||
String deviceOnlineStatusRedisKey = GlobalConstants.GLOBAL_REDIS_KEY+ DEVICE_KEY_PREFIX+ message + DeviceRedisKeyConstants.DEVICE_ONLINE_STATUS_KEY_PREFIX ;
|
||||
// String deviceOnlineStatusRedis = RedisUtils.getCacheObject(deviceOnlineStatusRedisKey);
|
||||
// if(StringUtils.isBlank(deviceOnlineStatusRedis)){
|
||||
// UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
||||
// deviceUpdateWrapper.eq("device_imei", element);
|
||||
// deviceUpdateWrapper.set("online_status", 0);
|
||||
// deviceMapper.update(deviceUpdateWrapper);
|
||||
// }else{
|
||||
// RedisUtils.deleteObject(deviceOnlineStatusRedisKey);
|
||||
// }
|
||||
|
||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
||||
deviceUpdateWrapper.eq("device_imei", element);
|
||||
deviceUpdateWrapper.set("online_status", 0);
|
||||
deviceMapper.update(deviceUpdateWrapper);
|
||||
String deviceOnlineStatusRedis = RedisUtils.getCacheObject(deviceOnlineStatusRedisKey);
|
||||
if(StringUtils.isBlank(deviceOnlineStatusRedis)){
|
||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
||||
deviceUpdateWrapper.eq("device_imei", element);
|
||||
deviceUpdateWrapper.set("online_status", 0);
|
||||
deviceMapper.update(deviceUpdateWrapper);
|
||||
}else{
|
||||
if(StringUtils.isNotBlank(deviceOnlineStatusRedis)){
|
||||
RedisUtils.deleteObject(deviceOnlineStatusRedisKey);
|
||||
}
|
||||
} finally {
|
||||
|
||||
@ -58,6 +58,13 @@ public class WebDeviceVo implements Serializable {
|
||||
*/
|
||||
private Integer deviceStatus;
|
||||
|
||||
|
||||
/**绑定状态
|
||||
* 0 未绑定
|
||||
* 1 已绑定
|
||||
*/
|
||||
private Integer binding_status;
|
||||
|
||||
/**
|
||||
* 绑定时间
|
||||
*/
|
||||
|
||||
@ -252,12 +252,13 @@
|
||||
dt.pc_model_dictionary detailPageUrl,
|
||||
ap.name personnelBy,
|
||||
d.device_status,
|
||||
d.binding_status,
|
||||
d.online_status,
|
||||
c.binding_time,
|
||||
ROW_NUMBER() OVER (PARTITION BY d.id ORDER BY c.binding_time) AS row_num
|
||||
from device d
|
||||
inner join device_type dt on d.device_type = dt.id
|
||||
inner join app_device_bind_record c on d.id = c.device_id
|
||||
left join app_device_bind_record c on d.id = c.device_id
|
||||
left join app_personnel_info ap on ap.device_id = d.id
|
||||
where dt.communication_mode in (0, 2) ) a where a.row_num = 1
|
||||
<if test="criteria.deviceType != null">
|
||||
|
||||
Reference in New Issue
Block a user