Commit 4b011578 authored by Hando Lukats's avatar Hando Lukats
Browse files

TEIS-2452; implemented changes from testing

parent 9e0f28ed
......@@ -36,9 +36,8 @@ public class RiskAssessmentPDFComposeService {
private final RiskIndicatorDataService riskIndicatorDataService;
private final FileReferenceBusinessService fileReferenceBusinessService;
public RiskFactorPdfCategoryDto composeRiskFactorCategoryDto(String name, Long seqNo, boolean additional) {
public RiskFactorPdfCategoryDto composeRiskFactorCategoryDto(String name, Long seqNo) {
return RiskFactorPdfCategoryDto.builder()
.additional(additional)
.name(name)
.seqNo(seqNo)
.build();
......
......@@ -110,7 +110,7 @@ public class RiskAssessmentPDFService {
if (BooleanUtils.isFalse(riskFactorAssessment.getAdditional()) && riskFactorAssessment.getRiskFactorId() != null) {
setRiskFactorCategoryByClassifier(categoryList, riskFactorAssessment, requestMetaDTO);
} else if (BooleanUtils.isTrue(riskFactorAssessment.getAdditional())) {
RiskFactorPdfCategoryDto category = pdfComposeService.composeRiskFactorCategoryDto(ADDITIONAL_RISK_FACTORS, null, true);
RiskFactorPdfCategoryDto category = pdfComposeService.composeRiskFactorCategoryDto(ADDITIONAL_RISK_FACTORS, null);
Optional<RiskFactorPdfCategoryDto> existingCategory = getExistingRiskFactorCategory(categoryList, ADDITIONAL_RISK_FACTORS);
RiskFactorPdfDto riskFactor;
if (riskFactorAssessment.getRiskFactorId() != null) {
......@@ -130,7 +130,7 @@ public class RiskAssessmentPDFService {
private void sortCategories(List<RiskFactorPdfCategoryDto> categoryList) {
categoryList.sort(Comparator.comparing(RiskFactorPdfCategoryDto::getSeqNo, Comparator.nullsLast(Comparator.naturalOrder()))
.thenComparing(RiskFactorPdfCategoryDto::getName, Comparator.nullsLast(Comparator.naturalOrder())).thenComparing(RiskFactorPdfCategoryDto::isAdditional));
.thenComparing(RiskFactorPdfCategoryDto::getName, Comparator.nullsLast(Comparator.naturalOrder())));
categoryList.sort((first, second) -> {
boolean b1 = first.getName().equals(ADDITIONAL_RISK_FACTORS);
boolean b2 = second.getName().equals(ADDITIONAL_RISK_FACTORS);
......@@ -219,7 +219,7 @@ public class RiskAssessmentPDFService {
RiskFactorEntity riskFactor = riskFactorDataService.getCurrentById(riskFactorAssessment.getRiskFactorId());
ClassifierItem categoryClassifier = classifierService.getClassifierItem(riskFactor.getCategory(), requestMetaDTO);
RiskFactorPdfCategoryDto category = pdfComposeService.composeRiskFactorCategoryDto(categoryClassifier.getName(), categoryClassifier.getSeqNo(), false);
RiskFactorPdfCategoryDto category = pdfComposeService.composeRiskFactorCategoryDto(categoryClassifier.getName(), categoryClassifier.getSeqNo());
Optional<RiskFactorPdfCategoryDto> existingCategory = getExistingRiskFactorCategory(categoryList, categoryClassifier.getName());
RiskFactorPdfDto riskFactorData;
if (riskFactorAssessment.getRiskFactorId() != null) {
......
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