Skip to content

Commit

Permalink
[fix] : 조건 판단 로직 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chahyunsoo committed Jun 7, 2024
1 parent 7c9d296 commit 599eb5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ private String compareConditions(ConditionEntity condition, MemberPrivateInfo me
boolean incomeMatch = compareIncome(condition, memberInfo);
System.out.println("incomeMatch = " + incomeMatch);

//모두 일치하는 경우
if (basicInfoMatch && gradesMatch && incomeMatch) {
// exceptionValue 있으면 판단 불가로 함, 그게 아니면 지원 대상
if (condition.getExceptionValue() != null) {
return "판단불가";
}
return "지원대상";
}

// 조건 중 하나라도 일치하지 않는 경우, exceptionValue를 체크하기 전에 먼저 지원불가로 처리
if (!basicInfoMatch || !gradesMatch || !incomeMatch) {
return "지원불가";
Expand All @@ -92,7 +83,16 @@ private String compareConditions(ConditionEntity condition, MemberPrivateInfo me
(condition.getSupportSection() != null && memberInfo.getSupportSection() == null)) {
return "판단불가";
}
return "지원대상";

//모두 일치하는 경우
if (basicInfoMatch && gradesMatch && incomeMatch) {
// exceptionValue 있으면 판단 불가로 함, 그게 아니면 지원 대상
if (condition.getExceptionValue() != null) {
return "판단불가";
}
return "지원대상";
}
return "지원불가";
}

private boolean compareBasicInfo(ConditionEntity condition, MemberPrivateInfo memberInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private List<ConditionCheckResponse> evaluateConditions(MemberPrivateInfo member
// 학교지역 평가
if (announcementConditionEntity.getSchoolRegion() != null) {
String result = (memberInfo.getSchoolLocation() != null && memberInfo.getSchoolLocation().contains(announcementConditionEntity.getSchoolRegion()) ? "초록불" : "빨간불");
responses.add(new ConditionCheckResponse(announcementConditionEntity.getSchoolRegion() + "소제 대학", memberInfo.getSchoolLocation() != null ? result : "회색불"));
responses.add(new ConditionCheckResponse(announcementConditionEntity.getSchoolRegion() + " 소제 대학", memberInfo.getSchoolLocation() != null ? result : "회색불"));

// compareExcept.add(announcementConditionEntity.getIncomeQuality() + "분위 이내");
}
Expand Down

0 comments on commit 599eb5c

Please sign in to comment.