creted and modified by and

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

View File

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

View File

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