Skip to content

Commit

Permalink
feet : 정책 리스트 조회 API 에 수혜 금액 기간 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Feb 24, 2024
1 parent 399b1f5 commit 4752bb8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public Page<PolicyListInfoDto> searchByAppliedPaging(User user, SupportPolicyTyp
policy.cityCode.stringValue(),
policy.policyDateType,
policy.benefit,
policy.benefitPeriod,
Expressions.cases()
.when(userPolicy.applyFlag.isNull())
.then(false)
Expand Down Expand Up @@ -151,7 +152,6 @@ private BooleanExpression isSqlzType(User user) {

public Page<PolicyListInfoDto> searchByNonAppliedPaging(User user, SupportPolicyType supportPolicyType, PolicyCode policyCode, String keyword, Pageable pageable, List<Long> appliedPolicyIds) {


JPAQuery<PolicyListInfoDto> query = jpaQueryFactory.select(
Projections.constructor(PolicyListInfoDto.class,
policy.id,
Expand All @@ -162,6 +162,7 @@ public Page<PolicyListInfoDto> searchByNonAppliedPaging(User user, SupportPolicy
policy.cityCode.stringValue(),
policy.policyDateType,
policy.benefit,
policy.benefitPeriod,
Expressions.cases()
.when(userPolicy.applyFlag.isNull())
.then(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public class PolicyListInfoDto {
@ApiModelProperty(notes = "수혜 금액")
private BigDecimal benefit;

@ApiModelProperty(notes = "수혜 금액 기간", example = "년 , 월")
private String benefitPeriod;

@ApiModelProperty(notes = "수혜(신청) 정책 여부")
private boolean applyFlag;

Expand Down Expand Up @@ -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;
Expand All @@ -105,14 +108,15 @@ 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;
this.policyMethodTypeDescription = policyMethodTypeDescription;
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;
Expand All @@ -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;
Expand All @@ -133,4 +138,8 @@ public void updatePolicyMethodType(String applicationProcedureContent) {
this.policyMethodTypeDescription = findPolicyMethodType.getDescription();
}

public void updateBenefitPeriod(String benefitPeriod) {
this.benefitPeriod = benefitPeriod;
}

}

0 comments on commit 4752bb8

Please sign in to comment.