RED-3620: Fixed remove from dictionary
This commit is contained in:
parent
34dc4f4a98
commit
358395e69b
@ -99,8 +99,13 @@ public class DictionaryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Set<DictionaryEntry> entries = new HashSet<>();
|
Set<DictionaryEntry> entries = new HashSet<>();
|
||||||
|
var newEntries = convertEntries(t.getId(), currentVersion);
|
||||||
|
var newValues = newEntries.stream().map(v -> v.getValue()).collect(Collectors.toSet());
|
||||||
|
|
||||||
// add old entries from existing DictionaryModel
|
// add old entries from existing DictionaryModel
|
||||||
oldModel.ifPresent(dictionaryModel -> entries.addAll(dictionaryModel.getEntries()));
|
oldModel.ifPresent(dictionaryModel -> entries.addAll(dictionaryModel.getEntries().stream().filter(
|
||||||
|
f -> !newValues.contains(f.getValue())).collect(Collectors.toList())
|
||||||
|
));
|
||||||
// Add Increments
|
// Add Increments
|
||||||
entries.addAll(convertEntries(t.getId(), currentVersion));
|
entries.addAll(convertEntries(t.getId(), currentVersion));
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user