|
|
@@ -39,6 +39,7 @@ import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.security.auth.login.LoginContext;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
@@ -386,11 +387,11 @@ public class LocalBusDeviceService extends BaseService<BusDeviceMapper, BusDevic
|
|
|
* @return void
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void shift(List<String> deviceIds, String afterTenantId) {
|
|
|
+ public void shift(List<String> deviceIds, String afterTenantId,String originTenantId) {
|
|
|
List<DeviceOperator> operators = deviceIds.stream()
|
|
|
.map(deviceRegistry::getOperator)
|
|
|
.collect(Collectors.toList());
|
|
|
- if (CollUtil.isEmpty(operators)) {
|
|
|
+ if (CollUtil.isEmpty(operators)||StrUtil.equalsIgnoreCase(originTenantId,afterTenantId)) {
|
|
|
return;
|
|
|
}
|
|
|
this.update(new UpdateWrapper<BusDeviceEntity>().lambda()
|
|
|
@@ -402,7 +403,7 @@ public class LocalBusDeviceService extends BaseService<BusDeviceMapper, BusDevic
|
|
|
.filter(Objects::nonNull)
|
|
|
.forEach(deviceOperator -> {
|
|
|
RMapCache<String, Value> cache = deviceOperator.getCache();
|
|
|
- cache.remove(DeviceKeyConstant.TENANT_ID);
|
|
|
+ cache.clear();
|
|
|
cache.put(DeviceKeyConstant.CLASSIFY,Value.simple(DeviceKeyConstant.DEFAULT_CLASSIFY));
|
|
|
});
|
|
|
}
|