Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #197 from FinFellows/develop
Browse files Browse the repository at this point in the history
[FIX]: 예금 계산기 계산 방식 변경 + maxLimit 정렬 조건 수정 (#196)
  • Loading branch information
sejineer authored Jan 17, 2024
2 parents 771db0f + d1d10ea commit 17a6690
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ public DepositCalculateRes depositCalculate(Long depositId, Double amount) {
.max(Comparator.comparing(FinancialProductOption::getInterestRate))
.orElseThrow(RuntimeException::new);

Double maxInterestRate = amount + (amount * Double.parseDouble(maxOption.getMaximumPreferredInterestRate()) * 0.846);
Double interestRate = amount + (amount * Double.parseDouble(defaultOption.getInterestRate()) * 0.846);
Double maxInterestRate = amount + (amount * (Double.parseDouble(maxOption.getMaximumPreferredInterestRate()) / 100) * 0.846);
Double interestRate = amount + (amount * (Double.parseDouble(defaultOption.getInterestRate()) / 100) * 0.846);

return DepositCalculateRes.toDto(maxInterestRate, interestRate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Page<SearchFinancialProductRes> findFinancialProductsWithAuthorization(Fi
bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()),
bankNameEq(financialProductSearchCondition.getBankNames()),
financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByDefault.savingsTerm.in(financialProductSearchCondition.getTerms()) : null,
maxLimitLoe(financialProductSearchCondition.getMaxLimit())
maxLimitGoe(financialProductSearchCondition.getMaxLimit())
)
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
.offset(pageable.getOffset())
Expand All @@ -83,7 +83,7 @@ public Page<SearchFinancialProductRes> findFinancialProductsWithAuthorization(Fi
typeEq(financialProductSearchCondition.getTypes()),
bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()),
bankNameEq(financialProductSearchCondition.getBankNames()),
maxLimitLoe(financialProductSearchCondition.getMaxLimit()),
maxLimitGoe(financialProductSearchCondition.getMaxLimit()),
financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByDefault.savingsTerm.in(financialProductSearchCondition.getTerms()) : null
);
} else {
Expand All @@ -110,7 +110,7 @@ public Page<SearchFinancialProductRes> findFinancialProductsWithAuthorization(Fi
bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()),
bankNameEq(financialProductSearchCondition.getBankNames()),
financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByMax.savingsTerm.in(financialProductSearchCondition.getTerms()) : null,
maxLimitLoe(financialProductSearchCondition.getMaxLimit())
maxLimitGoe(financialProductSearchCondition.getMaxLimit())
)
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
.offset(pageable.getOffset())
Expand All @@ -129,7 +129,7 @@ public Page<SearchFinancialProductRes> findFinancialProductsWithAuthorization(Fi
bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()),
financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByMax.savingsTerm.in(financialProductSearchCondition.getTerms()) : null,
bankNameEq(financialProductSearchCondition.getBankNames()),
maxLimitLoe(financialProductSearchCondition.getMaxLimit())
maxLimitGoe(financialProductSearchCondition.getMaxLimit())
);
}

Expand Down Expand Up @@ -167,7 +167,7 @@ public Page<SearchFinancialProductRes> findFinancialProducts(FinancialProductSea
bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()),
financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByDefault.savingsTerm.in(financialProductSearchCondition.getTerms()) : null,
bankNameEq(financialProductSearchCondition.getBankNames()),
maxLimitLoe(financialProductSearchCondition.getMaxLimit())
maxLimitGoe(financialProductSearchCondition.getMaxLimit())
)
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
.offset(pageable.getOffset())
Expand All @@ -185,7 +185,7 @@ public Page<SearchFinancialProductRes> findFinancialProducts(FinancialProductSea
bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()),
financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByDefault.savingsTerm.in(financialProductSearchCondition.getTerms()) : null,
bankNameEq(financialProductSearchCondition.getBankNames()),
maxLimitLoe(financialProductSearchCondition.getMaxLimit())
maxLimitGoe(financialProductSearchCondition.getMaxLimit())
);
} else {
orderSpecifiers.add(financialProductOptionOrderByMax.maximumPreferredInterestRate.desc());
Expand All @@ -210,7 +210,7 @@ public Page<SearchFinancialProductRes> findFinancialProducts(FinancialProductSea
bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()),
financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByMax.savingsTerm.in(financialProductSearchCondition.getTerms()) : null,
bankNameEq(financialProductSearchCondition.getBankNames()),
maxLimitLoe(financialProductSearchCondition.getMaxLimit())
maxLimitGoe(financialProductSearchCondition.getMaxLimit())
)
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
.offset(pageable.getOffset())
Expand All @@ -228,7 +228,7 @@ public Page<SearchFinancialProductRes> findFinancialProducts(FinancialProductSea
bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()),
financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByMax.savingsTerm.in(financialProductSearchCondition.getTerms()) : null,
bankNameEq(financialProductSearchCondition.getBankNames()),
maxLimitLoe(financialProductSearchCondition.getMaxLimit())
maxLimitGoe(financialProductSearchCondition.getMaxLimit())
);
}

Expand Down Expand Up @@ -417,9 +417,9 @@ private BooleanExpression cmaBankNameEq(String[] bankNames) {
return expression;
}

private BooleanExpression maxLimitLoe(Integer maxLimit) {
private BooleanExpression maxLimitGoe(Integer maxLimit) {
if(maxLimit == null) return null;
return financialProduct.maxLimit.loe(maxLimit).or(financialProduct.maxLimit.isNull());
return financialProduct.maxLimit.goe(maxLimit).or(financialProduct.maxLimit.eq(0));
}

}

0 comments on commit 17a6690

Please sign in to comment.