@ -85,9 +85,6 @@ public class DeviceServiceImpl implements IDeviceService {
@Autowired
@Autowired
private ObjectMapper objectMapper ;
private ObjectMapper objectMapper ;
@Autowired
private RedisOpsUtils redisOps ;
@Autowired
@Autowired
private IWebSocketManageService webSocketManageService ;
private IWebSocketManageService webSocketManageService ;
@ -99,7 +96,7 @@ public class DeviceServiceImpl implements IDeviceService {
private ITSAService tsaService ;
private ITSAService tsaService ;
private static final List < String > INIT_TOPICS_SUFFIX = List . of (
private static final List < String > INIT_TOPICS_SUFFIX = List . of (
OSD_SUF , STATE_SUF , SERVICES_SUF + _REPLY_SUF , REQUESTS_SUF , EVENTS_SUF , PROPERTY_SUF + SET_SUF + _REPLY_SUF ) ;
OSD_SUF , STATE_SUF , SERVICES_SUF + _REPLY_SUF , EVENTS_SUF , PROPERTY_SUF + SET_SUF + _REPLY_SUF ) ;
@Override
@Override
public Boolean deviceOffline ( StatusGatewayReceiver gateway ) {
public Boolean deviceOffline ( StatusGatewayReceiver gateway ) {
@ -109,14 +106,14 @@ public class DeviceServiceImpl implements IDeviceService {
// Only the remote controller is logged in and the aircraft is not connected.
// Only the remote controller is logged in and the aircraft is not connected.
String key = RedisConst . DEVICE_ONLINE_PREFIX + gatewaySn ;
String key = RedisConst . DEVICE_ONLINE_PREFIX + gatewaySn ;
boolean exist = redisOp s. checkExist ( key ) ;
boolean exist = RedisOpsUtil s. checkExist ( key ) ;
if ( ! exist ) {
if ( ! exist ) {
Optional < DeviceDTO > gatewayOpt = this . getDeviceBySn ( gatewaySn ) ;
Optional < DeviceDTO > gatewayOpt = this . getDeviceBySn ( gatewaySn ) ;
if ( gatewayOpt . isPresent ( ) ) {
if ( gatewayOpt . isPresent ( ) ) {
DeviceDTO value = gatewayOpt . get ( ) ;
DeviceDTO value = gatewayOpt . get ( ) ;
value . setBoundTime ( null ) ;
value . setBoundTime ( null ) ;
value . setLoginTime ( null ) ;
value . setLoginTime ( null ) ;
redisOp s. setWithExpire ( key , value , RedisConst . DEVICE_ALIVE_SECOND ) ;
RedisOpsUtil s. setWithExpire ( key , value , RedisConst . DEVICE_ALIVE_SECOND ) ;
this . pushDeviceOnlineTopo ( value . getWorkspaceId ( ) , gatewaySn , gatewaySn ) ;
this . pushDeviceOnlineTopo ( value . getWorkspaceId ( ) , gatewaySn , gatewaySn ) ;
return true ;
return true ;
}
}
@ -126,7 +123,7 @@ public class DeviceServiceImpl implements IDeviceService {
return firstSaveDevice ( gatewayDevice , null ) ;
return firstSaveDevice ( gatewayDevice , null ) ;
}
}
DeviceDTO deviceDTO = ( DeviceDTO ) ( redisOp s. get ( key ) ) ;
DeviceDTO deviceDTO = ( DeviceDTO ) ( RedisOpsUtil s. get ( key ) ) ;
String deviceSn = deviceDTO . getChildDeviceSn ( ) ;
String deviceSn = deviceDTO . getChildDeviceSn ( ) ;
if ( ! StringUtils . hasText ( deviceSn ) ) {
if ( ! StringUtils . hasText ( deviceSn ) ) {
return true ;
return true ;
@ -140,11 +137,11 @@ public class DeviceServiceImpl implements IDeviceService {
// If no information about this device exists in the cache, the drone is considered to be offline.
// If no information about this device exists in the cache, the drone is considered to be offline.
String key = RedisConst . DEVICE_ONLINE_PREFIX + deviceSn ;
String key = RedisConst . DEVICE_ONLINE_PREFIX + deviceSn ;
if ( ! redisOp s. checkExist ( key ) | | redisOp s. getExpire ( key ) < = 0 ) {
if ( ! RedisOpsUtil s. checkExist ( key ) | | RedisOpsUtil s. getExpire ( key ) < = 0 ) {
log . debug ( "The drone is already offline." ) ;
log . debug ( "The drone is already offline." ) ;
return true ;
return true ;
}
}
DeviceDTO device = ( DeviceDTO ) redisOp s. get ( key ) ;
DeviceDTO device = ( DeviceDTO ) RedisOpsUtil s. get ( key ) ;
// Cancel drone-related subscriptions.
// Cancel drone-related subscriptions.
this . unsubscribeTopicOffline ( deviceSn ) ;
this . unsubscribeTopicOffline ( deviceSn ) ;
@ -152,8 +149,8 @@ public class DeviceServiceImpl implements IDeviceService {
// Publish the latest device topology information in the current workspace.
// Publish the latest device topology information in the current workspace.
this . pushDeviceOfflineTopo ( device . getWorkspaceId ( ) , deviceSn ) ;
this . pushDeviceOfflineTopo ( device . getWorkspaceId ( ) , deviceSn ) ;
redisOp s. del ( key ) ;
RedisOpsUtil s. del ( key ) ;
redisOp s. del ( RedisConst . OSD_PREFIX + device . getDeviceSn ( ) ) ;
RedisOpsUtil s. del ( RedisConst . OSD_PREFIX + device . getDeviceSn ( ) ) ;
log . debug ( "{} offline." , deviceSn ) ;
log . debug ( "{} offline." , deviceSn ) ;
return true ;
return true ;
}
}
@ -163,11 +160,11 @@ public class DeviceServiceImpl implements IDeviceService {
String deviceSn = deviceGateway . getSubDevices ( ) . get ( 0 ) . getSn ( ) ;
String deviceSn = deviceGateway . getSubDevices ( ) . get ( 0 ) . getSn ( ) ;
String key = RedisConst . DEVICE_ONLINE_PREFIX + deviceSn ;
String key = RedisConst . DEVICE_ONLINE_PREFIX + deviceSn ;
// change log: Use redis instead of
// change log: Use redis instead of
long time = redisOp s. getExpire ( key ) ;
long time = RedisOpsUtil s. getExpire ( key ) ;
long gatewayTime = redisOp s. getExpire ( RedisConst . DEVICE_ONLINE_PREFIX + deviceGateway . getSn ( ) ) ;
long gatewayTime = RedisOpsUtil s. getExpire ( RedisConst . DEVICE_ONLINE_PREFIX + deviceGateway . getSn ( ) ) ;
if ( time > 0 & & gatewayTime > 0 ) {
if ( time > 0 & & gatewayTime > 0 ) {
redisOp s. expireKey ( key , RedisConst . DEVICE_ALIVE_SECOND ) ;
RedisOpsUtil s. expireKey ( key , RedisConst . DEVICE_ALIVE_SECOND ) ;
DeviceDTO device = DeviceDTO . builder ( ) . loginTime ( LocalDateTime . now ( ) ) . deviceSn ( deviceSn ) . build ( ) ;
DeviceDTO device = DeviceDTO . builder ( ) . loginTime ( LocalDateTime . now ( ) ) . deviceSn ( deviceSn ) . build ( ) ;
DeviceDTO gateway = DeviceDTO . builder ( )
DeviceDTO gateway = DeviceDTO . builder ( )
. loginTime ( LocalDateTime . now ( ) )
. loginTime ( LocalDateTime . now ( ) )
@ -175,7 +172,7 @@ public class DeviceServiceImpl implements IDeviceService {
. childDeviceSn ( deviceSn ) . build ( ) ;
. childDeviceSn ( deviceSn ) . build ( ) ;
this . updateDevice ( gateway ) ;
this . updateDevice ( gateway ) ;
this . updateDevice ( device ) ;
this . updateDevice ( device ) ;
String workspaceId = ( ( DeviceDTO ) ( redisOp s. get ( key ) ) ) . getWorkspaceId ( ) ;
String workspaceId = ( ( DeviceDTO ) ( RedisOpsUtil s. get ( key ) ) ) . getWorkspaceId ( ) ;
if ( StringUtils . hasText ( workspaceId ) ) {
if ( StringUtils . hasText ( workspaceId ) ) {
this . subscribeTopicOnline ( deviceSn ) ;
this . subscribeTopicOnline ( deviceSn ) ;
this . subscribeTopicOnline ( deviceGateway . getSn ( ) ) ;
this . subscribeTopicOnline ( deviceGateway . getSn ( ) ) ;
@ -314,7 +311,7 @@ public class DeviceServiceImpl implements IDeviceService {
devicesList . forEach ( device - > {
devicesList . forEach ( device - > {
this . spliceDeviceTopo ( device ) ;
this . spliceDeviceTopo ( device ) ;
device . setWorkspaceId ( workspaceId ) ;
device . setWorkspaceId ( workspaceId ) ;
device . setStatus ( redisOp s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ) ) ;
device . setStatus ( RedisOpsUtil s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ) ) ;
} ) ;
} ) ;
return devicesList ;
return devicesList ;
}
}
@ -368,7 +365,7 @@ public class DeviceServiceImpl implements IDeviceService {
this . getDeviceTopoForPilot ( sn )
this . getDeviceTopoForPilot ( sn )
. ifPresent ( pilotMessage : : setData ) ;
. ifPresent ( pilotMessage : : setData ) ;
boolean exist = redisOp s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + sn ) ;
boolean exist = RedisOpsUtil s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + sn ) ;
pilotMessage . getData ( ) . setOnlineStatus ( exist ) ;
pilotMessage . getData ( ) . setOnlineStatus ( exist ) ;
pilotMessage . getData ( ) . setGatewaySn ( gatewaySn . equals ( sn ) ? "" : gatewaySn ) ;
pilotMessage . getData ( ) . setGatewaySn ( gatewaySn . equals ( sn ) ? "" : gatewaySn ) ;
@ -393,7 +390,7 @@ public class DeviceServiceImpl implements IDeviceService {
. key ( domain + "-" + type + "-" + subType )
. key ( domain + "-" + type + "-" + subType )
. build ( ) )
. build ( ) )
. iconUrls ( device . getIconUrl ( ) )
. iconUrls ( device . getIconUrl ( ) )
. onlineStatus ( redisOp s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ) )
. onlineStatus ( RedisOpsUtil s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ) )
. boundStatus ( device . getBoundStatus ( ) )
. boundStatus ( device . getBoundStatus ( ) )
. model ( device . getDeviceName ( ) )
. model ( device . getDeviceName ( ) )
. userId ( device . getUserId ( ) )
. userId ( device . getUserId ( ) )
@ -438,9 +435,9 @@ public class DeviceServiceImpl implements IDeviceService {
topic . indexOf ( OSD_SUF ) ) ;
topic . indexOf ( OSD_SUF ) ) ;
// Real-time update of device status in memory
// Real-time update of device status in memory
redisOp s. expireKey ( RedisConst . DEVICE_ONLINE_PREFIX + from , RedisConst . DEVICE_ALIVE_SECOND ) ;
RedisOpsUtil s. expireKey ( RedisConst . DEVICE_ONLINE_PREFIX + from , RedisConst . DEVICE_ALIVE_SECOND ) ;
DeviceDTO device = ( DeviceDTO ) redisOp s. get ( RedisConst . DEVICE_ONLINE_PREFIX + from ) ;
DeviceDTO device = ( DeviceDTO ) RedisOpsUtil s. get ( RedisConst . DEVICE_ONLINE_PREFIX + from ) ;
if ( device = = null ) {
if ( device = = null ) {
Optional < DeviceDTO > deviceOpt = this . getDeviceBySn ( from ) ;
Optional < DeviceDTO > deviceOpt = this . getDeviceBySn ( from ) ;
@ -449,9 +446,10 @@ public class DeviceServiceImpl implements IDeviceService {
}
}
device = deviceOpt . get ( ) ;
device = deviceOpt . get ( ) ;
if ( ! StringUtils . hasText ( device . getWorkspaceId ( ) ) ) {
if ( ! StringUtils . hasText ( device . getWorkspaceId ( ) ) ) {
this . unsubscribeTopicOffline ( from ) ;
return ;
return ;
}
}
redisOp s. setWithExpire ( RedisConst . DEVICE_ONLINE_PREFIX + from , device ,
RedisOpsUtil s. setWithExpire ( RedisConst . DEVICE_ONLINE_PREFIX + from , device ,
RedisConst . DEVICE_ALIVE_SECOND ) ;
RedisConst . DEVICE_ALIVE_SECOND ) ;
this . subscribeTopicOnline ( from ) ;
this . subscribeTopicOnline ( from ) ;
}
}
@ -629,7 +627,7 @@ public class DeviceServiceImpl implements IDeviceService {
return deviceDTOBuilder . firmwareStatus ( DeviceFirmwareStatusEnum . NOT_UPGRADE . getVal ( ) ) . build ( ) ;
return deviceDTOBuilder . firmwareStatus ( DeviceFirmwareStatusEnum . NOT_UPGRADE . getVal ( ) ) . build ( ) ;
}
}
// Query whether the device is updating firmware.
// Query whether the device is updating firmware.
Object progress = redisOp s. get ( RedisConst . FIRMWARE_UPGRADING_PREFIX + entity . getDeviceSn ( ) ) ;
Object progress = RedisOpsUtil s. get ( RedisConst . FIRMWARE_UPGRADING_PREFIX + entity . getDeviceSn ( ) ) ;
if ( Objects . nonNull ( progress ) ) {
if ( Objects . nonNull ( progress ) ) {
return deviceDTOBuilder . firmwareStatus ( DeviceFirmwareStatusEnum . UPGRADING . getVal ( ) ) . firmwareProgress ( ( int ) progress ) . build ( ) ;
return deviceDTOBuilder . firmwareStatus ( DeviceFirmwareStatusEnum . UPGRADING . getVal ( ) ) . firmwareProgress ( ( int ) progress ) . build ( ) ;
}
}
@ -668,12 +666,12 @@ public class DeviceServiceImpl implements IDeviceService {
}
}
String key = RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ;
String key = RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ;
DeviceDTO redisDevice = ( DeviceDTO ) redisOp s. get ( key ) ;
DeviceDTO redisDevice = ( DeviceDTO ) RedisOpsUtil s. get ( key ) ;
if ( Objects . isNull ( redisDevice ) ) {
if ( Objects . isNull ( redisDevice ) ) {
return false ;
return false ;
}
}
redisDevice . setWorkspaceId ( device . getWorkspaceId ( ) ) ;
redisDevice . setWorkspaceId ( device . getWorkspaceId ( ) ) ;
redisOp s. setWithExpire ( key , redisDevice , RedisConst . DEVICE_ALIVE_SECOND ) ;
RedisOpsUtil s. setWithExpire ( key , redisDevice , RedisConst . DEVICE_ALIVE_SECOND ) ;
if ( DeviceDomainEnum . GATEWAY . getDesc ( ) . equals ( redisDevice . getDomain ( ) ) ) {
if ( DeviceDomainEnum . GATEWAY . getDesc ( ) . equals ( redisDevice . getDomain ( ) ) ) {
this . pushDeviceOnlineTopo ( webSocketManageService . getValueWithWorkspace ( device . getWorkspaceId ( ) ) ,
this . pushDeviceOnlineTopo ( webSocketManageService . getValueWithWorkspace ( device . getWorkspaceId ( ) ) ,
@ -785,12 +783,12 @@ public class DeviceServiceImpl implements IDeviceService {
. eq ( DeviceEntity : : getBoundStatus , true ) ) ;
. eq ( DeviceEntity : : getBoundStatus , true ) ) ;
List < DeviceDTO > devicesList = pagination . getRecords ( ) . stream ( ) . map ( this : : deviceEntityConvertToDTO )
List < DeviceDTO > devicesList = pagination . getRecords ( ) . stream ( ) . map ( this : : deviceEntityConvertToDTO )
. peek ( device - > {
. peek ( device - > {
device . setStatus ( redisOp s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ) ) ;
device . setStatus ( RedisOpsUtil s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ) ) ;
if ( StringUtils . hasText ( device . getChildDeviceSn ( ) ) ) {
if ( StringUtils . hasText ( device . getChildDeviceSn ( ) ) ) {
Optional < DeviceDTO > childOpt = this . getDeviceBySn ( device . getChildDeviceSn ( ) ) ;
Optional < DeviceDTO > childOpt = this . getDeviceBySn ( device . getChildDeviceSn ( ) ) ;
childOpt . ifPresent ( child - > {
childOpt . ifPresent ( child - > {
child . setStatus (
child . setStatus (
redisOp s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + child . getDeviceSn ( ) ) ) ;
RedisOpsUtil s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + child . getDeviceSn ( ) ) ) ;
child . setWorkspaceName ( device . getWorkspaceName ( ) ) ;
child . setWorkspaceName ( device . getWorkspaceName ( ) ) ;
device . setChildren ( child ) ;
device . setChildren ( child ) ;
} ) ;
} ) ;
@ -803,9 +801,9 @@ public class DeviceServiceImpl implements IDeviceService {
@Override
@Override
public void unbindDevice ( String deviceSn ) {
public void unbindDevice ( String deviceSn ) {
String key = RedisConst . DEVICE_ONLINE_PREFIX + deviceSn ;
String key = RedisConst . DEVICE_ONLINE_PREFIX + deviceSn ;
DeviceDTO redisDevice = ( DeviceDTO ) redisOp s. get ( key ) ;
DeviceDTO redisDevice = ( DeviceDTO ) RedisOpsUtil s. get ( key ) ;
redisDevice . setWorkspaceId ( "" ) ;
redisDevice . setWorkspaceId ( "" ) ;
redisOp s. setWithExpire ( key , redisDevice , RedisConst . DEVICE_ALIVE_SECOND ) ;
RedisOpsUtil s. setWithExpire ( key , redisDevice , RedisConst . DEVICE_ALIVE_SECOND ) ;
DeviceDTO device = DeviceDTO . builder ( )
DeviceDTO device = DeviceDTO . builder ( )
. deviceSn ( deviceSn )
. deviceSn ( deviceSn )
@ -823,7 +821,7 @@ public class DeviceServiceImpl implements IDeviceService {
return Optional . empty ( ) ;
return Optional . empty ( ) ;
}
}
DeviceDTO device = devicesList . get ( 0 ) ;
DeviceDTO device = devicesList . get ( 0 ) ;
device . setStatus ( redisOp s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + sn ) ) ;
device . setStatus ( RedisOpsUtil s. checkExist ( RedisConst . DEVICE_ONLINE_PREFIX + sn ) ) ;
return Optional . of ( device ) ;
return Optional . of ( device ) ;
}
}
@ -877,7 +875,7 @@ public class DeviceServiceImpl implements IDeviceService {
}
}
// Record the device state that needs to be updated.
// Record the device state that needs to be updated.
deviceOtaFirmwares . forEach ( deviceOta - > redisOp s. setWithExpire (
deviceOtaFirmwares . forEach ( deviceOta - > RedisOpsUtil s. setWithExpire (
RedisConst . FIRMWARE_UPGRADING_PREFIX + deviceOta . getSn ( ) ,
RedisConst . FIRMWARE_UPGRADING_PREFIX + deviceOta . getSn ( ) ,
bid ,
bid ,
RedisConst . DEVICE_ALIVE_SECOND * RedisConst . DEVICE_ALIVE_SECOND ) ) ;
RedisConst . DEVICE_ALIVE_SECOND * RedisConst . DEVICE_ALIVE_SECOND ) ) ;
@ -890,7 +888,7 @@ public class DeviceServiceImpl implements IDeviceService {
if ( ! dockOnline ) {
if ( ! dockOnline ) {
throw new RuntimeException ( "Dock is offline." ) ;
throw new RuntimeException ( "Dock is offline." ) ;
}
}
DeviceDTO deviceDTO = ( DeviceDTO ) redisOp s. get ( RedisConst . DEVICE_ONLINE_PREFIX + dockSn ) ;
DeviceDTO deviceDTO = ( DeviceDTO ) RedisOpsUtil s. get ( RedisConst . DEVICE_ONLINE_PREFIX + dockSn ) ;
boolean deviceOnline = this . checkDeviceOnline ( deviceDTO . getChildDeviceSn ( ) ) ;
boolean deviceOnline = this . checkDeviceOnline ( deviceDTO . getChildDeviceSn ( ) ) ;
if ( ! deviceOnline ) {
if ( ! deviceOnline ) {
throw new RuntimeException ( "Device is offline." ) ;
throw new RuntimeException ( "Device is offline." ) ;
@ -904,7 +902,7 @@ public class DeviceServiceImpl implements IDeviceService {
}
}
String topic = THING_MODEL_PRE + PRODUCT + dockSn + PROPERTY_SUF + SET_SUF ;
String topic = THING_MODEL_PRE + PRODUCT + dockSn + PROPERTY_SUF + SET_SUF ;
OsdSubDeviceReceiver osd = ( OsdSubDeviceReceiver ) redisOps . get ( RedisConst . OSD_PREFIX + deviceDTO . getChildDeviceSn ( ) ) ;
// OsdSubDeviceReceiver osd = (OsdSubDeviceReceiver) RedisOpsUtils.get(RedisConst.OSD_PREFIX + deviceDTO.getChildDeviceSn());
if ( ! param . isObject ( ) ) {
if ( ! param . isObject ( ) ) {
this . deviceOnePropertySet ( topic , propertyEnum , Map . entry ( propertyEnum . getProperty ( ) , param ) ) ;
this . deviceOnePropertySet ( topic , propertyEnum , Map . entry ( propertyEnum . getProperty ( ) , param ) ) ;
return ;
return ;
@ -912,7 +910,7 @@ public class DeviceServiceImpl implements IDeviceService {
// If there are multiple parameters, set them separately.
// If there are multiple parameters, set them separately.
for ( Iterator < Map . Entry < String , JsonNode > > filed = param . fields ( ) ; filed . hasNext ( ) ; ) {
for ( Iterator < Map . Entry < String , JsonNode > > filed = param . fields ( ) ; filed . hasNext ( ) ; ) {
Map . Entry < String , JsonNode > node = filed . next ( ) ;
Map . Entry < String , JsonNode > node = filed . next ( ) ;
boolean isPublish = basicDeviceProperty . canPublish ( node . getKey ( ) , osd ) ;
boolean isPublish = basicDeviceProperty . canPublish ( node . getKey ( ) , null ) ;
if ( ! isPublish ) {
if ( ! isPublish ) {
continue ;
continue ;
}
}
@ -954,7 +952,7 @@ public class DeviceServiceImpl implements IDeviceService {
public Boolean checkDeviceOnline ( String sn ) {
public Boolean checkDeviceOnline ( String sn ) {
String key = RedisConst . DEVICE_ONLINE_PREFIX + sn ;
String key = RedisConst . DEVICE_ONLINE_PREFIX + sn ;
return redisOp s. checkExist ( key ) & & redisOp s. getExpire ( key ) > 0 ;
return RedisOpsUtil s. checkExist ( key ) & & RedisOpsUtil s. getExpire ( key ) > 0 ;
}
}
/ * *
/ * *
@ -1052,6 +1050,8 @@ public class DeviceServiceImpl implements IDeviceService {
// Set the icon of the gateway device displayed in the pilot's map when it is selected, required in the TSA module.
// Set the icon of the gateway device displayed in the pilot's map when it is selected, required in the TSA module.
device . setUrlSelect ( IconUrlEnum . SELECT_PERSON . getUrl ( ) ) ;
device . setUrlSelect ( IconUrlEnum . SELECT_PERSON . getUrl ( ) ) ;
}
}
deviceOpt . ifPresent ( oldDevice - > device . setNickname ( oldDevice . getNickname ( ) ) ) ;
device . setChildSn ( deviceSn ) ;
device . setChildSn ( deviceSn ) ;
device . setLoginTime ( System . currentTimeMillis ( ) ) ;
device . setLoginTime ( System . currentTimeMillis ( ) ) ;
@ -1061,7 +1061,7 @@ public class DeviceServiceImpl implements IDeviceService {
}
}
device . setWorkspaceId ( saveDeviceOpt . get ( ) . getWorkspaceId ( ) ) ;
device . setWorkspaceId ( saveDeviceOpt . get ( ) . getWorkspaceId ( ) ) ;
redisOp s. setWithExpire ( RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ,
RedisOpsUtil s. setWithExpire ( RedisConst . DEVICE_ONLINE_PREFIX + device . getDeviceSn ( ) ,
DeviceDTO . builder ( )
DeviceDTO . builder ( )
. deviceSn ( device . getDeviceSn ( ) )
. deviceSn ( device . getDeviceSn ( ) )
. workspaceId ( device . getWorkspaceId ( ) )
. workspaceId ( device . getWorkspaceId ( ) )