dev fix add count
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-04-28 15:58:35 +07:00
parent 61e47975ff
commit c44c251790
@@ -76,9 +76,15 @@ public class ViolationService {
Sort sort = Sort.by(sortDirection.equalsIgnoreCase("desc") ? Sort.Direction.DESC : Sort.Direction.ASC, Sort sort = Sort.by(sortDirection.equalsIgnoreCase("desc") ? Sort.Direction.DESC : Sort.Direction.ASC,
"createdDate"); "createdDate");
Pageable pageable = PageRequest.of(page, size, sort); Pageable pageable = PageRequest.of(page, size, sort);
Page<Violation> violations;
Page<Violation> violations = violationRepository.findByFileEntityInAndStatusNotAndCreatedDateBetween( if (start == null || end == null) {
userFiles, ViolationStatus.NOT_OWNER_FILE.name(), start, end, pageable); violations = violationRepository.findByFileEntityInAndStatusNot( userFiles,
ViolationStatus.NOT_OWNER_FILE.name(),pageable);
} else {
violations = violationRepository.findByFileEntityInAndStatusNotAndCreatedDateBetween(
userFiles, ViolationStatus.NOT_OWNER_FILE.name(), start, end, pageable);
}
Map<String, List<Violation>> violationsByFileId = violations.getContent().stream() Map<String, List<Violation>> violationsByFileId = violations.getContent().stream()
.collect(Collectors.groupingBy(v -> v.getFileEntity().getId())); .collect(Collectors.groupingBy(v -> v.getFileEntity().getId()));