diff --git a/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java b/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java index 453cb53..5a86bd1 100644 --- a/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java +++ b/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java @@ -66,6 +66,7 @@ public PolicyListResponseDto getSearchPolicyList(User user, SearchPolicyListRequ dto.updateCityCode(dto.getCityCode()); dto.updatePolicyMethodType(dto.getPolicyMethodTypeDescription()); dto.updatePolicyLogo(imageClassifier.getLogo(findPolicy)); + dto.updateBenefitPeriod(CashBenefitType.findCashBenefit(findPolicy)); // dto.updatePolicyUrl(dto.getPolicyUrl().startsWith("http")); return dto; }); @@ -91,6 +92,7 @@ public PolicyListResponseDto getSearchPolicyList(User user, SearchPolicyListRequ dto.updateCityCode(dto.getCityCode()); dto.updatePolicyMethodType(dto.getPolicyMethodTypeDescription()); dto.updatePolicyLogo(imageClassifier.getLogo(findPolicy)); + dto.updateBenefitPeriod(CashBenefitType.findCashBenefit(findPolicy)); return dto; }); diff --git a/src/main/java/com/cmc/zenefitserver/domain/policy/dao/PolicyQueryRepository.java b/src/main/java/com/cmc/zenefitserver/domain/policy/dao/PolicyQueryRepository.java index d222cf6..0f78cb2 100644 --- a/src/main/java/com/cmc/zenefitserver/domain/policy/dao/PolicyQueryRepository.java +++ b/src/main/java/com/cmc/zenefitserver/domain/policy/dao/PolicyQueryRepository.java @@ -42,6 +42,7 @@ public Page searchByAppliedPaging(User user, SupportPolicyTyp policy.cityCode.stringValue(), policy.policyDateType, policy.benefit, + policy.benefitPeriod, Expressions.cases() .when(userPolicy.applyFlag.isNull()) .then(false) @@ -151,7 +152,6 @@ private BooleanExpression isSqlzType(User user) { public Page searchByNonAppliedPaging(User user, SupportPolicyType supportPolicyType, PolicyCode policyCode, String keyword, Pageable pageable, List appliedPolicyIds) { - JPAQuery query = jpaQueryFactory.select( Projections.constructor(PolicyListInfoDto.class, policy.id, @@ -162,6 +162,7 @@ public Page searchByNonAppliedPaging(User user, SupportPolicy policy.cityCode.stringValue(), policy.policyDateType, policy.benefit, + policy.benefitPeriod, Expressions.cases() .when(userPolicy.applyFlag.isNull()) .then(false) diff --git a/src/main/java/com/cmc/zenefitserver/domain/policy/dto/response/PolicyListInfoDto.java b/src/main/java/com/cmc/zenefitserver/domain/policy/dto/response/PolicyListInfoDto.java index 9165c2c..24b956e 100644 --- a/src/main/java/com/cmc/zenefitserver/domain/policy/dto/response/PolicyListInfoDto.java +++ b/src/main/java/com/cmc/zenefitserver/domain/policy/dto/response/PolicyListInfoDto.java @@ -46,6 +46,9 @@ public class PolicyListInfoDto { @ApiModelProperty(notes = "수혜 금액") private BigDecimal benefit; + @ApiModelProperty(notes = "수혜 금액 기간", example = "년 , 월") + private String benefitPeriod; + @ApiModelProperty(notes = "수혜(신청) 정책 여부") private boolean applyFlag; @@ -93,7 +96,7 @@ public void updatePolicyUrl(String policyUrl) { } @Builder - public PolicyListInfoDto(Long policyId, String policyName, String policyLogo, String policyIntroduction, String areaCode, String cityCode, PolicyDateType policyDateType, String policyDateTypeDescription, String policyApplyDenialReason, boolean applyStatus, BigDecimal benefit, boolean applyFlag, boolean interestFlag, PolicyMethodType policyMethodType, String policyMethodTypeDescription, String policyUrl) { + public PolicyListInfoDto(Long policyId, String policyName, String policyLogo, String policyIntroduction, String areaCode, String cityCode, PolicyDateType policyDateType, String policyDateTypeDescription, String policyApplyDenialReason, boolean applyStatus, BigDecimal benefit, String benefitPeriod, boolean applyFlag, boolean interestFlag, PolicyMethodType policyMethodType, String policyMethodTypeDescription, String policyUrl) { this.policyId = policyId; this.policyName = policyName; this.policyLogo = policyLogo; @@ -105,6 +108,7 @@ public PolicyListInfoDto(Long policyId, String policyName, String policyLogo, St this.policyApplyDenialReason = policyApplyDenialReason; this.applyStatus = applyStatus; this.benefit = benefit; + this.benefitPeriod = benefitPeriod; this.applyFlag = applyFlag; this.interestFlag = interestFlag; this.policyMethodType = policyMethodType; @@ -112,7 +116,7 @@ public PolicyListInfoDto(Long policyId, String policyName, String policyLogo, St this.policyUrl = policyUrl; } - public PolicyListInfoDto(Long policyId, String policyName, String policyLogo, String policyIntroduction, String areaCode, String cityCode, PolicyDateType policyDateType, BigDecimal benefit, boolean applyFlag, boolean interestFlag, String policyMethodTypeDescription, String policyUrl) { + public PolicyListInfoDto(Long policyId, String policyName, String policyLogo, String policyIntroduction, String areaCode, String cityCode, PolicyDateType policyDateType, BigDecimal benefit, String benefitPeriod, boolean applyFlag, boolean interestFlag, String policyMethodTypeDescription, String policyUrl) { this.policyId = policyId; this.policyName = policyName; this.policyLogo = policyLogo; @@ -121,6 +125,7 @@ public PolicyListInfoDto(Long policyId, String policyName, String policyLogo, St this.cityCode = cityCode; this.policyDateType = policyDateType; this.benefit = benefit; + this.benefitPeriod = benefitPeriod; this.applyFlag = applyFlag; this.interestFlag = interestFlag; this.policyMethodTypeDescription = policyMethodTypeDescription; @@ -133,4 +138,8 @@ public void updatePolicyMethodType(String applicationProcedureContent) { this.policyMethodTypeDescription = findPolicyMethodType.getDescription(); } + public void updateBenefitPeriod(String benefitPeriod) { + this.benefitPeriod = benefitPeriod; + } + }