Browse Source

物关系视图bug

2024年12月25日10:42:08
qingyuan_dev_new
lishuai 1 year ago
parent
commit
d11ce28f95
  1. 8
      modules/thing/src/main/java/com/thing/thing/relation/root/service/impl/IotThingRelationRootServiceImpl.java

8
modules/thing/src/main/java/com/thing/thing/relation/root/service/impl/IotThingRelationRootServiceImpl.java

@ -123,6 +123,7 @@ public class IotThingRelationRootServiceImpl extends BaseServiceImpl<IotThingRel
String finalOrderField = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, orderField);
Comparator<ObjectNode> comparator = CompareUtils.getComparator(order, finalOrderField); //封装参数
List<Pair<String, String>> pairs = buildParam(name, null,tenantCode);
return rootList.stream()
.filter(jsonObject -> {
boolean passesFilter = JacksonUtil.filter(jsonObject, pairs);
@ -133,7 +134,12 @@ public class IotThingRelationRootServiceImpl extends BaseServiceImpl<IotThingRel
}
return passesFilter;
})
.filter(s-> s.get(CacheNameEnum.RelationRootField.THING_RELATION_ROOT_GROUP_NAME.getField()).asText().equals(groupName))
.filter(s -> {
if(StringUtils.isNotBlank(groupName)){
return s.get(CacheNameEnum.RelationRootField.THING_RELATION_ROOT_GROUP_NAME.getField()).asText().equals(groupName);
}
return true;
} )
.sorted(comparator.thenComparing(obj -> obj.get(CacheNameEnum.RelationRootField.THING_RELATION_ROOT_ID.getField()).asLong())).toList();
}

Loading…
Cancel
Save