From 5c99dd327e220d95a54304fb6762c4bbdba92a32 Mon Sep 17 00:00:00 2001 From: DongGeon0908 Date: Wed, 25 Sep 2024 10:39:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=86=B5=EA=B3=84=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=ED=83=80=EA=B2=9F=20=EC=B6=94=EC=B6=9C=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hero/alignlab/batch/posecount/job/PoseCountUpdateJob.kt | 2 +- .../hero/alignlab/domain/pose/application/PoseCountService.kt | 4 ++-- .../domain/pose/infrastructure/PoseCountRepository.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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) }