InspectionObligations 5 шаг сортировка не по groupId а по min(registry.id) внутри группы
This commit is contained in:
parent
544c930148
commit
a212e5a7b5
1 changed files with 13 additions and 1 deletions
|
|
@ -107,7 +107,19 @@ public class InspectionObligations implements ISessionStage {
|
||||||
collect(Collectors.groupingBy(Registry::getGroupId))
|
collect(Collectors.groupingBy(Registry::getGroupId))
|
||||||
.entrySet()
|
.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.sorted(Map.Entry.comparingByKey())
|
.sorted((entry1, entry2) -> {
|
||||||
|
long minId1 = entry1.getValue().stream()
|
||||||
|
.mapToLong(Registry::getId)
|
||||||
|
.min()
|
||||||
|
.orElse(Long.MIN_VALUE);
|
||||||
|
|
||||||
|
long minId2 = entry2.getValue().stream()
|
||||||
|
.mapToLong(Registry::getId)
|
||||||
|
.min()
|
||||||
|
.orElse(Long.MIN_VALUE);
|
||||||
|
|
||||||
|
return Long.compare(minId1, minId2);
|
||||||
|
})
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
log.info("found {} ({} groups) registries by sql: {}", registriesToProcess.size(), registriesByGroupSorted.size(), sqlCondition);
|
log.info("found {} ({} groups) registries by sql: {}", registriesToProcess.size(), registriesByGroupSorted.size(), sqlCondition);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue