| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.uuid.UUID; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.domain.dto.*; |
| | | import com.ruoyi.mapper.ZInfoUserMapper; |
| | |
| | | private ZfClanService zfClanService; |
| | | |
| | | |
| | | |
| | | /** 使相同用户名+电话号码相同的用户对应的uaid同步*/ |
| | | @Override |
| | | public void setUaidSame(String phone, String username,String uniqueId){ |
| | | UpdateWrapper<ZInfoUser> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq(phone!=null,"phone_number", phone) |
| | | .eq(username!=null,"old_name",username) |
| | | .set("uaid",uniqueId ); |
| | | this.update(null, wrapper); // 执行更新 |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void setSpouseOnly(Long spouse){ |
| | | UpdateWrapper<ZInfoUser> wrapper = new UpdateWrapper<>(); |
| | | System.out.println("{{{{{{{{{{{{{"+spouse); |
| | | wrapper.eq("spouse_id", spouse) // 使用字符串字段名 |
| | | .set("spouse_id", null); // 直接设置字段值 |
| | | this.update(null, wrapper); // 执行更新 |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult selectInfoList(ZInfoUser zInfoUser, Integer pageNum, Integer pageSize) { |
| | | |
| | |
| | | if(infu.getMomId()!=null && uid.equals(infu.getMomId())) |
| | | return true; |
| | | return findByuid(uid, infu.getFatherId()) || findByuid(uid, infu.getMomId()); |
| | | } |
| | | |
| | | @Override |
| | | public List<ZInfoUser> findByUaidToFaid(String usid) { |
| | | if(usid!=null) { |
| | | ZInfoUser zInfoUser = new ZInfoUser(); |
| | | zInfoUser.setUaid(usid); |
| | | LambdaQueryWrapper<ZInfoUser> lqw = buildCondition(zInfoUser); |
| | | List<ZInfoUser> ls = list(lqw); |
| | | // System.out.println(ls.size()+":==========sdfs55dfsdf"); |
| | | return ls; |
| | | }else { |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | lqw.like(zInfoUser.getMaritalStatus() != null, ZInfoUser::getMaritalStatus, zInfoUser.getMaritalStatus()); |
| | | lqw.le(zInfoUser.getBirth() != null, ZInfoUser::getBirth, zInfoUser.getBirth()); |
| | | lqw.like(zInfoUser.getClanId() != null, ZInfoUser::getClanId, zInfoUser.getClanId()); |
| | | |
| | | lqw.eq(zInfoUser.getUaid() !=null, ZInfoUser::getUaid, zInfoUser.getUaid()); |
| | | return lqw; |
| | | |
| | | } |
| | |
| | | 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(); |
| | | BeanUtils.copyProperties(zInfoUser, newGenealogy); |
| | | |
| | | if (zInfoUser.getSpouseId() != null) { |
| | | ZInfoUser spouse = getById(zInfoUser.getSpouseId()); |
| | | List<Genealogy> allData = userList.stream().map( |
| | | zInfoUser -> { |
| | | Genealogy newGenealogy = new Genealogy(); |
| | | BeanUtils.copyProperties(zInfoUser, newGenealogy); |
| | | |
| | | Genealogy spouseInfo = new Genealogy(); |
| | | BeanUtils.copyProperties(spouse,spouseInfo); |
| | | newGenealogy.setSpouse(spouseInfo); |
| | | spouseInfo.setIdentity(newGenealogy.getIdentity()); |
| | | spouseInfo.setSpouseName(zInfoUser.getNickName()); |
| | | newGenealogy.setSpouseName(spouse.getNickName()); |
| | | } |
| | | System.out.println(newGenealogy); |
| | | return newGenealogy; |
| | | } |
| | | if (zInfoUser.getSpouseId() != null) { |
| | | ZInfoUser spouse = getById(zInfoUser.getSpouseId()); |
| | | |
| | | Genealogy spouseInfo = new Genealogy(); |
| | | BeanUtils.copyProperties(spouse,spouseInfo); |
| | | newGenealogy.setSpouse(spouseInfo); |
| | | spouseInfo.setIdentity(newGenealogy.getIdentity()); |
| | | 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) |
| | |
| | | .collect(Collectors.toList()); |
| | | List<Genealogy> resultData = new ArrayList<>(); |
| | | |
| | | for (int i = (pageNum - 1) * pageSize; i < pageNum * pageSize + pageSize; i++) { |
| | | if (i >= collect.size()) { |
| | | break; |
| | | } |
| | | resultData.add(collect.get(i)); |
| | | } |
| | | |
| | | // System.out.println(resultData); |
| | | // System.out.println("999999999988888888888++++++++++++++++++++++"); |
| | | // |
| | | // |
| | | //对result做一个条件筛选 |
| | | Iterator<Genealogy> it = resultData.iterator(); |
| | | Iterator<Genealogy> it = collect.iterator(); |
| | | while(it.hasNext()){ |
| | | Genealogy data = it.next(); |
| | | |
| | |
| | | // } |
| | | // |
| | | // } |
| | | for (int i = (pageNum - 1) * pageSize; i < pageNum * pageSize; i++) { |
| | | if (i >= collect.size()) { |
| | | break; |
| | | } |
| | | System.out.println(i+"//////"+collect.get(i)); |
| | | resultData.add(collect.get(i)); |
| | | } |
| | | |
| | | HashMap<String, Object> resultMap = new HashMap<>(); |
| | | resultMap.put("data", resultData); |
| | | resultMap.put("total", resultData.size()); |
| | | resultMap.put("total", collect.size()); |
| | | resultMap.put("pageNum", pageNum); |
| | | resultMap.put("pageSize", pageSize); |
| | | |
| | |
| | | @Override |
| | | public ZInfoUser getInfoById(Long userId) { |
| | | ZInfoUser user = getInfoBysysId(userId); |
| | | |
| | | |
| | | if(user==null) { |
| | | //利用userId查询 |