diff --git a/src/main/kotlin/goodspace/bllsoneshot/mentor/controller/MentorDashboardController.kt b/src/main/kotlin/goodspace/bllsoneshot/mentor/controller/MentorDashboardController.kt index e2e4fe3..80e3975 100644 --- a/src/main/kotlin/goodspace/bllsoneshot/mentor/controller/MentorDashboardController.kt +++ b/src/main/kotlin/goodspace/bllsoneshot/mentor/controller/MentorDashboardController.kt @@ -54,7 +54,7 @@ class MentorDashboardController( summary = "학습 미이행(업로드 미제출) 멘티 전체 조회", description = """ 멘토가 담당하는 멘티 중, - 오늘에 해당하는 과제는 존재하지만 인증 사진을 아직 업로드하지 않은 멘티를 조회합니다. + 오늘에 해당하는 과제는 존재하지만 아직 완료하지 않은 멘티를 조회합니다. [요청] date: 기준 날짜(yyyy-MM-dd) @@ -70,7 +70,7 @@ class MentorDashboardController( @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) date: LocalDate ): ResponseEntity { val mentorId = principal.userId - val response = mentorDashboardService.getTaskUnfinishedMentees(mentorId, date) + val response = mentorDashboardService.getTaskIncompletedMentees(mentorId, date) return ResponseEntity.ok(response) } diff --git a/src/main/kotlin/goodspace/bllsoneshot/mentor/service/MentorDashboardService.kt b/src/main/kotlin/goodspace/bllsoneshot/mentor/service/MentorDashboardService.kt index d44fd2f..c824be4 100644 --- a/src/main/kotlin/goodspace/bllsoneshot/mentor/service/MentorDashboardService.kt +++ b/src/main/kotlin/goodspace/bllsoneshot/mentor/service/MentorDashboardService.kt @@ -40,7 +40,7 @@ class MentorDashboardService( } @Transactional(readOnly = true) - fun getTaskUnfinishedMentees( + fun getTaskIncompletedMentees( mentorId: Long, date: LocalDate ): TaskUnfinishedSummaryResponse { @@ -48,7 +48,7 @@ class MentorDashboardService( .orElseThrow { IllegalArgumentException(USER_NOT_FOUND.message) } val taskCount = taskRepository.countUnfinishedTasks(mentorId, date) - val mentees = taskRepository.findTaskUnfinishedMentees( + val mentees = taskRepository.findTaskIncompletedMentees( mentorId = mentorId, date = date ) diff --git a/src/main/kotlin/goodspace/bllsoneshot/notification/dto/response/NotificationResponse.kt b/src/main/kotlin/goodspace/bllsoneshot/notification/dto/response/NotificationResponse.kt index 2071477..880f40b 100644 --- a/src/main/kotlin/goodspace/bllsoneshot/notification/dto/response/NotificationResponse.kt +++ b/src/main/kotlin/goodspace/bllsoneshot/notification/dto/response/NotificationResponse.kt @@ -2,6 +2,7 @@ package goodspace.bllsoneshot.notification.dto.response import goodspace.bllsoneshot.entity.assignment.NotificationStatus import goodspace.bllsoneshot.entity.assignment.NotificationType +import goodspace.bllsoneshot.entity.assignment.Subject import java.time.LocalDate import java.time.LocalDateTime @@ -12,6 +13,8 @@ data class NotificationResponse( val message: String, val status: NotificationStatus, val taskId: Long?, + val taskSubject: Subject?, + val taskName: String?, val learningReportId: Long?, val learningReportStartDate: LocalDate?, val learningReportEndDate: LocalDate?, diff --git a/src/main/kotlin/goodspace/bllsoneshot/notification/mapper/NotificationMapper.kt b/src/main/kotlin/goodspace/bllsoneshot/notification/mapper/NotificationMapper.kt index 0fea7e8..221ff9a 100644 --- a/src/main/kotlin/goodspace/bllsoneshot/notification/mapper/NotificationMapper.kt +++ b/src/main/kotlin/goodspace/bllsoneshot/notification/mapper/NotificationMapper.kt @@ -15,6 +15,8 @@ class NotificationMapper { message = notification.message, status = notification.status, taskId = notification.task?.id, + taskSubject = notification.task?.subject, + taskName = notification.task?.name, learningReportId = notification.learningReport?.id, learningReportStartDate = notification.learningReport?.startDate, learningReportEndDate = notification.learningReport?.endDate, diff --git a/src/main/kotlin/goodspace/bllsoneshot/repository/task/TaskRepository.kt b/src/main/kotlin/goodspace/bllsoneshot/repository/task/TaskRepository.kt index 80c54b3..07b8c12 100644 --- a/src/main/kotlin/goodspace/bllsoneshot/repository/task/TaskRepository.kt +++ b/src/main/kotlin/goodspace/bllsoneshot/repository/task/TaskRepository.kt @@ -120,15 +120,14 @@ interface TaskRepository : JpaRepository { ) FROM Task t JOIN t.mentee m - LEFT JOIN t.proofShots ps WHERE m.mentor.id = :mentorId AND t.date = :date AND t.isResource = false - AND ps.id IS NULL + AND t.completed = false ORDER BY m.name """ ) - fun findTaskUnfinishedMentees( + fun findTaskIncompletedMentees( mentorId: Long, date: LocalDate ): List @@ -137,11 +136,10 @@ interface TaskRepository : JpaRepository { """ SELECT COUNT(DISTINCT t.id) FROM Task t - LEFT JOIN t.proofShots ps WHERE t.mentee.mentor.id = :mentorId AND t.date = :date AND t.isResource = false - AND ps.id IS NULL + AND t.completed = false """ ) fun countUnfinishedTasks(mentorId: Long, date: LocalDate): Long