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; }