Commit fdf1307cf8fcfae51bb6425a78f1f79a832ec527
Merge branch 'cherry-pick-3c4903c6' into 'master'
fix: 修复场景联动执行动作设备输出选择全部bug See merge request yunteng/thingskit!325
Showing
3 changed files
with
7 additions
and
7 deletions
... | ... | @@ -748,14 +748,15 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
748 | 748 | return allDevices; |
749 | 749 | } |
750 | 750 | @Cacheable( |
751 | - cacheNames = cacheName, key = "{#tenantId, #tbDeviceProfileId}") | |
751 | + cacheNames = cacheName, key = "{#tenantId, #deviceProfileId}") | |
752 | 752 | @Override |
753 | - public Map<String, List<String>> getDeviceIdsByDeviceProfileId(String tenantId, String tbDeviceProfileId) { | |
753 | + public Map<String, List<String>> getDeviceIdsByDeviceProfileId(String tenantId, String deviceProfileId) { | |
754 | 754 | Map<String, List<String>> result; |
755 | 755 | List<TkDeviceEntity> organizationDevices = |
756 | 756 | baseMapper.selectList( |
757 | 757 | new LambdaQueryWrapper<TkDeviceEntity>().eq(TkDeviceEntity::getTenantId,tenantId) |
758 | - .eq(TkDeviceEntity::getProfileId, tbDeviceProfileId)); | |
758 | + .eq(TkDeviceEntity::getProfileId, deviceProfileId) | |
759 | + .or().eq(TkDeviceEntity::getDeviceProfileId,deviceProfileId)); | |
759 | 760 | if(null !=organizationDevices && !organizationDevices.isEmpty()){ |
760 | 761 | result = new HashMap<>(); |
761 | 762 | organizationDevices.stream().forEach(entity->{ | ... | ... |
... | ... | @@ -219,10 +219,10 @@ public interface TkDeviceService extends BaseService<TkDeviceEntity> { |
219 | 219 | /** |
220 | 220 | * 根据tbDeviceProfileId查询所有的组织与设备关系 |
221 | 221 | * @param tenantId 租户ID |
222 | - * @param tbDeviceProfileId 设备配置ID | |
222 | + * @param deviceProfileId 或 tk_device_profile id 设备配置ID | |
223 | 223 | * @return 组织ID作为key,设备ID列表作为value |
224 | 224 | */ |
225 | - Map<String, List<String>> getDeviceIdsByDeviceProfileId(String tenantId, String tbDeviceProfileId); | |
225 | + Map<String, List<String>> getDeviceIdsByDeviceProfileId(String tenantId, String deviceProfileId); | |
226 | 226 | |
227 | 227 | ListenableFuture<List<DeviceDTO>> findDeviceListByDeviceProfileId(String deviceProfileId,String tenantId,String organizationId); |
228 | 228 | ... | ... |
... | ... | @@ -434,8 +434,7 @@ class ReactState { |
434 | 434 | if (ScopeEnum.ALL.equals(action.getEntityType())) { |
435 | 435 | rpcDevices = |
436 | 436 | tkDeviceService.getDevicesByOrganizationIdAndProjectId(action.getTenantId(), orgId, |
437 | - tkDeviceService.getDeviceIdsByDeviceProfileId(action.getTenantId(), | |
438 | - msg.getMetaData().getValue("deviceProfileId"))); | |
437 | + tkDeviceService.getDeviceIdsByDeviceProfileId(action.getTenantId(),action.getDeviceProfileId())); | |
439 | 438 | } |
440 | 439 | rpcMsg(ctx, msg, rpcDevices, action.getDoContext(), action.getCallType()); |
441 | 440 | break; | ... | ... |