From ae536b434f6eae2a64b4ce30cd8def726ff05a0a Mon Sep 17 00:00:00 2001 From: zqy <2522236926@qq.com> Date: 星期日, 22 六月 2025 22:47:02 +0800 Subject: [PATCH] Merge branch 'master' of http://47.93.189.255:8099/r/zhangshi_app_backend --- zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionServiceImpl.java | 28 ++++++++++++++++++++++------ 1 files changed, 22 insertions(+), 6 deletions(-) diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionServiceImpl.java index 7d61d5b..a53bada 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionServiceImpl.java @@ -63,6 +63,12 @@ @Resource RestHighLevelClient restHighLevelClient; + @Resource + ZfCollectionShareService zfCollectionShareService; + + @Resource + ZfCollectionDownloadService zfCollectionDownloadService; + private LambdaQueryWrapper<ZfCollection> buildCondition(ZfCollection zfCollection,List<Long> familyIdList) { LambdaQueryWrapper<ZfCollection> lqw = new LambdaQueryWrapper<>(); lqw.orderByDesc(ZfCollection::getCreateTime); @@ -233,7 +239,7 @@ fatherFaId = zInfoUserService.getInfoById(myself.getFatherId()).getFamilyId(); Long motherFaId = 0L; if(myself.getMomId()!=null) - motherFaId = zInfoUserService.getInfoBysysId(myself.getMomId()).getFamilyId(); + motherFaId = zInfoUserService.getInfoById(myself.getMomId()).getFamilyId(); //涔熻鏌ュ埆浜烘巿鏉冪殑 List<ZAuthority> authority = zAuthorityService.getAuthority(); @@ -244,7 +250,11 @@ //鍔犱笂鐖舵瘝瀹舵棌id idList.add(fatherFaId); idList.add(motherFaId); - + List<Long> fms = zInfoUserService.findByUaidToFaid(myself.getUaid()).stream().map(ZInfoUser::getFamilyId).collect(Collectors.toList()); + if(!fms.isEmpty()) + { + idList.addAll(fms); + } LambdaQueryWrapper<ZfCollection> lambdaQueryWrapper = buildCondition(zfCollection, idList); List<ZfCollection> beanRecords = list(lambdaQueryWrapper); log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", beanRecords); @@ -282,7 +292,7 @@ public List<ZfCollection> markOwnData(Long familyId,Long fatherFamilyId, Long motherFamilyId,List<ZfCollection> beanRecords){ return beanRecords.stream().peek( bean -> { - if (bean.getFamilyId() == familyId||(fatherFamilyId!=0L && fatherFamilyId==familyId)||(motherFamilyId!=0L && motherFamilyId==familyId)) { + if (Objects.equals(bean.getFamilyId(), familyId) ||(fatherFamilyId!=0L && fatherFamilyId.equals(familyId))||(motherFamilyId!=0L && motherFamilyId.equals(familyId))) { bean.setOwnData(1); } else { bean.setOwnData(0); @@ -322,7 +332,7 @@ fatherFaId = zInfoUserService.getInfoById(myself.getFatherId()).getFamilyId(); Long motherFaId = 0L; if(myself.getMomId()!=null) - motherFaId = zInfoUserService.getInfoBysysId(myself.getMomId()).getFamilyId(); + motherFaId = zInfoUserService.getInfoById(myself.getMomId()).getFamilyId(); //涔熻鏌ュ埆浜烘巿鏉冪殑 List<ZAuthority> authority = zAuthorityService.getAuthority(); @@ -333,7 +343,11 @@ //鍔犱笂鐖舵瘝瀹舵棌id idList.add(fatherFaId); idList.add(motherFaId); - + List<Long> fms = zInfoUserService.findByUaidToFaid(myself.getUaid()).stream().map(ZInfoUser::getFamilyId).collect(Collectors.toList()); + if(!fms.isEmpty()) + { + idList.addAll(fms); + } // String familyIds = listFamilyIds(); // String secondFamilyAuthority = listSecondFamilyIds(); LambdaQueryWrapper<ZfCollection> lqw = buildCondition(zfCollection, idList); @@ -579,7 +593,9 @@ } List<ZfCollection> zfCollections = listByIds(Arrays.asList(ids)); - + if (! ( zfCollectionDownloadService.deleteData(ids) && zfCollectionShareService.deleteByContentId(ids) ) ){ + return AjaxResult.error(); + } if (zfCollectionService.removeByIds(Arrays.asList(ids))) { //鍒犻櫎es涓殑鏁版嵁 -- Gitblit v1.9.1