| | |
| | | // lqw.between(zInfoUser.getBirth() != null, ZInfoUser::getBirth, zInfoUser.getBirth(),zInfoUser.getBirth()); |
| | | lqw.eq(zInfoUser.getClanId()!=null, ZInfoUser::getClanId,zInfoUser.getClanId()); |
| | | List<ZInfoUser> allPeopleList = list(lqw); |
| | | System.out.println(allPeopleList); |
| | | System.out.println("============z=============zzzzzzzzzzzzzzzzzzz"); |
| | | |
| | | // List<ZInfoUser> allPeopleList = list(); |
| | | List<ZInfoUser> result = null; |
| | | try { |
| | | result = allPeopleList.stream().filter(people -> people.getUserId() != 1 && ((people.getFatherId()!=null&&people.getFatherId() == 0) || (people.getMomId()!=null&&people.getMomId() == 0))) |
| | | .map(people -> { |
| | | if (depth > 1) { |
| | | if (depth >= 1) { |
| | | people.setIdentity(1); |
| | | people.setChildList(fillChildren2(people, allPeopleList, depth - 1)); |
| | | } |
| | |
| | | throw new RuntimeException("您在加入成员的时候没有指定该成员的父亲或者母亲"); |
| | | } |
| | | |
| | | System.out.println(result); |
| | | |
| | | // result.stream().map( |
| | | // data->{ |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult listGenealogy(Genealogy genealogy, Integer pageNum, Integer pageSize) { |
| | | userList.clear(); |
| | | List<ZInfoUser> treeList = (List<ZInfoUser>) listWithTreeByCondition(100, genealogy).get("data"); |
| | | recursionFindUser(treeList); |
| | | |
| | | // System.out.println(userList); |
| | | System.out.println("---------------"); |
| | | List<Genealogy> allData = userList.stream().map( |
| | | zInfoUser -> { |
| | | Genealogy newGenealogy = new Genealogy(); |
| | |
| | | spouseInfo.setSpouseName(zInfoUser.getNickName()); |
| | | newGenealogy.setSpouseName(spouse.getNickName()); |
| | | } |
| | | System.out.println(newGenealogy); |
| | | return newGenealogy; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | |
| | | System.out.println(allData); |
| | | System.out.println("999999999988888888888++++++++++++++++++++++"); |
| | | List<Genealogy> collect = allData.stream() |
| | | .distinct() |
| | | .filter((data)-> data.getIsMyFamily() == 1) |
| | |
| | | } |
| | | resultData.add(collect.get(i)); |
| | | } |
| | | |
| | | |
| | | System.out.println(resultData); |
| | | System.out.println("999999999988888888888++++++++++++++++++++++"); |
| | | // |
| | | // |
| | | //对result做一个条件筛选 |
| | | Iterator<Genealogy> it = resultData.iterator(); |
| | | while(it.hasNext()){ |
| | |
| | | |
| | | System.out.println(resultData); |
| | | |
| | | System.out.println("================++++++++++++++66666666666666666999999999"); |
| | | |
| | | |
| | | // for (Genealogy data : resultData) { |
| | |
| | | // layer = layer + 1; |
| | | System.out.println(depth); |
| | | List<ZInfoUser> collect = allPeopleList.stream().filter( |
| | | one -> (one.getFatherId() == people.getUserId() || one.getMomId() == people.getUserId()) |
| | | one -> Objects.equals(one.getFatherId(), people.getUserId()) || Objects.equals(one.getMomId(),people.getUserId()) |
| | | ).map( |
| | | one -> { |
| | | if (depth == 1) |
| | |
| | | } |
| | | List<ZInfoUser> zinfo = fillChildren2(one, allPeopleList, depth - 1); |
| | | one.setChildList(zinfo); |
| | | System.out.println(one); |
| | | // System.out.println(one); |
| | | return one; |
| | | } |
| | | |
| | | //return one; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | System.out.println(collect); |
| | | // System.out.println(collect); |
| | | return collect; |
| | | |
| | | } |