Commit a56d897a96e1f135187b5df874edce532f482e9a

Authored by 芯火源
Committed by xp.Huang
1 parent e0ca7911

fix: 产品模块,传输协议那里可用脚本需要返回系统自带的脚本

脚本列表返回系统自带的脚本


(cherry picked from commit dc670374)
... ... @@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
9 9 import org.springframework.stereotype.Service;
10 10 import org.springframework.transaction.annotation.Transactional;
11 11 import org.thingsboard.server.common.data.device.profile.TkTcpDeviceProfileTransportConfiguration;
  12 +import org.thingsboard.server.common.data.id.EntityId;
12 13 import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants;
13 14 import org.thingsboard.server.common.data.yunteng.constant.ModelConstants;
14 15 import org.thingsboard.server.common.data.yunteng.constant.QueryConstant;
... ... @@ -249,8 +250,8 @@ public class TkDeviceScriptServiceImpl
249 250 LambdaQueryWrapper<TkDeviceScriptEntity> queryWrapper =
250 251 new QueryWrapper<TkDeviceScriptEntity>()
251 252 .lambda()
252   - .eq(TkDeviceScriptEntity::getTenantId, tenantId)
253   - .eq(scriptType!=null,TkDeviceScriptEntity::getScriptType, scriptType);
  253 + .eq(scriptType!=null,TkDeviceScriptEntity::getScriptType, scriptType).and(s->s
  254 + .eq(TkDeviceScriptEntity::getTenantId, tenantId).or(r->r.eq(TkDeviceScriptEntity::getTenantId, EntityId.NULL_UUID.toString())));
254 255 return baseMapper.selectList(queryWrapper).stream()
255 256 .map(item -> item.getDTO(TkDeviceScriptDTO.class))
256 257 .collect(Collectors.toList());
... ...