保誠-保戶業務員媒合平台
Jack
2022-01-24 f8ab133a7dc20562c25a092a402266f5e7b0b296
pamapi/src/main/java/com/pollex/pam/service/SatisfactionService.java
@@ -40,13 +40,13 @@
   @Autowired
   CustomerRepository customerRepository;
   @Autowired
   ConsultantRepository consultantRepository;
   @Autowired
   ConsultantService consultantService;
   @Autowired
   PersonalNotificationService personalNotificationService;
@@ -55,7 +55,7 @@
      consultantService.setConsultantAvgScore(satisfaction);
      return satisfaction;
   }
   public Satisfaction scorefaction(SatisfactionCustomerScoreDTO scoreDTO) {
      Optional<Satisfaction> satisfactionOP = getByAppointmentId(scoreDTO.getAppointmentId());
      Satisfaction satisfaction = satisfactionOP.orElseThrow(SatisfactionNotFoundException::new);
@@ -65,7 +65,7 @@
      personalNotificationService.createScorefactionToConsultant(satisfaction);
      return satisfaction;
   }
   public Satisfaction createSatisfaction(Appointment appointment) {
      boolean isexist = getByAppointmentId(appointment.getId()).isPresent();
      if(isexist) {
@@ -94,6 +94,10 @@
        return satisfactionRepository.findOneByAppointmentId(appointmentId);
    }
    public List<Satisfaction> getByStatus(SatisfactionStatusEnum status) {
        return satisfactionRepository.findAllByStatus(status);
    }
   public List<Satisfaction> scoreAllfaction(List<SatisfactionCustomerScoreDTO> scoreDTO) {
      List<Satisfaction> satisfactionList = new ArrayList<>();
      scoreDTO.stream().forEach(dto ->{