@@ -76,9 +76,15 @@ public class ViolationService {
|
||||
Sort sort = Sort.by(sortDirection.equalsIgnoreCase("desc") ? Sort.Direction.DESC : Sort.Direction.ASC,
|
||||
"createdDate");
|
||||
Pageable pageable = PageRequest.of(page, size, sort);
|
||||
Page<Violation> violations;
|
||||
|
||||
Page<Violation> violations = violationRepository.findByFileEntityInAndStatusNotAndCreatedDateBetween(
|
||||
if (start == null || end == null) {
|
||||
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()
|
||||
.collect(Collectors.groupingBy(v -> v.getFileEntity().getId()));
|
||||
|
||||
Reference in New Issue
Block a user