diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/DisbandFamilyCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/DisbandFamilyCmdExe.java index 975df250..2b2cb1ca 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/DisbandFamilyCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/DisbandFamilyCmdExe.java @@ -18,7 +18,11 @@ import com.red.circle.other.infra.enums.family.FamilyNewsTypeEnum; import com.red.circle.other.infra.enums.family.FamilyStatusEnum; import com.red.circle.other.inner.asserts.FamilyErrorCode; import com.red.circle.tool.core.collection.CollectionUtils; + +import java.util.HashSet; import java.util.List; +import java.util.stream.Collectors; + import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -57,8 +61,8 @@ public class DisbandFamilyCmdExe { disbandFamilyStatus(familyId); -// recordDisbandNews(cmd.getReqSysOrigin().getOrigin(), familyId, familyBaseInfo.getFamilyName()); - + List allMembers = familyMemberInfoService.listByFamilyId(familyId); + notifyAllMembers(allMembers, familyId); } private void clearFamilyData(Long familyId) { @@ -93,11 +97,8 @@ public class DisbandFamilyCmdExe { if (CollectionUtils.isEmpty(members)) { return; } - - members.forEach(member -> { - familyCommon.removeGroup(familyId, member.getMemberUserId()); - userProfileGateway.removeCacheAll(member.getMemberUserId()); - }); + + userProfileGateway.removeCacheAll(members.stream().map(FamilyMemberInfo::getMemberUserId).collect(Collectors.toSet())); } }