Pull request #56: added transactional
Merge in RED/persistence-service from 3.0-efsa-readiness to master * commit 'de5fa8c94641400a90df3b95b24f931a2ff1d723': logs for analysis required added transactional
This commit is contained in:
commit
032dbb56ec
@ -8,7 +8,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@ -50,7 +49,8 @@ public class ViewedPagesPersistenceService {
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void resetViewedPages(String fileId, String currentReviewer, List<Integer> viewedPagesToReset) {
|
||||
viewedPagesRepository.deleteSeenPages(fileId,currentReviewer,viewedPagesToReset);
|
||||
viewedPagesRepository.deleteSeenPages(fileId, currentReviewer, viewedPagesToReset);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import com.iqser.red.service.persistence.management.v1.processor.service.persist
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.RulesPersistenceService;
|
||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.FileModel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
@ -16,6 +17,7 @@ import java.util.Map;
|
||||
|
||||
import static com.iqser.red.service.peristence.v1.server.service.ReanalysisRequiredStatusService.VersionType.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ReanalysisRequiredStatusService {
|
||||
@ -85,7 +87,16 @@ public class ReanalysisRequiredStatusService {
|
||||
var legalBasisVersionMatches = fileStatus.getLegalBasisVersion() == dossierTemplateVersions.getOrDefault(LEGAL_BASIS, -1L);
|
||||
var dossierDictionaryVersionMatches = fileStatus.getDossierDictionaryVersion() == dossierDictionaryVersion;
|
||||
|
||||
return !(rulesVersionMatches && dictionaryVersionMatches && legalBasisVersionMatches && dossierDictionaryVersionMatches);
|
||||
var analysisRequired = !(rulesVersionMatches && dictionaryVersionMatches && legalBasisVersionMatches && dossierDictionaryVersionMatches);
|
||||
|
||||
if (analysisRequired) {
|
||||
log.info("For file: {} analysis is required because -> ruleVersionMatches: {}/{}, dictionaryVersionMatches: {}/{}, legalBasisVersionMatches: {}/{}, dossierDictionaryVersionMatches: {}/{}",
|
||||
fileStatus.getFilename(), fileStatus.getRulesVersion(), dossierTemplateVersions.getOrDefault(RULES, -1L),
|
||||
fileStatus.getDictionaryVersion(), dossierTemplateVersions.getOrDefault(DICTIONARY, -1L),
|
||||
fileStatus.getLegalBasisVersion(), dossierTemplateVersions.getOrDefault(LEGAL_BASIS, -1L),
|
||||
fileStatus.getDossierDictionaryVersion(), dossierDictionaryVersion);
|
||||
}
|
||||
return analysisRequired;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user