diff --git a/src/main/java/com/finfellows/domain/product/application/FinancialProductServiceImpl.java b/src/main/java/com/finfellows/domain/product/application/FinancialProductServiceImpl.java index fa8f2f1..b1b27b4 100644 --- a/src/main/java/com/finfellows/domain/product/application/FinancialProductServiceImpl.java +++ b/src/main/java/com/finfellows/domain/product/application/FinancialProductServiceImpl.java @@ -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); } diff --git a/src/main/java/com/finfellows/domain/product/domain/repository/FinancialProductQueryDslRepositoryImpl.java b/src/main/java/com/finfellows/domain/product/domain/repository/FinancialProductQueryDslRepositoryImpl.java index 8b502fd..56cb781 100644 --- a/src/main/java/com/finfellows/domain/product/domain/repository/FinancialProductQueryDslRepositoryImpl.java +++ b/src/main/java/com/finfellows/domain/product/domain/repository/FinancialProductQueryDslRepositoryImpl.java @@ -65,7 +65,7 @@ public Page 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()) @@ -83,7 +83,7 @@ public Page 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 { @@ -110,7 +110,7 @@ public Page 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()) @@ -129,7 +129,7 @@ public Page findFinancialProductsWithAuthorization(Fi bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()), financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByMax.savingsTerm.in(financialProductSearchCondition.getTerms()) : null, bankNameEq(financialProductSearchCondition.getBankNames()), - maxLimitLoe(financialProductSearchCondition.getMaxLimit()) + maxLimitGoe(financialProductSearchCondition.getMaxLimit()) ); } @@ -167,7 +167,7 @@ public Page 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()) @@ -185,7 +185,7 @@ public Page 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()); @@ -210,7 +210,7 @@ public Page 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()) @@ -228,7 +228,7 @@ public Page findFinancialProducts(FinancialProductSea bankGroupNoEq(financialProductSearchCondition.getBankGroupNos()), financialProductSearchCondition.getTerms() != null ? financialProductOptionOrderByMax.savingsTerm.in(financialProductSearchCondition.getTerms()) : null, bankNameEq(financialProductSearchCondition.getBankNames()), - maxLimitLoe(financialProductSearchCondition.getMaxLimit()) + maxLimitGoe(financialProductSearchCondition.getMaxLimit()) ); } @@ -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)); } } \ No newline at end of file