fix: 서비스 클래스 NotificationPublisher/NotificationEvent import 누락 수정 (컴파일 에러 해결)

This commit is contained in:
pray4skylark
2026-10-02 12:58:18 +09:00
parent 0b5eca1f7e
commit 54620ff5a0
3 changed files with 15 additions and 8 deletions
@@ -1,11 +1,14 @@
package com.srsystem.service; package com.srsystem.service;
import com.srsystem.dto.CreateDispatchRequest; import com.srsystem.dto.CreateDispatchRequest;
import com.srsystem.dto.NotificationEvent;
import com.srsystem.entity.DispatchHistory; import com.srsystem.entity.DispatchHistory;
import com.srsystem.entity.Employee; import com.srsystem.entity.Employee;
import com.srsystem.entity.Project; import com.srsystem.entity.Project;
import com.srsystem.entity.enums.DispatchStatus;
import com.srsystem.exception.BusinessException; import com.srsystem.exception.BusinessException;
import com.srsystem.exception.ErrorCode; import com.srsystem.exception.ErrorCode;
import com.srsystem.listener.NotificationPublisher;
import com.srsystem.repository.DispatchHistoryRepository; import com.srsystem.repository.DispatchHistoryRepository;
import com.srsystem.repository.EmployeeRepository; import com.srsystem.repository.EmployeeRepository;
import com.srsystem.repository.ProjectRepository; import com.srsystem.repository.ProjectRepository;
@@ -82,11 +85,11 @@ public class DispatchHistoryService {
DispatchHistory saved = dispatchHistoryRepository.save(history); DispatchHistory saved = dispatchHistoryRepository.save(history);
// Update employee dispatch status to DISPATCHED // Update employee dispatch status to DISPATCHED
employee.setDispatchStatus(com.srsystem.entity.enums.DispatchStatus.DISPATCHED); employee.setDispatchStatus(DispatchStatus.DISPATCHED);
employeeRepository.save(employee); employeeRepository.save(employee);
// Send notification // Send notification
notificationPublisher.publish(new com.srsystem.dto.NotificationEvent( notificationPublisher.publish(new NotificationEvent(
"DISPATCH_ASSIGNED", "DISPATCH_ASSIGNED",
"신규 파견 발령: " + project.getProjectName(), "신규 파견 발령: " + project.getProjectName(),
String.format("'%s' 프로젝트에 %s 역할로 파견 등록되었습니다.", project.getProjectName(), request.roleTitle()), String.format("'%s' 프로젝트에 %s 역할로 파견 등록되었습니다.", project.getProjectName(), request.roleTitle()),
@@ -108,7 +111,7 @@ public class DispatchHistoryService {
List<DispatchHistory> active = dispatchHistoryRepository.findByEmployee_EmpIdAndEndDateIsNull(history.getEmployee().getEmpId()); List<DispatchHistory> active = dispatchHistoryRepository.findByEmployee_EmpIdAndEndDateIsNull(history.getEmployee().getEmpId());
if (active.isEmpty()) { if (active.isEmpty()) {
Employee emp = history.getEmployee(); Employee emp = history.getEmployee();
emp.setDispatchStatus(com.srsystem.entity.enums.DispatchStatus.WAITING); emp.setDispatchStatus(DispatchStatus.WAITING);
employeeRepository.save(emp); employeeRepository.save(emp);
} }
@@ -16,6 +16,8 @@ import com.srsystem.entity.enums.ReportType;
import com.srsystem.entity.enums.TicketStatus; import com.srsystem.entity.enums.TicketStatus;
import com.srsystem.exception.BusinessException; import com.srsystem.exception.BusinessException;
import com.srsystem.exception.ErrorCode; import com.srsystem.exception.ErrorCode;
import com.srsystem.dto.NotificationEvent;
import com.srsystem.listener.NotificationPublisher;
import com.srsystem.repository.DispatchHistoryRepository; import com.srsystem.repository.DispatchHistoryRepository;
import com.srsystem.repository.EmployeeRepository; import com.srsystem.repository.EmployeeRepository;
import com.srsystem.repository.NotificationRepository; import com.srsystem.repository.NotificationRepository;
@@ -47,7 +49,7 @@ public class ReportService {
private final TicketRepository ticketRepository; private final TicketRepository ticketRepository;
private final NotificationRepository notificationRepository; private final NotificationRepository notificationRepository;
private final WeeklyPlanRepository weeklyPlanRepository; private final WeeklyPlanRepository weeklyPlanRepository;
private final com.srsystem.listener.NotificationPublisher notificationPublisher; private final NotificationPublisher notificationPublisher;
public Page<WorkReportResponse> getReports(ReportStatus status, String type, LocalDate targetDate, Long userId, Pageable pageable) { public Page<WorkReportResponse> getReports(ReportStatus status, String type, LocalDate targetDate, Long userId, Pageable pageable) {
Page<Report> reports; Page<Report> reports;
@@ -168,7 +170,7 @@ public class ReportService {
? String.format("%s 일자 보고서가 승인되었습니다.", report.getTargetDate()) ? String.format("%s 일자 보고서가 승인되었습니다.", report.getTargetDate())
: String.format("%s 일자 보고서가 반려되었습니다. 사유: %s", report.getTargetDate(), request.reviewComment()); : String.format("%s 일자 보고서가 반려되었습니다. 사유: %s", report.getTargetDate(), request.reviewComment());
notificationPublisher.publish(new com.srsystem.dto.NotificationEvent( notificationPublisher.publish(new NotificationEvent(
type, type,
title, title,
message, message,
@@ -11,6 +11,8 @@ import com.srsystem.entity.TicketComment;
import com.srsystem.entity.enums.TicketStatus; import com.srsystem.entity.enums.TicketStatus;
import com.srsystem.exception.BusinessException; import com.srsystem.exception.BusinessException;
import com.srsystem.exception.ErrorCode; import com.srsystem.exception.ErrorCode;
import com.srsystem.dto.NotificationEvent;
import com.srsystem.listener.NotificationPublisher;
import com.srsystem.repository.EmployeeRepository; import com.srsystem.repository.EmployeeRepository;
import com.srsystem.repository.ProjectRepository; import com.srsystem.repository.ProjectRepository;
import com.srsystem.repository.TicketCommentRepository; import com.srsystem.repository.TicketCommentRepository;
@@ -33,7 +35,7 @@ public class TicketService {
private final TicketCommentRepository ticketCommentRepository; private final TicketCommentRepository ticketCommentRepository;
private final EmployeeRepository employeeRepository; private final EmployeeRepository employeeRepository;
private final ProjectRepository projectRepository; private final ProjectRepository projectRepository;
private final com.srsystem.listener.NotificationPublisher notificationPublisher; private final NotificationPublisher notificationPublisher;
public Page<IssueTicket> getTickets(TicketStatus status, String category, String priority, String keyword, Pageable pageable, Long requesterId) { public Page<IssueTicket> getTickets(TicketStatus status, String category, String priority, String keyword, Pageable pageable, Long requesterId) {
Page<Ticket> tickets; Page<Ticket> tickets;
@@ -135,7 +137,7 @@ public class TicketService {
Ticket updated = ticketRepository.save(ticket); Ticket updated = ticketRepository.save(ticket);
// Send notification to assignee // Send notification to assignee
notificationPublisher.publish(new com.srsystem.dto.NotificationEvent( notificationPublisher.publish(new NotificationEvent(
"TICKET_ASSIGNED", "TICKET_ASSIGNED",
"SR 티켓 담당 지정: #" + updated.getTicketId(), "SR 티켓 담당 지정: #" + updated.getTicketId(),
String.format("'%s' 티켓 담당자로 지정되었습니다.", updated.getTitle()), String.format("'%s' 티켓 담당자로 지정되었습니다.", updated.getTitle()),
@@ -163,7 +165,7 @@ public class TicketService {
// Send notification to requester // Send notification to requester
if (updated.getRequester() != null) { if (updated.getRequester() != null) {
notificationPublisher.publish(new com.srsystem.dto.NotificationEvent( notificationPublisher.publish(new NotificationEvent(
"TICKET_RESOLVED", "TICKET_RESOLVED",
"SR 티켓 처리 완료: #" + updated.getTicketId(), "SR 티켓 처리 완료: #" + updated.getTicketId(),
String.format("요청하신 '%s' 티켓이 처리 완료되었습니다.", updated.getTitle()), String.format("요청하신 '%s' 티켓이 처리 완료되었습니다.", updated.getTitle()),