Pull request #343: RED-3407: Remove obsolete recommendation dictionaries
Merge in RED/redaction-service from RED-3407-rs1 to master * commit 'c3984e054482acab3acde740b8dce437d97e9ffb': RED-3407: Remove obsolete recommendation dictionaries
This commit is contained in:
commit
fd027efa5c
@ -188,8 +188,6 @@ public class AnalyzeService {
|
|||||||
|
|
||||||
PageEntities pageEntities = entityRedactionService.findEntities(dictionary, text.getSectionTexts(), kieContainer, analyzeRequest, nerEntities);
|
PageEntities pageEntities = entityRedactionService.findEntities(dictionary, text.getSectionTexts(), kieContainer, analyzeRequest, nerEntities);
|
||||||
|
|
||||||
dictionaryService.updateExternalDictionary(dictionary, analyzeRequest.getDossierTemplateId(), analyzeRequest.getDossierId());
|
|
||||||
|
|
||||||
List<RedactionLogEntry> redactionLogEntries = redactionLogCreatorService.createRedactionLog(pageEntities, text.getNumberOfPages(), analyzeRequest.getDossierTemplateId());
|
List<RedactionLogEntry> redactionLogEntries = redactionLogCreatorService.createRedactionLog(pageEntities, text.getNumberOfPages(), analyzeRequest.getDossierTemplateId());
|
||||||
|
|
||||||
var legalBasis = legalBasisClient.getLegalBasisMapping(analyzeRequest.getDossierTemplateId());
|
var legalBasis = legalBasisClient.getLegalBasisMapping(analyzeRequest.getDossierTemplateId());
|
||||||
|
|||||||
@ -118,20 +118,6 @@ public class DictionaryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateExternalDictionary(Dictionary dictionary, String dossierTemplateId, String dossierId) {
|
|
||||||
|
|
||||||
dictionary.getDictionaryModels().forEach(dm -> {
|
|
||||||
if (dm.isRecommendation() && !dm.getLocalEntries().isEmpty()) {
|
|
||||||
dictionaryClient.addEntries(IdBuilder.getTypeId(dm.getType(), dossierTemplateId, dm.isDossierDictionary() ? dossierId : null), new ArrayList<>(dm.getLocalEntries()), false, true);
|
|
||||||
long externalVersion = dictionaryClient.getVersion(dossierTemplateId);
|
|
||||||
if (externalVersion == dictionary.getVersion().getDossierTemplateVersion() + 1) {
|
|
||||||
dictionary.getVersion().setDossierTemplateVersion(externalVersion);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private Set<DictionaryEntry> convertEntries(String typeId) {
|
private Set<DictionaryEntry> convertEntries(String typeId) {
|
||||||
|
|
||||||
var type = dictionaryClient.getDictionaryForType(typeId);
|
var type = dictionaryClient.getDictionaryForType(typeId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user