保誠-保戶業務員媒合平台
wayne
2021-11-19 205ae77062d62f785196e351b747188e6ea61506
pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java
@@ -22,23 +22,22 @@
@Service
@Transactional
public class AppointmentService {
   @Autowired
   AppointmentRepository appointmentRepository;
   @Autowired
   AppointmentDTOMapper appointmentDTOMapper;
   @Autowired
   ConsultantService consultantService;
   @Autowired
   AppointmentCustomerViewMapper appointmentCustomerViewMapper;
   @Autowired
   AppointmentCustomerViewRepository appointmentCustomerViewRepository;
   public void customerCreateAppointment(AppointmentCreateDTO appointmentCreateDTO) {
      Appointment appointment = appointmentDTOMapper.toAppointment(appointmentCreateDTO);
      appointment.setCustomerId(SecurityUtils.getCustomerId());
@@ -46,14 +45,13 @@
      appointmentRepository.save(appointment);
   }
   public List<Appointment> findByAgentNo(String agentNo) {
      return appointmentRepository.findByAgentNo(agentNo);
   }
   public void markAsContacted(Long appointmentId) {
      Appointment appointment = appointmentRepository.getById(appointmentId);
      Appointment appointment = appointmentRepository.findById(appointmentId).get();
      appointment.setCommunicateStatus(ContactStatusEnum.CONTACTED);
      appointmentRepository.save(appointment);
   }
@@ -64,5 +62,9 @@
            .orElseThrow(AppointmentNotFoundException::new);
      return appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointment);
   }
    public List<Appointment> findByAgentNoAndCustomerId(String agentNo, Long customerId) {
        return appointmentRepository.findByAgentNoAndCustomerId(agentNo, customerId);
    }
}