From 71a2094018838d1ef8b14663d9d1c0656191ae57 Mon Sep 17 00:00:00 2001 From: belljun3395 <195850@jnu.ac.kr> Date: Sun, 11 Aug 2024 23:57:48 +0900 Subject: [PATCH] =?UTF-8?q?[Fix/#338]=20=EA=B5=AC=EB=8F=85=20=ED=95=99?= =?UTF-8?q?=EC=8A=B5=EC=A7=80=20=EB=A7=88=EC=A7=80=EB=A7=89=20=EC=95=84?= =?UTF-8?q?=ED=8B=B0=ED=81=B4=EC=9D=84=20=EB=B0=9B=EA=B3=A0=20progess?= =?UTF-8?q?=EB=A5=BC=20=EC=A6=9D=EA=B0=80=ED=95=98=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=ED=95=B4=EA=B2=B0=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 구독 학습지 마지막 아티클을 받고 progess를 증가하는 문제해결 * fix: WorkBookSubscriberWriterTest Disabled 처리 --- .../service/article/writer/WorkBookSubscriberWriter.kt | 9 ++++++--- .../article/writer/WorkBookSubscriberWriterTest.kt | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/batch/src/main/kotlin/com/few/batch/service/article/writer/WorkBookSubscriberWriter.kt b/batch/src/main/kotlin/com/few/batch/service/article/writer/WorkBookSubscriberWriter.kt index e88ac80c1..796861172 100644 --- a/batch/src/main/kotlin/com/few/batch/service/article/writer/WorkBookSubscriberWriter.kt +++ b/batch/src/main/kotlin/com/few/batch/service/article/writer/WorkBookSubscriberWriter.kt @@ -198,13 +198,16 @@ class WorkBookSubscriberWriter( (it.progress.toInt() + 1) == lastDayCol[it.targetWorkBookId] }.map { ReceiveLastDayMember(it.memberId, it.targetWorkBookId) - }.filter { - memberSuccessRecords[it.memberId] == true + } + + val receiveLastDayMemberIds = receiveLastDayMembers.map { + it.memberId } /** 이메일 전송에 성공한 구독자들의 진행률을 업데이트한다.*/ val successMemberIds = memberSuccessRecords.filter { it.value }.keys - val updateTargetMemberRecords = items.filter { it.memberId in successMemberIds } + val updateTargetMemberRecords = items.filter { it.memberId in successMemberIds }.filterNot { it.memberId in receiveLastDayMemberIds } + val updateQueries = mutableListOf>() for (updateTargetMemberRecord in updateTargetMemberRecords) { updateQueries.add( diff --git a/batch/src/test/kotlin/com/few/batch/service/article/writer/WorkBookSubscriberWriterTest.kt b/batch/src/test/kotlin/com/few/batch/service/article/writer/WorkBookSubscriberWriterTest.kt index 35115b408..495120085 100644 --- a/batch/src/test/kotlin/com/few/batch/service/article/writer/WorkBookSubscriberWriterTest.kt +++ b/batch/src/test/kotlin/com/few/batch/service/article/writer/WorkBookSubscriberWriterTest.kt @@ -10,11 +10,13 @@ import jooq.jooq_dsl.tables.Subscription import org.jooq.DSLContext import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.mockito.Mockito.* import org.springframework.beans.factory.annotation.Autowired import kotlin.random.Random +@Disabled class WorkBookSubscriberWriterTest : BatchTestSpec() { @Autowired