Browse Source

#70 修复根节点为空时 查询错误问题

zhou-hao 7 năm trước cách đây
mục cha
commit
6f12e1a1bc

+ 5 - 1
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-service/hsweb-system-organizational-service-simple/src/main/java/org/hswebframework/web/service/organizational/simple/SimplePersonService.java

@@ -404,9 +404,13 @@ public class SimplePersonService extends GenericEntityService<PersonEntity, Stri
                                                                                             Set<String> rootIds,
                                                                                             BiConsumer<T, List<T>> childAccepter,
                                                                                             Consumer<List<T>> rootConsumer) {
+        if (rootIds.isEmpty()) {
+            return Collections.emptyList();
+        }
         //获取根节点
         List<T> root = DefaultDSLQueryService.createQuery(dao)
-                .where().in(TreeSupportEntity.id, rootIds)
+                .where()
+                .in(TreeSupportEntity.id, rootIds)
                 .listNoPaging();
         //节点不存在?
         if (!root.isEmpty()) {