Skip to content

Commit

Permalink
[#72] 빈자리 알림 대상 강의 못찾는 이슈 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
Hank-Choi committed May 15, 2023
1 parent 8b23b7a commit 8e2ddc7
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ class VacancyNotifierServiceImpl(

val lectureAndRegistrationStatus = (lectureMap.keys intersect registrationStatusMap.keys)
.map { lectureMap[it]!! to registrationStatusMap[it]!! }
val updated = lectureAndRegistrationStatus
.filter { (lecture, status) -> lecture.registrationCount != status.registrationCount }
.map { (lecture, status) -> lecture.apply { registrationCount = status.registrationCount } }
lectureService.upsertLectures(updated)

val isCurrentStudentRegistrationPeriod =
coursebook.semester == Semester.SPRING && lectureAndRegistrationStatus.filter { (lecture, status) ->
Expand All @@ -81,9 +77,14 @@ class VacancyNotifierServiceImpl(
} else {
lecture.quota == lecture.registrationCount
}
}.filter { (lecture, status) -> (lecture.registrationCount ?: 0) > status.registrationCount }
}.filter { (lecture, status) -> lecture.registrationCount > status.registrationCount }
.map { (lecture, status) -> lecture }

val updated = lectureAndRegistrationStatus
.filter { (lecture, status) -> lecture.registrationCount != status.registrationCount }
.map { (lecture, status) -> lecture.apply { registrationCount = status.registrationCount } }
lectureService.upsertLectures(updated)

notiTargetLectures.forEach {
logger.info("이름: ${it.courseTitle}, 강좌번호: ${it.courseNumber}, 분반번호: ${it.lectureNumber}")
}
Expand Down

0 comments on commit 8e2ddc7

Please sign in to comment.