|
...
|
...
|
@@ -143,13 +143,14 @@ public class DeviceService { |
|
|
|
Set<String> keys = cacheServiceImpl.getRedicTerminalFromClientId(clientId);
|
|
|
|
if(null != keys && keys.size() != 0)
|
|
|
|
{
|
|
|
|
terminalOffLine(keys.toArray(new String[keys.size()]));
|
|
|
|
baseDao.updateBySql("update iot_terminal set online=4 where device_id='"+clientId+"'");
|
|
|
|
cacheServiceImpl.deletRedisTerminal(keys.toArray(new String[keys.size()]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void terminalOffLine(String... terminalIds)
|
|
|
|
{
|
|
|
|
baseDao.updateBySql("update iot_terminal set online=0 where id in(?)",Arrays.asList(terminalIds));
|
|
|
|
baseDao.updateBySql("update iot_terminal set online=4 where id in(?)",Arrays.asList(terminalIds));
|
|
|
|
cacheServiceImpl.deletRedisTerminal(terminalIds);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -289,6 +290,8 @@ public class DeviceService { |
|
|
|
cacheServiceImpl.deletRedisDevice(client_id);
|
|
|
|
baseDao.updateBySql("delete from iot_device where client_id='"+client_id+"'");
|
|
|
|
baseDao.updateBySql("delete from iot_terminal where device_id='"+client_id+"'");
|
|
|
|
baseDao.updateBySql("DELETE FROM `user_terminal_group_relation` WHERE iot_terminal_id LIKE '"+client_id+"%'");
|
|
|
|
|
|
|
|
List<LogDeviceOperation> list = new ArrayList<>();
|
|
|
|
list.add(dviceLogService.newLogDeviceOperation(client_id,null,null,"远程操作删除主机","delIotDevice?"));
|
|
|
|
dviceLogService.saveOperationLog(list);
|
|
...
|
...
|
@@ -307,6 +310,8 @@ public class DeviceService { |
|
|
|
closeSession(client_id); //强制下线
|
|
|
|
cacheServiceImpl.deletRedisTerminal(client_id+"_"+number);
|
|
|
|
baseDao.updateBySql("delete from iot_terminal where id='"+client_id+"_"+number+"'");
|
|
|
|
baseDao.updateBySql("DELETE FROM `user_terminal_group_relation` WHERE iot_terminal_id = '"+client_id+"_"+number+"'");
|
|
|
|
|
|
|
|
List<LogDeviceOperation> list = new ArrayList<>();
|
|
|
|
list.add(dviceLogService.newLogDeviceOperation(client_id,null,null,"远程操作删除终端","delIotTerminal?"));
|
|
|
|
dviceLogService.saveOperationLog(list);
|
...
|
...
|
|