creted and modified by and

This commit is contained in:
Michele Artini 2020-10-29 13:32:09 +01:00
parent 1bfeac01a1
commit 8b27ab280b
2 changed files with 6 additions and 7 deletions

View File

@ -345,6 +345,8 @@ public class DatabaseUtils {
@Transactional
public String fixConflict(final List<String> similarIds, final String user) {
final OffsetDateTime now = OffsetDateTime.now();
final List<OrganizationView> views =
similarIds.stream().map(organizationViewRepository::findById).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
@ -385,8 +387,10 @@ public class DatabaseUtils {
.collect(Collectors.toList());
openaireDuplicateRepository.saveAll(newDuplicates);
final OffsetDateTime now = OffsetDateTime.now();
newDuplicates.forEach(d -> {
openaireDuplicateRepository.updateCreatedByIfMissing(d.getLocalId(), d.getOaOriginalId(), user);
openaireDuplicateRepository.updateModificationDate(d.getLocalId(), d.getOaOriginalId(), user, now);
});
for (final String similarId : similarIds) {
openaireConflictRepository.updateMultipleStatusAndResetGroup(similarId, SimilarityType.is_different.toString(), user, now);

View File

@ -1,5 +0,0 @@
public class SimpleTest {
}