Compare commits

...
Author SHA1 Message Date
Dominique Eiflaender d2a650e043 Pull request #200: Fixed dossier dictionary and dictionary rank sorting
Merge in RED/redaction-service from RankFix2.1.x to release/2.27.x

* commit '94d6fc3e28b377ca2f65802d2bf4ab4e61604991':
  Fixed dossier dictionary and dictionary rank sorting
2021-07-29 11:48:14 +02:00
Dominique Eifländer 94d6fc3e28 Fixed dossier dictionary and dictionary rank sorting 2021-07-29 11:40:25 +02:00
Dominique Eifländer 9d89cf20c8 RED-1728: Do not show isHint flag if only false_positive entries are included in redactionlog 2021-07-01 15:48:28 +02:00
2 changed files with 2 additions and 2 deletions
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
public class AnalyzeResponseService {
public AnalyzeResult createAnalyzeResponse(String dossierId, String fileId, long duration, int pageCount, RedactionLog redactionLog, RedactionChangeLog redactionChangeLog) {
boolean hasHints = redactionLog.getRedactionLogEntry().stream().anyMatch(RedactionLogEntry::isHint);
boolean hasHints = redactionLog.getRedactionLogEntry().stream().anyMatch(entry -> entry.isHint() && !entry.getType().equals("false_positive"));
boolean hasRequests = redactionLog.getRedactionLogEntry()
.stream()
@@ -210,7 +210,7 @@ public class DictionaryService {
dossierDictionaryVersion = dossierRepresentation.getDictionaryVersion();
}
return new Dictionary(copy, DictionaryVersion.builder().dossierTemplateVersion(dossierTemplateRepresentation.getDictionaryVersion()).dossierVersion(dossierDictionaryVersion).build());
return new Dictionary(copy.stream().sorted(Comparator.comparingInt(DictionaryModel::getRank).reversed()).collect(Collectors.toList()), DictionaryVersion.builder().dossierTemplateVersion(dossierTemplateRepresentation.getDictionaryVersion()).dossierVersion(dossierDictionaryVersion).build());
}