Class AppointmentService


  • public final class AppointmentService
    extends Object
    Service class for an appointment
    Author:
    Laurent Payen
    • Method Detail

      • findListAppointmentByListSlot

        public static List<Appointment> findListAppointmentByListSlot​(List<Slot> listSlot)
        Find all the appointments of the slots given in parameter
        Parameters:
        listSlot - the list of slots
        Returns:
        a list of the appointments on these slots
      • findListAppointmentBySlot

        public static List<Appointment> findListAppointmentBySlot​(int nIdSlot)
        Find the appointments of a slot
        Parameters:
        nIdSlot - the slot Id
        Returns:
        the appointments of the slot
      • findListAppointmentByUserId

        public static List<Appointment> findListAppointmentByUserId​(int nIdUser)
        Find the appointments of a user
        Parameters:
        nIdUser - the user Id
        Returns:
        the appointment of the user
      • findListAppointmentByUserGuid

        public static List<Appointment> findListAppointmentByUserGuid​(String strGuidUser)
        Find the appointments of a user by guid
        Parameters:
        nIdUser - the user guid
        Returns:
        the appointment of the guid
      • findListAppointmentByIdForm

        public static List<Appointment> findListAppointmentByIdForm​(int nIdForm)
        Find the appointments by form
        Parameters:
        nIdForm - the form Id
        Returns:
        the appointments that matches the criteria
      • findAppointmentById

        public static Appointment findAppointmentById​(int nIdAppointment)
        Find an appointment by its primary key
        Parameters:
        nIdAppointment - the appointment Id
        Returns:
        the appointment
      • findAppointmentByReference

        public static Appointment findAppointmentByReference​(String strReference)
        Find an appointment by its reference
        Parameters:
        strReference - the appointment Reference
        Returns:
        the appointment
      • findListAppointmentsDTOByFilter

        public static List<AppointmentDTO> findListAppointmentsDTOByFilter​(AppointmentFilterDTO appointmentFilter)
        Find a list of appointments matching the filter
        Parameters:
        appointmentFilter - the filter
        Returns:
        a list of appointments
      • findAppointmentByMailAndCategory

        public static List<AppointmentDTO> findAppointmentByMailAndCategory​(int nIdCategory,
                                                                            String mail)
        Find a list of appointments by id category and mail
        Parameters:
        nIdCategory - the id category
        mail - the mail
        Returns:
        list of appointments
      • findListAppointmentsByFilter

        public static List<Appointment> findListAppointmentsByFilter​(AppointmentFilterDTO appointmentFilter)
        Find a list of appointments matching the filter
        Parameters:
        appointmentFilter -
        Returns:
        a list of appointments
      • findListAppointmentsIdsByFilter

        public static List<Integer> findListAppointmentsIdsByFilter​(AppointmentFilterDTO appointmentFilter)
        Find a list of appointments ids matching the filter
        Parameters:
        appointmentFilter - the filter
        Returns:
        a list of appointments
      • addAppointmentResponses

        public static void addAppointmentResponses​(AppointmentDTO appointmentDto)
        Fill the appointment data transfer object with complementary appointment responses
        Parameters:
        appointmentDto - The appointmentDTO object
      • deleteAppointment

        public static void deleteAppointment​(int nIdAppointment)
        Delete an appointment (and update the number of remaining places of the related slot)
        Parameters:
        nIdAppointment - the id of the appointment to delete
        Throws:
        Exception - the exception
      • buildAppointmentDTOFromIdAppointment

        public static AppointmentDTO buildAppointmentDTOFromIdAppointment​(int nIdAppointment)
        Build an appointment DTO from the id of an appointment business object
        Parameters:
        nIdAppointment - the id of the appointment
        Returns:
        the appointment DTO
      • buildAppointmentDTOFromRefAppointment

        public static AppointmentDTO buildAppointmentDTOFromRefAppointment​(String refAppointment)
        Build an appointment DTO from the reference of an appointment business object
        Parameters:
        refAppointment - the reference of the appointment
        Returns:
        the appointment DTO, or null if the appointment wasn't found
      • updateAppointmentDTO

        public static void updateAppointmentDTO​(int nIdappointment,
                                                User user,
                                                List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponse,
                                                boolean deleteBoOnly)
        Update an appointment DTO in database
        Parameters:
        nIdappointment - the id appointment
        user - the user
        listResponse - the listResponse
        deleteBoOnly - if the action is Bo only
      • updateAppointment

        public static void updateAppointment​(Appointment appointment)
        Update an appointment in database
        Parameters:
        appointment - the appointment to update
      • saveAppointment

        public static int saveAppointment​(AppointmentDTO appointmentDTO)
        Save an appointment in database
        Parameters:
        appointmentDTO - the appointment dto
        Returns:
        the id of the appointment saved
        Throws:
        Exception
      • saveAppointment

        public static int saveAppointment​(AppointmentDTO appointmentDTO,
                                          javax.servlet.http.HttpServletRequest request)
        Save an appointment in database
        Parameters:
        appointmentDTO - the appointment dto
        Returns:
        the id of the appointment saved
        Throws:
        Exception
      • buildListAppointmentSlot

        public static void buildListAppointmentSlot​(AppointmentDTO appointmentDTO)