Skip to content

Commit

Permalink
fix(#94) : form type 컬럼을 변경하도록 수정
Browse files Browse the repository at this point in the history
- 분석을 하기 위해서는 form type이 Regular로 바뀌는 것이 맞다고 판단됭더 다시 변경하였습니다.
  • Loading branch information
jyj1289 committed Jul 6, 2024
1 parent 3e0a18c commit 9f196f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ public void execute(SendMessageByTypeRequest request) {
sendMessageService.execute(phoneNumberList, request.getText(), request.getTitle());
}

private List<Form> formListFilter(FormType formType, Boolean isChangeToRegular) {
private List<Form> formListFilter(FormType formType, Boolean isChangedToRegular) {
List<Form> formList;
if (formType.isRegular()) {
formList = formRepository.findNotExistsMeisterTalentFirstRoundForm();
} else if (formType.isMeister() && isChangeToRegular) {
formList = formRepository.findChangedToRegularFirstRoundForm();
} else {
if (formType.isMeister()) {
formList = formRepository.findMeisterTalentFirstRoundForm();
} else {
if(isChangedToRegular)
formList = formRepository.findChangedToRegularFirstRoundForm();
else
formList = formRepository.findNotExistsMeisterTalentFirstRoundForm();
}

return formList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public boolean isFailedNow() {

public void changeToRegular(CalculateFormScoreService calculateFormScoreService) {
this.changedToRegular = true;
this.type = FormType.REGULAR;

Double subjectGradeScore = calculateFormScoreService.calculateSubjectGradeScore(this);
this.score.updateSubjectScore(subjectGradeScore);
Expand All @@ -214,14 +215,6 @@ public void assignExaminationNumber(Long examinationNumber) {
this.examinationNumber = examinationNumber;
}

public FormType getType() {
if (changedToRegular) {
return FormType.REGULAR;
}

return type;
}

public FormType getOriginalType() {
return type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public List<Form> findNotExistsMeisterTalentFirstRoundForm() {
return queryFactory
.selectFrom(form)
.where(form.status.eq(FormStatus.FIRST_PASSED)
.and(form.type.ne(FormType.MEISTER_TALENT))
.and(form.type.ne(FormType.MEISTER_TALENT)
.and(form.changedToRegular.isFalse()))
)
.fetch();
}
Expand All @@ -111,7 +112,7 @@ public List<Form> findChangedToRegularFirstRoundForm() {
return queryFactory
.selectFrom(form)
.where(form.status.eq(FormStatus.FIRST_PASSED)
.and(form.type.eq(FormType.MEISTER_TALENT)
.and(form.type.eq(FormType.REGULAR)
.and(form.changedToRegular.isTrue()))
)
.fetch();
Expand Down

0 comments on commit 9f196f0

Please sign in to comment.