From 3fd6ce04e2e457a3515c8cc6982d96e9f712ca14 Mon Sep 17 00:00:00 2001 From: mikekks Date: Fri, 13 Sep 2024 01:56:42 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20=EB=A7=88=EA=B0=90=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layer/domain/answer/service/AnswerService.java | 11 +++++++---- .../domain/retrospect/service/RetrospectService.java | 2 +- .../layer/batch/scheduler/RetrospectScheduler.java | 2 +- .../layer/domain/retrospect/entity/Retrospect.java | 6 +----- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java b/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java index 8784cebb..b171bb2a 100644 --- a/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java +++ b/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java @@ -100,11 +100,14 @@ public void create(AnswerListCreateRequest request, Long spaceId, Long retrospec Answers answers = new Answers(answerRepository.findAllByRetrospectId(retrospectId)); - // 마지막 답변이고, 마감일이 지정되지 않은 경우 -> ai 분석 실행 - if (answers.getWriteCount(retrospectId) == team.getTeamMemberCount() && !retrospect.hasDeadLine()){ - retrospect.updateRetrospectStatus(RetrospectStatus.DONE, time.now()); + // 마지막 답변인 경우 -> ai 분석 실행 + if (answers.getWriteCount(retrospectId) == team.getTeamMemberCount()){ retrospect.updateAnalysisStatus(AnalysisStatus.PROCEEDING); - retrospectRepository.saveAndFlush(retrospect); + + if(!retrospect.hasDeadLine()){ + retrospect.updateRetrospectStatus(RetrospectStatus.DONE); + } + retrospectRepository.saveAndFlush(retrospect); aiAnalyzeService.createAnalyze(spaceId, retrospectId, answers.getWriteMemberIds()); } diff --git a/layer-api/src/main/java/org/layer/domain/retrospect/service/RetrospectService.java b/layer-api/src/main/java/org/layer/domain/retrospect/service/RetrospectService.java index 0bded069..d1c6ed1e 100644 --- a/layer-api/src/main/java/org/layer/domain/retrospect/service/RetrospectService.java +++ b/layer-api/src/main/java/org/layer/domain/retrospect/service/RetrospectService.java @@ -178,7 +178,7 @@ public void closeRetrospect(Long spaceId, Long retrospectId, Long memberId) { Retrospect retrospect = retrospectRepository.findByIdOrThrow(retrospectId); - retrospect.updateRetrospectStatus(RetrospectStatus.DONE, time.now()); + retrospect.updateRetrospectStatus(RetrospectStatus.DONE); retrospect.updateAnalysisStatus(AnalysisStatus.PROCEEDING); retrospectRepository.saveAndFlush(retrospect); diff --git a/layer-batch/src/main/java/org/layer/batch/scheduler/RetrospectScheduler.java b/layer-batch/src/main/java/org/layer/batch/scheduler/RetrospectScheduler.java index 7145cbe0..9280f083 100644 --- a/layer-batch/src/main/java/org/layer/batch/scheduler/RetrospectScheduler.java +++ b/layer-batch/src/main/java/org/layer/batch/scheduler/RetrospectScheduler.java @@ -43,7 +43,7 @@ public void updateRetrospectStatusToDone() { Map retrospectMap = retrospects.stream() .collect(Collectors.toMap(Retrospect::getId, retrospect -> retrospect)); - retrospects.forEach(retrospect -> retrospect.updateRetrospectStatus(RetrospectStatus.DONE, now)); + retrospects.forEach(retrospect -> retrospect.updateRetrospectStatus(RetrospectStatus.DONE)); retrospectRepository.saveAllAndFlush(retrospects); List retrospectIds = retrospects.stream().map(Retrospect::getId).toList(); diff --git a/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java b/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java index 14b15d81..c4cebf1b 100644 --- a/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java +++ b/layer-domain/src/main/java/org/layer/domain/retrospect/entity/Retrospect.java @@ -87,13 +87,9 @@ public void updateRetrospect(String title, String introduction, LocalDateTime de this.deadline = deadline; } - public void updateRetrospectStatus(RetrospectStatus retrospectStatus, LocalDateTime now) { + public void updateRetrospectStatus(RetrospectStatus retrospectStatus) { isProceedingRetrospect(); - if (this.deadline != null && now.isBefore(this.deadline)) { - return; - } - this.retrospectStatus = retrospectStatus; }