Pull request #454: RED-4891: Rectangle redactions not listed in DELTA view
Merge in RED/redaction-service from RED-4891-rs1 to master * commit 'a9ae01ab32f08d0dadb1b12b0cc4db8070071b42': RED-4891: Rectangle redactions not listed in DELTA view
This commit is contained in:
commit
e962992b79
@ -25,6 +25,8 @@ import com.iqser.red.service.persistence.service.v1.api.model.annotations.entity
|
|||||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.configuration.Colors;
|
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.configuration.Colors;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.FileType;
|
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.FileType;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.type.Type;
|
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.type.Type;
|
||||||
|
import com.iqser.red.service.redaction.v1.model.Change;
|
||||||
|
import com.iqser.red.service.redaction.v1.model.ChangeType;
|
||||||
import com.iqser.red.service.redaction.v1.model.ManualChange;
|
import com.iqser.red.service.redaction.v1.model.ManualChange;
|
||||||
import com.iqser.red.service.redaction.v1.model.ManualRedactionType;
|
import com.iqser.red.service.redaction.v1.model.ManualRedactionType;
|
||||||
import com.iqser.red.service.redaction.v1.model.Point;
|
import com.iqser.red.service.redaction.v1.model.Point;
|
||||||
@ -100,7 +102,7 @@ public class RedactionLogMergeService {
|
|||||||
log.info("Merging Redaction log with manual redactions");
|
log.info("Merging Redaction log with manual redactions");
|
||||||
if (manualRedactions != null) {
|
if (manualRedactions != null) {
|
||||||
|
|
||||||
var manualRedactionLogEntries = addManualAddEntries(sectionGrid, manualRedactions.getEntriesToAdd(), manualRedactions.getComments(), colors, types);
|
var manualRedactionLogEntries = addManualAddEntries(sectionGrid, manualRedactions.getEntriesToAdd(), manualRedactions.getComments(), colors, types, redactionLog.getAnalysisNumber());
|
||||||
|
|
||||||
redactionLog.getRedactionLogEntry().addAll(manualRedactionLogEntries);
|
redactionLog.getRedactionLogEntry().addAll(manualRedactionLogEntries);
|
||||||
|
|
||||||
@ -372,14 +374,14 @@ public class RedactionLogMergeService {
|
|||||||
|
|
||||||
public List<RedactionLogEntry> addManualAddEntries(SectionGrid sectionGrid, Set<ManualRedactionEntry> manualAdds,
|
public List<RedactionLogEntry> addManualAddEntries(SectionGrid sectionGrid, Set<ManualRedactionEntry> manualAdds,
|
||||||
Map<String, List<Comment>> comments, Colors colors,
|
Map<String, List<Comment>> comments, Colors colors,
|
||||||
List<Type> types) {
|
List<Type> types, int analysisNumber) {
|
||||||
|
|
||||||
List<RedactionLogEntry> redactionLogEntries = new ArrayList<>();
|
List<RedactionLogEntry> redactionLogEntries = new ArrayList<>();
|
||||||
|
|
||||||
for (ManualRedactionEntry manualRedactionEntry : manualAdds) {
|
for (ManualRedactionEntry manualRedactionEntry : manualAdds) {
|
||||||
|
|
||||||
if (shouldCreateManualEntry(manualRedactionEntry)) {
|
if (shouldCreateManualEntry(manualRedactionEntry)) {
|
||||||
RedactionLogEntry redactionLogEntry = createRedactionLogEntry(manualRedactionEntry, manualRedactionEntry.getAnnotationId(), colors, types);
|
RedactionLogEntry redactionLogEntry = createRedactionLogEntry(manualRedactionEntry, manualRedactionEntry.getAnnotationId(), colors, types, analysisNumber);
|
||||||
redactionLogEntry.setPositions(convertPositions(manualRedactionEntry.getPositions()));
|
redactionLogEntry.setPositions(convertPositions(manualRedactionEntry.getPositions()));
|
||||||
redactionLogEntry.setComments(convert(comments.get(manualRedactionEntry.getAnnotationId())));
|
redactionLogEntry.setComments(convert(comments.get(manualRedactionEntry.getAnnotationId())));
|
||||||
redactionLogEntry.setTextBefore(manualRedactionEntry.getTextBefore());
|
redactionLogEntry.setTextBefore(manualRedactionEntry.getTextBefore());
|
||||||
@ -420,7 +422,7 @@ public class RedactionLogMergeService {
|
|||||||
|
|
||||||
|
|
||||||
private RedactionLogEntry createRedactionLogEntry(ManualRedactionEntry manualRedactionEntry, String id,
|
private RedactionLogEntry createRedactionLogEntry(ManualRedactionEntry manualRedactionEntry, String id,
|
||||||
Colors colors, List<Type> types) {
|
Colors colors, List<Type> types, int analysisNumber) {
|
||||||
|
|
||||||
var addToDictionary = manualRedactionEntry.isAddToDictionary() || manualRedactionEntry.isAddToDossierDictionary();
|
var addToDictionary = manualRedactionEntry.isAddToDictionary() || manualRedactionEntry.isAddToDossierDictionary();
|
||||||
|
|
||||||
@ -445,6 +447,7 @@ public class RedactionLogMergeService {
|
|||||||
.sectionNumber(-1)
|
.sectionNumber(-1)
|
||||||
.rectangle(manualRedactionEntry.isRectangle())
|
.rectangle(manualRedactionEntry.isRectangle())
|
||||||
.manualChanges(changeList)
|
.manualChanges(changeList)
|
||||||
|
.changes(List.of(new Change(analysisNumber + 1, ChangeType.ADDED, manualRedactionEntry.getRequestDate())))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user