From 98cd4713254614381ede8fa42d0820a3ffc1d53e Mon Sep 17 00:00:00 2001 From: feige <791364011@qq.com> Date: 星期五, 18 十月 2024 10:36:39 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java | 44 ++++++++++++++++++++++++++++++-------------- 1 files changed, 30 insertions(+), 14 deletions(-) diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java index 629d521..adad208 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java @@ -209,15 +209,28 @@ ZInfoUser myself = zInfoUserService.getMyself(); Long familyId = myself.getFamilyId(); + //鏌ョ湅鐖舵瘝鐨勬暟鎹細 + Long fatherFaId = 0L; + if(myself.getFatherId()!=null) + fatherFaId = zInfoUserService.getInfoById(myself.getFatherId()).getFamilyId(); + Long motherFaId = 0L; + if(myself.getMomId()!=null) + motherFaId = zInfoUserService.getInfoBysysId(myself.getMomId()).getFamilyId(); + //涔熻鏌ュ埆浜烘巿鏉冪殑 List<ZAuthority> authority = zAuthorityService.getAuthority(); List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(CONTACT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); //鍔犱笂鑷繁瀹跺涵鐨刬d + idList.add(familyId); + + //鍔犱笂鐖舵瘝瀹舵棌id + idList.add(fatherFaId); + idList.add(motherFaId); LambdaQueryWrapper<ZfContact> lambdaQueryWrapper = buildCondition(zfContact, idList); List<ZfContact> beanRecords = list(lambdaQueryWrapper); log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", beanRecords); - return markOwnData(familyId, beanRecords); + return markOwnData(familyId,fatherFaId, motherFaId, beanRecords); } @Override @@ -248,10 +261,10 @@ // }).collect(Collectors.toList()); // } - public List<ZfContact> markOwnData(Long familyId,List<ZfContact> beanRecords){ + public List<ZfContact> markOwnData(Long familyId,Long fatherFamilyId, Long motherFamilyId, List<ZfContact> beanRecords){ return beanRecords.stream().peek( bean -> { - if (bean.getFamilyId() == familyId) { + if (bean.getFamilyId() == familyId||(fatherFamilyId!=0L && fatherFamilyId==familyId)||(motherFamilyId!=0L && motherFamilyId==familyId)) { bean.setOwnData(1); } else { bean.setOwnData(0); @@ -284,21 +297,24 @@ return AjaxResult.success("鎮ㄦ病鍔犲叆鍒板搴旂殑瀹跺涵锛岃鑱旂郴绠$悊鍛�"); } Long familyId = myself.getFamilyId(); + + //鏌ョ湅鐖舵瘝鐨勬暟鎹細 + Long fatherFaId = 0L; + if(myself.getFatherId()!=null) + fatherFaId = zInfoUserService.getInfoById(myself.getFatherId()).getFamilyId(); + Long motherFaId = 0L; + if(myself.getMomId()!=null) + motherFaId = zInfoUserService.getInfoBysysId(myself.getMomId()).getFamilyId(); + //涔熻鏌ュ埆浜烘巿鏉冪殑 -// -// System.out.println("--------------7777----------------"); -// -// System.out.println(familyId); List<ZAuthority> authority = zAuthorityService.getAuthority(); List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(CONTACT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); //鍔犱笂鑷繁瀹跺涵鐨刬d idList.add(familyId); -// -// System.out.println(idList.size()); -// System.out.println(idList.get(0)); -// -// System.out.println("------------------------------"); - idList.add(familyId); + + //鍔犱笂鐖舵瘝瀹舵棌id + idList.add(fatherFaId); + idList.add(motherFaId); // String familyIds = listFamilyIds(); // String secondFamilyAuthority = listSecondFamilyIds(); @@ -310,7 +326,7 @@ List<ZfContact> beanRecords = pageResult.getRecords();//寰楀埌鏌ヨ鍑烘潵鐨勬暟鎹� - List<ZfContact> dtoResult = markOwnData(familyId, beanRecords); + List<ZfContact> dtoResult = markOwnData(familyId,fatherFaId, motherFaId, beanRecords); HashMap<String, Object> data = MapUtils.getResult(pageResult, dtoResult); return AjaxResult.success(data); -- Gitblit v1.9.1