Pull request #336: updated flag correct sets

Merge in RED/persistence-service from master-ports-2 to master

* commit '25391040fffd761260c4689888b42fd655184797':
  updated flag correct sets
This commit is contained in:
Timo Bejan 2022-04-05 11:24:58 +02:00
commit 8847a67ea2
3 changed files with 7 additions and 7 deletions

View File

@ -337,13 +337,13 @@ public class FileStatusPersistenceService {
@Transactional
public void setLastRedactionModificationDateForFile(String fileId, OffsetDateTime changeDate) {
fileRepository.setLastRedactionModificationDateForFile(fileId, changeDate);
fileRepository.setLastRedactionModificationDateForFile(fileId, changeDate, OffsetDateTime.now());
}
@Transactional
public void setLastManualChangeDate(String fileId, OffsetDateTime lastManualChangeDate) {
fileRepository.setLastManualChangeDate(fileId, lastManualChangeDate);
fileRepository.setLastManualChangeDate(fileId, lastManualChangeDate, OffsetDateTime.now());
}

View File

@ -132,12 +132,12 @@ public interface FileRepository extends JpaRepository<FileEntity, String> {
List<String> findDossierChangeByLastUpdatedIsAfter(OffsetDateTime since);
@Modifying(clearAutomatically = true)
@Query("update FileEntity f set f.redactionModificationDate = :redactionModificationDate where f.id = :fileId")
void setLastRedactionModificationDateForFile(String fileId, OffsetDateTime redactionModificationDate);
@Query("update FileEntity f set f.redactionModificationDate = :redactionModificationDate, f.lastUpdated = :lastUpdated where f.id = :fileId")
void setLastRedactionModificationDateForFile(String fileId, OffsetDateTime redactionModificationDate, OffsetDateTime lastUpdated);
@Modifying(clearAutomatically = true)
@Query("update FileEntity f set f.lastManualChangeDate = :lastManualChangeDate where f.id = :fileId")
void setLastManualChangeDate(String fileId, OffsetDateTime lastManualChangeDate);
@Query("update FileEntity f set f.lastManualChangeDate = :lastManualChangeDate, f.lastUpdated = :lastUpdated where f.id = :fileId")
void setLastManualChangeDate(String fileId, OffsetDateTime lastManualChangeDate, OffsetDateTime lastUpdated);
@Query("select f from FileEntity f join DossierEntity d on d.id = f.dossierId where f.workflowStatus <> 'APPROVED' and f.excludedFromAutomaticAnalysis = false " +
"and ( f.processingStatus = 'PROCESSED' or f.processingStatus = 'UNPROCESSED' or f.processingStatus = 'DELETED' or f.processingStatus = 'ERROR' )" +

View File

@ -126,7 +126,7 @@ public class AnalysisFlagsCalculationService {
if (lastRedactionModification != null && (file.getRedactionModificationDate() == null || file.getRedactionModificationDate().isBefore(lastRedactionModification))) {
fileStatusPersistenceService.setLastRedactionModificationDateForFile(fileId, lastRedactionModification);
}
if (lastManualChangeDate != null) {
if (lastManualChangeDate != null && (file.getLastManualChangeDate() == null || file.getLastManualChangeDate().isBefore(lastManualChangeDate))) {
fileStatusPersistenceService.setLastManualChangeDate(fileId, lastManualChangeDate);
}