whywhyo
2023-08-14 0dc7b41e2530e7ea13066d2f17dc8bb24e4bd2dd
zhang-content/src/main/java/com/ruoyi/service/impl/ZInfoUserServiceImpl.java
@@ -30,6 +30,7 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
 * <p>
@@ -295,6 +296,10 @@
//        } catch (NullPointerException e) {
//            throw new RuntimeException("您在加入成员的时候没有指定该成员的父亲或者母亲");
//        }
        List<ZInfoUser> myFamilyPeopleList = allPeopleList.stream().filter(people -> people.getUserId() != 1 && people.getIsMyFamily() == 1).collect(Collectors.toList());
        result = allPeopleList.stream().filter(people -> people.getUserId() != 1 && (people.getFatherId() == 0 || people.getMomId() == 0) && people.getIsMyFamily() == 1)
                .map(people -> {
                    if (depth > 1) {
@@ -304,7 +309,7 @@
                        ZInfoUser spouse = zInfoUserService.getById(spouseId);
                        spouse.setIdentity(1);
                        people.setSpouse(spouse);
                        people.setChildList(fillChildren(people, allPeopleList, depth - 1));
                        people.setChildList(fillChildren(people, myFamilyPeopleList, depth - 1));
                    }
                    return people;
                }).collect(Collectors.toList());
@@ -657,6 +662,11 @@
        // layer = layer + 1;
        System.out.println(depth);
//        List<ZInfoUser> myFamilyPeopleList = allPeopleList.stream().filter(
//                one -> (one.getFatherId() == people.getUserId() || one.getMomId() == people.getUserId()) && (people.getIsMyFamily() == 1)
//        ).collect(Collectors.toList());
        List<ZInfoUser> collect = allPeopleList.stream().filter(
                one -> (one.getFatherId() == people.getUserId() || one.getMomId() == people.getUserId()) && (people.getIsMyFamily() == 1)
        ).map(