From c643b1d47646a6c9543bdabe484e0dee2c6d0d24 Mon Sep 17 00:00:00 2001 From: Marc Oller Date: Fri, 30 Aug 2024 14:03:02 +0200 Subject: [PATCH] =?UTF-8?q?Microsoft:=20C=C3=A0rrega=20inicial=20des=20de?= =?UTF-8?q?=20les=20sincronitzacions=20existents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MicrosoftSynchronizationServiceImpl.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/microsoft-integration/impl/src/main/java/org/sakaiproject/microsoft/impl/MicrosoftSynchronizationServiceImpl.java b/microsoft-integration/impl/src/main/java/org/sakaiproject/microsoft/impl/MicrosoftSynchronizationServiceImpl.java index 6057ddc4764..155b6532d8b 100644 --- a/microsoft-integration/impl/src/main/java/org/sakaiproject/microsoft/impl/MicrosoftSynchronizationServiceImpl.java +++ b/microsoft-integration/impl/src/main/java/org/sakaiproject/microsoft/impl/MicrosoftSynchronizationServiceImpl.java @@ -224,9 +224,21 @@ public List getLinkedSiteSynchronizations(boolean fillSite) @Override public List getFilteredSiteSynchronizations(boolean fillSite, SakaiSiteFilter filter, ZonedDateTime fromDate, ZonedDateTime toDate) { + List result = microsoftSiteSynchronizationRepository.findByDate(fromDate, toDate); + + if(filter.getSiteProperty().isEmpty()){ + return result.stream().map(ss -> { + if (fillSite) { + ss.setSite(sakaiProxy.getSite(ss.getSiteId())); + } + return ss; + }) + .collect(Collectors.toList()); + } + final List sites = sakaiProxy.getSakaiSites(filter); - List result = microsoftSiteSynchronizationRepository.findByDate(fromDate, toDate).stream().map(ss -> { + return result.stream().map(ss -> { Site site = null; if (fillSite) { site = sites.stream().filter(s -> s.getId().equals(ss.getSiteId())).findFirst().orElse(null); @@ -237,7 +249,6 @@ public List getFilteredSiteSynchronizations(boolean fillSit }) .filter(Objects::nonNull) .collect(Collectors.toList()); - return result; } @Override