From d1d10ea02c15052e8e1831cfbd76630a242ee276 Mon Sep 17 00:00:00 2001 From: Sejin Park <95167215+sejineer@users.noreply.github.com> Date: Wed, 17 Jan 2024 23:40:30 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]:=20=EC=98=88=EA=B8=88=20=EA=B3=84?= =?UTF-8?q?=EC=82=B0=EA=B8=B0=20=EA=B3=84=EC=82=B0=20=EB=B0=A9=EC=8B=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20+=20maxLimit=20=EC=A0=95=EB=A0=AC=20?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=20=EC=88=98=EC=A0=95=20(#196)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FEAT] BankUpload API 구현 * [FIX]: 배열 쿼리 적용 * [FIX]: 이미지 URL 안나가는 현상 수정 * [FIX]: HomePage URL도 포함 * [FIX]: 이율타입 별 데이터 조회, 정렬 수정 * [FIX]: 은행 이름으로 조회 조건 수정 * [FIX]: 대규모 패치 * [FIX]: Terms 조회 안되는 현상 수정 * [FIX]: Term 정렬 조건 FIX + 최대 금액 조건 추가 * [FIX]: Term 정렬 조건 FIX + 최대 금액 조건 추가 * [FIX]: 최대 금액 조건 오류 FIX * [FEAT]: 예금 계산기 API 구현 * [FIX]: 예금 계산기 loe -> goe 변경 * [FIX]: maxLimit null 값 0으로 대체 --- .../FinancialProductServiceImpl.java | 4 ++-- ...inancialProductQueryDslRepositoryImpl.java | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) 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