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