diff --git a/src/main/kotlin/com/hero/alignlab/batch/posecount/job/PoseCountUpdateJob.kt b/src/main/kotlin/com/hero/alignlab/batch/posecount/job/PoseCountUpdateJob.kt index 906cc3d..b386b66 100644 --- a/src/main/kotlin/com/hero/alignlab/batch/posecount/job/PoseCountUpdateJob.kt +++ b/src/main/kotlin/com/hero/alignlab/batch/posecount/job/PoseCountUpdateJob.kt @@ -37,7 +37,7 @@ class PoseCountUpdateJob( .groupBy { totalCount -> totalCount.uid } /** 집계 처리 데이터 조회 */ - val poseCounts = poseCountService.findAllByUidIn(targetUids) + val poseCounts = poseCountService.findAllByUidInAndDate(targetUids, targetDate) .mapNotNull { poseCount -> /** 데이터가 없는 경우, 업데이트를 진행하지 않는다. */ val totalCount = totalCountByUid[poseCount.uid] ?: return@mapNotNull null diff --git a/src/main/kotlin/com/hero/alignlab/domain/pose/application/PoseCountService.kt b/src/main/kotlin/com/hero/alignlab/domain/pose/application/PoseCountService.kt index fdaf93e..995b7ec 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/pose/application/PoseCountService.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/pose/application/PoseCountService.kt @@ -84,9 +84,9 @@ class PoseCountService( ) } - suspend fun findAllByUidIn(uids: List): List { + suspend fun findAllByUidInAndDate(uids: List, date: LocalDate): List { return withContext(Dispatchers.IO) { - poseCountRepository.findAllByUidIn(uids) + poseCountRepository.findAllByUidInAndDate(uids, date) } } diff --git a/src/main/kotlin/com/hero/alignlab/domain/pose/infrastructure/PoseCountRepository.kt b/src/main/kotlin/com/hero/alignlab/domain/pose/infrastructure/PoseCountRepository.kt index bd2854d..6df4b05 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/pose/infrastructure/PoseCountRepository.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/pose/infrastructure/PoseCountRepository.kt @@ -23,7 +23,7 @@ import java.time.LocalDate interface PoseCountRepository : JpaRepository, PostCountQRepository { fun findByUidAndDate(uid: Long, date: LocalDate): PoseCount? - fun findAllByUidIn(uids: List): List + fun findAllByUidInAndDate(uids: List, date: LocalDate): List fun deleteAllByUid(uid: Long) }