|
@@ -6,10 +6,12 @@ import com.yimeng.okr.dto.ScoringDto;
|
|
|
import com.yimeng.okr.entity.PerformanceFeedback;
|
|
import com.yimeng.okr.entity.PerformanceFeedback;
|
|
|
import com.yimeng.okr.entity.PerformanceScore;
|
|
import com.yimeng.okr.entity.PerformanceScore;
|
|
|
import com.yimeng.okr.enums.ScoreType;
|
|
import com.yimeng.okr.enums.ScoreType;
|
|
|
|
|
+import com.yimeng.okr.event.NotificationEvent;
|
|
|
import com.yimeng.okr.exception.BusinessException;
|
|
import com.yimeng.okr.exception.BusinessException;
|
|
|
import com.yimeng.okr.mapper.PerformanceFeedbackMapper;
|
|
import com.yimeng.okr.mapper.PerformanceFeedbackMapper;
|
|
|
import com.yimeng.okr.mapper.PerformanceScoreMapper;
|
|
import com.yimeng.okr.mapper.PerformanceScoreMapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
@@ -23,6 +25,7 @@ public class FeedbackService {
|
|
|
private final PerformanceScoreMapper scoreMapper;
|
|
private final PerformanceScoreMapper scoreMapper;
|
|
|
private final OkrService okrService;
|
|
private final OkrService okrService;
|
|
|
private final PerformanceService performanceService;
|
|
private final PerformanceService performanceService;
|
|
|
|
|
+ private final ApplicationEventPublisher publisher;
|
|
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public PerformanceFeedback saveInterviewNotes(Long periodId, Long userId, Long superiorId,
|
|
public PerformanceFeedback saveInterviewNotes(Long periodId, Long userId, Long superiorId,
|
|
@@ -38,6 +41,10 @@ public class FeedbackService {
|
|
|
existing.setIssues(issues);
|
|
existing.setIssues(issues);
|
|
|
existing.setImprovements(improvements);
|
|
existing.setImprovements(improvements);
|
|
|
feedbackMapper.updateById(existing);
|
|
feedbackMapper.updateById(existing);
|
|
|
|
|
+ publisher.publishEvent(new NotificationEvent(
|
|
|
|
|
+ this, userId, "FEEDBACK_NOTIFY",
|
|
|
|
|
+ "绩效面谈通知", "你的上级发起了绩效面谈,请查看并回复",
|
|
|
|
|
+ "feedback", existing.getId()));
|
|
|
return existing;
|
|
return existing;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -50,6 +57,10 @@ public class FeedbackService {
|
|
|
fb.setIssues(issues);
|
|
fb.setIssues(issues);
|
|
|
fb.setImprovements(improvements);
|
|
fb.setImprovements(improvements);
|
|
|
feedbackMapper.insert(fb);
|
|
feedbackMapper.insert(fb);
|
|
|
|
|
+ publisher.publishEvent(new NotificationEvent(
|
|
|
|
|
+ this, userId, "FEEDBACK_NOTIFY",
|
|
|
|
|
+ "绩效面谈通知", "你的上级发起了绩效面谈,请查看并回复",
|
|
|
|
|
+ "feedback", fb.getId()));
|
|
|
return fb;
|
|
return fb;
|
|
|
}
|
|
}
|
|
|
|
|
|