add:添加批量删除
parent
6cf1b30503
commit
8bdd46a1c9
|
@ -219,8 +219,8 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceInfo> findByIds(Collection<String> id) {
|
public List<DeviceInfo> findByIds(Collection<String> ids) {
|
||||||
return null;
|
return deviceInfoData.findByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -252,7 +252,17 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(Collection<String> strings) {
|
public void deleteByIds(Collection<String> ids) {
|
||||||
|
List<DeviceInfo> deviceInfos = deviceInfoData.findByIds(ids);
|
||||||
|
deviceInfos.forEach(device -> {
|
||||||
|
deviceInfoCacheEvict.findByDeviceId(device.getDeviceId());
|
||||||
|
deviceInfoCacheEvict.findByProductKeyAndDeviceName(device.getProductKey(), device.getDeviceName());
|
||||||
|
//清除属性缓存
|
||||||
|
clearProperties(device.getDeviceId());
|
||||||
|
//更新子设备列表缓存
|
||||||
|
putSubDeviceIds(device.getParentId());
|
||||||
|
});
|
||||||
|
deviceInfoData.deleteByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -60,8 +60,8 @@ public class DeviceInfoPropertyDataCache implements IDeviceInfoData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(Collection<String> strings) {
|
public void deleteByIds(Collection<String> ids) {
|
||||||
|
deviceInfoData.deleteByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -465,8 +465,8 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceInfo> findByIds(Collection<String> id) {
|
public List<DeviceInfo> findByIds(Collection<String> ids) {
|
||||||
return null;
|
return MapstructUtils.convert(deviceInfoRepository.findAllById(ids),DeviceInfo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -514,8 +514,8 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(Collection<String> strings) {
|
public void deleteByIds(Collection<String> ids) {
|
||||||
|
deviceInfoRepository.deleteAllById(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue