calculate flags skips some pages
This commit is contained in:
parent
84330967dd
commit
3e2a18e78e
@ -16,5 +16,6 @@ public class ForceRedactionRequest {
|
|||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
private String legalBasis;
|
private String legalBasis;
|
||||||
private String comment;
|
private String comment;
|
||||||
|
private int page;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,5 +16,6 @@ public class ImageRecategorizationRequest {
|
|||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
private String typeId;
|
private String typeId;
|
||||||
private String comment;
|
private String comment;
|
||||||
|
private int page;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,5 +16,6 @@ public class LegalBasisChangeRequest {
|
|||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
private String legalBasis;
|
private String legalBasis;
|
||||||
private String comment;
|
private String comment;
|
||||||
|
private int page;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,5 +16,6 @@ public class RemoveRedactionRequest {
|
|||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
private boolean removeFromDictionary;
|
private boolean removeFromDictionary;
|
||||||
private String comment;
|
private String comment;
|
||||||
|
private int page;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,8 @@ public class IdRemovalEntity {
|
|||||||
private OffsetDateTime processedDate;
|
private OffsetDateTime processedDate;
|
||||||
@Column
|
@Column
|
||||||
private OffsetDateTime softDeletedTime;
|
private OffsetDateTime softDeletedTime;
|
||||||
|
@Column
|
||||||
|
private int page;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private FileEntity fileStatus;
|
private FileEntity fileStatus;
|
||||||
|
|||||||
@ -32,6 +32,8 @@ public class ManualForceRedactionEntity {
|
|||||||
private OffsetDateTime processedDate;
|
private OffsetDateTime processedDate;
|
||||||
@Column
|
@Column
|
||||||
private OffsetDateTime softDeletedTime;
|
private OffsetDateTime softDeletedTime;
|
||||||
|
@Column
|
||||||
|
private int page;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private FileEntity fileStatus;
|
private FileEntity fileStatus;
|
||||||
|
|||||||
@ -32,6 +32,8 @@ public class ManualImageRecategorizationEntity {
|
|||||||
private OffsetDateTime processedDate;
|
private OffsetDateTime processedDate;
|
||||||
@Column
|
@Column
|
||||||
private OffsetDateTime softDeletedTime;
|
private OffsetDateTime softDeletedTime;
|
||||||
|
@Column
|
||||||
|
private int page;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private FileEntity fileStatus;
|
private FileEntity fileStatus;
|
||||||
|
|||||||
@ -33,6 +33,8 @@ public class ManualLegalBasisChangeEntity {
|
|||||||
private OffsetDateTime processedDate;
|
private OffsetDateTime processedDate;
|
||||||
@Column
|
@Column
|
||||||
private OffsetDateTime softDeletedTime;
|
private OffsetDateTime softDeletedTime;
|
||||||
|
@Column
|
||||||
|
private int page;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private FileEntity fileStatus;
|
private FileEntity fileStatus;
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.iqser.red.service.peristence.v1.server.controller;
|
package com.iqser.red.service.peristence.v1.server.controller;
|
||||||
|
|
||||||
import com.iqser.red.service.peristence.v1.server.service.AnalysisFlagsCalculationService;
|
|
||||||
import com.iqser.red.service.peristence.v1.server.service.ManualRedactionService;
|
import com.iqser.red.service.peristence.v1.server.service.ManualRedactionService;
|
||||||
import com.iqser.red.service.peristence.v1.server.utils.ManualImageRecategorizationMapper;
|
import com.iqser.red.service.peristence.v1.server.utils.ManualImageRecategorizationMapper;
|
||||||
import com.iqser.red.service.peristence.v1.server.utils.ManualRedactionMapper;
|
import com.iqser.red.service.peristence.v1.server.utils.ManualRedactionMapper;
|
||||||
@ -19,7 +18,6 @@ import static com.iqser.red.service.persistence.management.v1.processor.utils.Ma
|
|||||||
public class ManualRedactionController implements ManualRedactionResource {
|
public class ManualRedactionController implements ManualRedactionResource {
|
||||||
|
|
||||||
private final ManualRedactionService manualRedactionService;
|
private final ManualRedactionService manualRedactionService;
|
||||||
private final AnalysisFlagsCalculationService analysisFlagsCalculationService;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -27,9 +25,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(FILE_ID) String fileId,
|
@PathVariable(FILE_ID) String fileId,
|
||||||
@RequestBody AddRedactionRequest addRedactionRequest) {
|
@RequestBody AddRedactionRequest addRedactionRequest) {
|
||||||
|
|
||||||
var resp = manualRedactionService.addAddRedaction(dossierId, fileId, addRedactionRequest);
|
return manualRedactionService.addAddRedaction(dossierId, fileId, addRedactionRequest);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
return resp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -38,9 +34,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(FILE_ID) String fileId,
|
@PathVariable(FILE_ID) String fileId,
|
||||||
@RequestBody RemoveRedactionRequest removeRedactionRequest) {
|
@RequestBody RemoveRedactionRequest removeRedactionRequest) {
|
||||||
|
|
||||||
var resp = manualRedactionService.addRemoveRedaction(dossierId, fileId, removeRedactionRequest);
|
return manualRedactionService.addRemoveRedaction(dossierId, fileId, removeRedactionRequest);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
return resp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -49,9 +43,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(FILE_ID) String fileId,
|
@PathVariable(FILE_ID) String fileId,
|
||||||
@RequestBody ForceRedactionRequest forceRedactionRequest) {
|
@RequestBody ForceRedactionRequest forceRedactionRequest) {
|
||||||
|
|
||||||
var resp = manualRedactionService.addForceRedaction(dossierId, fileId, forceRedactionRequest);
|
return manualRedactionService.addForceRedaction(dossierId, fileId, forceRedactionRequest);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
return resp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -60,9 +52,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(FILE_ID) String fileId,
|
@PathVariable(FILE_ID) String fileId,
|
||||||
@RequestBody LegalBasisChangeRequest legalBasisChangeRequest) {
|
@RequestBody LegalBasisChangeRequest legalBasisChangeRequest) {
|
||||||
|
|
||||||
var resp = manualRedactionService.addLegalBasisChange(dossierId, fileId, legalBasisChangeRequest);
|
return manualRedactionService.addLegalBasisChange(dossierId, fileId, legalBasisChangeRequest);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
return resp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -71,9 +61,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(FILE_ID) String fileId,
|
@PathVariable(FILE_ID) String fileId,
|
||||||
@RequestBody ImageRecategorizationRequest imageRecategorizationRequest) {
|
@RequestBody ImageRecategorizationRequest imageRecategorizationRequest) {
|
||||||
|
|
||||||
var resp = manualRedactionService.addImageRecategorization(dossierId, fileId, imageRecategorizationRequest);
|
return manualRedactionService.addImageRecategorization(dossierId, fileId, imageRecategorizationRequest);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
return resp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -82,9 +70,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(ANNOTATION_ID) String annotationId,
|
@PathVariable(ANNOTATION_ID) String annotationId,
|
||||||
@RequestBody CommentRequest comment) {
|
@RequestBody CommentRequest comment) {
|
||||||
|
|
||||||
var resp = convert(manualRedactionService.addComment(fileId, annotationId, comment), Comment.class);
|
return convert(manualRedactionService.addComment(fileId, annotationId, comment), Comment.class);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
return resp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -138,7 +124,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(ANNOTATION_ID) String annotationId) {
|
@PathVariable(ANNOTATION_ID) String annotationId) {
|
||||||
|
|
||||||
manualRedactionService.deleteAddRedaction(dossierId, fileId, annotationId);
|
manualRedactionService.deleteAddRedaction(dossierId, fileId, annotationId);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -147,7 +132,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(ANNOTATION_ID) String annotationId) {
|
@PathVariable(ANNOTATION_ID) String annotationId) {
|
||||||
|
|
||||||
manualRedactionService.deleteRemoveRedaction(dossierId, fileId, annotationId);
|
manualRedactionService.deleteRemoveRedaction(dossierId, fileId, annotationId);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -156,7 +140,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(ANNOTATION_ID) String annotationId) {
|
@PathVariable(ANNOTATION_ID) String annotationId) {
|
||||||
|
|
||||||
manualRedactionService.deleteForceRedaction(dossierId, fileId, annotationId);
|
manualRedactionService.deleteForceRedaction(dossierId, fileId, annotationId);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -165,7 +148,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(ANNOTATION_ID) String annotationId) {
|
@PathVariable(ANNOTATION_ID) String annotationId) {
|
||||||
|
|
||||||
manualRedactionService.deleteLegalBasisChange(dossierId, fileId, annotationId);
|
manualRedactionService.deleteLegalBasisChange(dossierId, fileId, annotationId);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -175,7 +157,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@PathVariable(ANNOTATION_ID) String annotationId) {
|
@PathVariable(ANNOTATION_ID) String annotationId) {
|
||||||
|
|
||||||
manualRedactionService.deleteImageRecategorization(dossierId, fileId, annotationId);
|
manualRedactionService.deleteImageRecategorization(dossierId, fileId, annotationId);
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -183,7 +164,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
public void deleteComment(@PathVariable(FILE_ID) String fileId, @PathVariable(COMMENT_ID) long commentId) {
|
public void deleteComment(@PathVariable(FILE_ID) String fileId, @PathVariable(COMMENT_ID) long commentId) {
|
||||||
|
|
||||||
manualRedactionService.deleteComment(fileId, commentId);
|
manualRedactionService.deleteComment(fileId, commentId);
|
||||||
// TODO analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -194,7 +174,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
||||||
|
|
||||||
manualRedactionService.updateAddRedactionStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
manualRedactionService.updateAddRedactionStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -205,7 +184,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
||||||
|
|
||||||
manualRedactionService.updateRemoveRedactionStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
manualRedactionService.updateRemoveRedactionStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -216,7 +194,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
||||||
|
|
||||||
manualRedactionService.updateForceRedactionStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
manualRedactionService.updateForceRedactionStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -226,7 +203,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
||||||
|
|
||||||
manualRedactionService.updateLegalBasisChangeStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
manualRedactionService.updateLegalBasisChangeStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -237,7 +213,6 @@ public class ManualRedactionController implements ManualRedactionResource {
|
|||||||
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
@RequestBody JSONPrimitive<AnnotationStatus> updateStatusRequest) {
|
||||||
|
|
||||||
manualRedactionService.updateImageRecategorizationStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
manualRedactionService.updateImageRecategorizationStatus(dossierId, fileId, annotationId, updateStatusRequest.getValue());
|
||||||
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.iqser.red.service.peristence.v1.server.service;
|
package com.iqser.red.service.peristence.v1.server.service;
|
||||||
|
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
import com.iqser.red.service.persistence.management.v1.processor.entity.annotations.ViewedPageEntity;
|
import com.iqser.red.service.persistence.management.v1.processor.entity.annotations.ViewedPageEntity;
|
||||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.FileStatusPersistenceService;
|
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.FileStatusPersistenceService;
|
||||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.ViewedPagesPersistenceService;
|
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.ViewedPagesPersistenceService;
|
||||||
@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -28,6 +30,11 @@ public class AnalysisFlagsCalculationService {
|
|||||||
|
|
||||||
@Async
|
@Async
|
||||||
public void calculateFlags(String dossierId, String fileId) {
|
public void calculateFlags(String dossierId, String fileId) {
|
||||||
|
this.calculateFlags(dossierId,fileId, Sets.newHashSet());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void calculateFlags(String dossierId, String fileId, Set<Integer> pagesToSkip) {
|
||||||
|
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
|
|
||||||
@ -89,6 +96,8 @@ public class AnalysisFlagsCalculationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
viewedPagesToReset.removeAll(pagesToSkip);
|
||||||
|
|
||||||
viewedPagesPersistenceService.resetViewedPages(fileId, file.getCurrentReviewer(), viewedPagesToReset);
|
viewedPagesPersistenceService.resetViewedPages(fileId, file.getCurrentReviewer(), viewedPagesToReset);
|
||||||
fileStatusPersistenceService.updateFlags(fileId, hasRedactions, hasHints, hasImages, hasSuggestions, hasComments, hasUpdates);
|
fileStatusPersistenceService.updateFlags(fileId, hasRedactions, hasHints, hasImages, hasSuggestions, hasComments, hasUpdates);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.iqser.red.service.peristence.v1.server.service;
|
package com.iqser.red.service.peristence.v1.server.service;
|
||||||
|
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
import com.google.common.hash.HashFunction;
|
import com.google.common.hash.HashFunction;
|
||||||
import com.google.common.hash.Hashing;
|
import com.google.common.hash.Hashing;
|
||||||
import com.iqser.red.service.peristence.v1.server.controller.DictionaryController;
|
import com.iqser.red.service.peristence.v1.server.controller.DictionaryController;
|
||||||
@ -41,6 +42,7 @@ public class ManualRedactionService {
|
|||||||
private final LegalBasisChangePersistenceService legalBasisChangePersistenceService;
|
private final LegalBasisChangePersistenceService legalBasisChangePersistenceService;
|
||||||
private final FileStatusService fileStatusService;
|
private final FileStatusService fileStatusService;
|
||||||
private final ManualRedactionProviderService manualRedactionProviderService;
|
private final ManualRedactionProviderService manualRedactionProviderService;
|
||||||
|
private final AnalysisFlagsCalculationService analysisFlagsCalculationService;
|
||||||
private final StopwordService stopwordService;
|
private final StopwordService stopwordService;
|
||||||
|
|
||||||
private final HashFunction hashFunction = Hashing.murmur3_128();
|
private final HashFunction hashFunction = Hashing.murmur3_128();
|
||||||
@ -85,6 +87,10 @@ public class ManualRedactionService {
|
|||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, now);
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!addRedactionRequest.getPositions().isEmpty()) {
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(addRedactionRequest.getPositions().get(0).getPage()));
|
||||||
|
}
|
||||||
|
|
||||||
return ManualAddResponse.builder().annotationId(annotationId).commentId(commentId).build();
|
return ManualAddResponse.builder().annotationId(annotationId).commentId(commentId).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,6 +119,10 @@ public class ManualRedactionService {
|
|||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, now);
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!removeRedactionRequest.isRemoveFromDictionary()) {
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(removeRedactionRequest.getPage()));
|
||||||
|
}
|
||||||
|
|
||||||
return ManualAddResponse.builder()
|
return ManualAddResponse.builder()
|
||||||
.annotationId(removeRedactionRequest.getAnnotationId())
|
.annotationId(removeRedactionRequest.getAnnotationId())
|
||||||
.commentId(commentId)
|
.commentId(commentId)
|
||||||
@ -141,6 +151,8 @@ public class ManualRedactionService {
|
|||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, now);
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(forceRedactionRequest.getPage()));
|
||||||
|
|
||||||
return ManualAddResponse.builder()
|
return ManualAddResponse.builder()
|
||||||
.annotationId(forceRedactionRequest.getAnnotationId())
|
.annotationId(forceRedactionRequest.getAnnotationId())
|
||||||
.commentId(commentId)
|
.commentId(commentId)
|
||||||
@ -169,6 +181,8 @@ public class ManualRedactionService {
|
|||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, now);
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(legalBasisChangeRequest.getPage()));
|
||||||
|
|
||||||
return ManualAddResponse.builder()
|
return ManualAddResponse.builder()
|
||||||
.annotationId(legalBasisChangeRequest.getAnnotationId())
|
.annotationId(legalBasisChangeRequest.getAnnotationId())
|
||||||
.commentId(commentId)
|
.commentId(commentId)
|
||||||
@ -198,6 +212,8 @@ public class ManualRedactionService {
|
|||||||
fileStatusService.setStatusReprocess(dossierId, fileId, 2);
|
fileStatusService.setStatusReprocess(dossierId, fileId, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
||||||
|
|
||||||
return ManualAddResponse.builder()
|
return ManualAddResponse.builder()
|
||||||
.annotationId(imageRecategorizationRequest.getAnnotationId())
|
.annotationId(imageRecategorizationRequest.getAnnotationId())
|
||||||
.commentId(commentId)
|
.commentId(commentId)
|
||||||
@ -210,6 +226,8 @@ public class ManualRedactionService {
|
|||||||
var createdComment = addComment(fileId, annotationId, commentRequest.getText(), commentRequest.getUser());
|
var createdComment = addComment(fileId, annotationId, commentRequest.getText(), commentRequest.getUser());
|
||||||
|
|
||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
||||||
|
fileStatusPersistenceService.updateHasComments(fileId, true);
|
||||||
|
|
||||||
return createdComment;
|
return createdComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,6 +284,10 @@ public class ManualRedactionService {
|
|||||||
} else {
|
} else {
|
||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!addRedaction.getPositions().isEmpty()) {
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(addRedaction.getPositions().get(0).getPage()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -285,6 +307,7 @@ public class ManualRedactionService {
|
|||||||
} else {
|
} else {
|
||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
||||||
}
|
}
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(removeRedaction.getPage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -300,6 +323,7 @@ public class ManualRedactionService {
|
|||||||
} else {
|
} else {
|
||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
||||||
}
|
}
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(forceRedaction.getPage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -314,6 +338,7 @@ public class ManualRedactionService {
|
|||||||
} else {
|
} else {
|
||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
||||||
}
|
}
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(legalBasisChange.getPage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -330,6 +355,7 @@ public class ManualRedactionService {
|
|||||||
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
fileStatusPersistenceService.updateLastManualRedaction(fileId, OffsetDateTime.now());
|
||||||
fileStatusService.setStatusReprocess(dossierId, fileId, 2);
|
fileStatusService.setStatusReprocess(dossierId, fileId, 2);
|
||||||
}
|
}
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -340,6 +366,7 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
// update indicator
|
// update indicator
|
||||||
fileStatusPersistenceService.updateHasComments(fileId, commentPersistenceService.fileHasComments(fileId));
|
fileStatusPersistenceService.updateHasComments(fileId, commentPersistenceService.fileHasComments(fileId));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -379,6 +406,8 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
||||||
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
||||||
|
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(idRemoval.getPage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String buildTypeId(RedactionLogEntry redactionLogEntry, DossierEntity dossier) {
|
private String buildTypeId(RedactionLogEntry redactionLogEntry, DossierEntity dossier) {
|
||||||
@ -396,6 +425,7 @@ public class ManualRedactionService {
|
|||||||
forceRedactionPersistenceService.updateStatus(fileId, annotationId, annotationStatus);
|
forceRedactionPersistenceService.updateStatus(fileId, annotationId, annotationStatus);
|
||||||
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
||||||
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -405,16 +435,17 @@ public class ManualRedactionService {
|
|||||||
legalBasisChangePersistenceService.updateStatus(fileId, annotationId, annotationStatus);
|
legalBasisChangePersistenceService.updateStatus(fileId, annotationId, annotationStatus);
|
||||||
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
||||||
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateImageRecategorizationStatus(String dossierId, String fileId, String annotationId,
|
public void updateImageRecategorizationStatus(String dossierId, String fileId, String annotationId,
|
||||||
AnnotationStatus annotationStatus) {
|
AnnotationStatus annotationStatus) {
|
||||||
|
|
||||||
|
ManualImageRecategorizationEntity imageRecategorization = recategorizationPersistenceService.findRecategorization(fileId, annotationId);
|
||||||
|
|
||||||
if (annotationStatus.equals(AnnotationStatus.DECLINED)) {
|
if (annotationStatus.equals(AnnotationStatus.DECLINED)) {
|
||||||
|
|
||||||
ManualImageRecategorizationEntity imageRecategorization = recategorizationPersistenceService.findRecategorization(fileId, annotationId);
|
|
||||||
// if it was previously approved, revert the delete
|
// if it was previously approved, revert the delete
|
||||||
if (imageRecategorization.getStatus() == AnnotationStatus.APPROVED) {
|
if (imageRecategorization.getStatus() == AnnotationStatus.APPROVED) {
|
||||||
fileStatusService.setStatusReprocess(dossierId, fileId, 2);
|
fileStatusService.setStatusReprocess(dossierId, fileId, 2);
|
||||||
@ -427,6 +458,7 @@ public class ManualRedactionService {
|
|||||||
recategorizationPersistenceService.updateStatus(fileId, annotationId, annotationStatus);
|
recategorizationPersistenceService.updateStatus(fileId, annotationId, annotationStatus);
|
||||||
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
||||||
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(imageRecategorization.getPage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -451,6 +483,9 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
boolean hasSuggestions = calculateHasSuggestions(fileId);
|
||||||
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
fileStatusPersistenceService.setUpdateLastManualRedactionAndHasSuggestions(fileId, OffsetDateTime.now(), hasSuggestions);
|
||||||
|
if (!manualRedactionEntry.getPositions().isEmpty()) {
|
||||||
|
analysisFlagsCalculationService.calculateFlags(dossierId, fileId, Sets.newHashSet(manualRedactionEntry.getPositions().get(0).getPage()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user