Commit e02c76f4 authored by Hando Lukats's avatar Hando Lukats
Browse files

TEIS-2380 refactor

parent a1f8252b
......@@ -78,16 +78,18 @@ public class RiskAssessmentPDFComposeService {
return riskIndicatorPdfDto;
}
public void addToRiskFactorCategory(List<RiskFactorPdfCategoryDto> categoryList, RiskFactorPdfCategoryDto category,
public void addToRiskFactorCategory(List<RiskFactorPdfCategoryDto> categoryList,
RiskFactorPdfCategoryDto categoryDto,
Optional<RiskFactorPdfCategoryDto> existingCategory, RiskFactorPdfDto riskFactorData) {
if (existingCategory.isEmpty()) {
List<RiskFactorPdfDto> riskFactorList = new ArrayList<>();
riskFactorList.add(riskFactorData);
category.setRiskFactors(riskFactorList);
categoryList.add(category);
} else {
existingCategory.ifPresent(cat -> cat.getRiskFactors().add(riskFactorData));
}
existingCategory.ifPresentOrElse(
category -> category.getRiskFactors().add(riskFactorData),
() -> {
List<RiskFactorPdfDto> riskFactorList = new ArrayList<>();
riskFactorList.add(riskFactorData);
categoryDto.setRiskFactors(riskFactorList);
categoryList.add(categoryDto);
}
);
}
public String composeRiskStatementAssessmentStatus(
......
......@@ -34,7 +34,7 @@ spring:
concurrency: ${RABBIT_LISTENER_MIN_CONCURRENCY:5}
max-concurrency: ${RABBIT_LISTENER_MAX_CONCURRENCY:50}
cache:
cache-names: proceedingExists,auditLogExists,
cache-names: proceedingExists,auditLogExists
caffeine:
spec: expireAfterWrite=60m
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment