Class WorkingDayService
java.lang.Object
fr.paris.lutece.plugins.appointment.service.WorkingDayService
Service class of a working day
- Author:
- Laurent Payen
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteListWorkingDay(List<WorkingDay> listWorkingDay) Delete a list of working daysstatic List<WorkingDay>findListWorkingDayByWeekDefinitionRule(int nIdWeekDefinitionRule) Find the working days of a week definitionstatic WorkingDayfindWorkingDayById(int nIdWorkingDay) Find a working day and set its time slotsstatic WorkingDayfindWorkingDayLightById(int nIdWorkingDay) Find a working day with its primary keystatic WorkingDaygenerateWorkingDay(int nIdReservationRule, DayOfWeek dayOfWeek) Create in database a working day object with the given parametersstatic voidgenerateWorkingDayAndListTimeSlot(int nIdReservationRule, DayOfWeek dayOfWeek, LocalTime startingTime, LocalTime endingTime, int nDuration, int nMaxCapacity) Create in database a working day and its time slotsstatic LocalTimegetMaxEndingTimeOfAListOfWorkingDay(List<WorkingDay> listWorkingDay) Get the max ending time of a list of working daysstatic LocalTimegetMaxEndingTimeOfAWorkingDay(WorkingDay workingDay) Get the max ending time of a working daystatic intgetMinDurationTimeSlotOfAListOfWorkingDay(List<WorkingDay> listWorkingDay) Get the min duration slot of a list of working daysstatic intgetMinDurationTimeSlotOfAWorkingDay(WorkingDay workingDay) Get the min duration slot of a working daystatic LocalTimegetMinStartingTimeOfAListOfWorkingDay(List<WorkingDay> listWorkingDay) Get the min starting time of a list of working daysstatic LocalTimegetMinStartingTimeOfAWorkingDay(WorkingDay workingDay) Get the min starting time of a working daygetOpenDays(AppointmentFormDTO appointmentForm) Get the open days of an appointmentForm DTOgetSetDaysOfWeekOfAListOfWorkingDayForFullCalendar(List<WorkingDay> listWorkingDay) Get all the day of week of working daysstatic WorkingDaygetWorkingDayOfDayOfWeek(List<WorkingDay> listWorkingDay, DayOfWeek dayOfWeek) Find the working day in a list of working day which matches the day of week givenstatic WorkingDaysaveWorkingDay(WorkingDay workingDay) Save a working day
-
Method Details
-
generateWorkingDay
Create in database a working day object with the given parameters- Parameters:
nIdReservationRule- the week rule IddayOfWeek- the day of week- Returns:
- the working day object built
-
saveWorkingDay
Save a working day- Parameters:
workingDay- the working day to save- Returns:
- the working day saved
-
generateWorkingDayAndListTimeSlot
public static void generateWorkingDayAndListTimeSlot(int nIdReservationRule, DayOfWeek dayOfWeek, LocalTime startingTime, LocalTime endingTime, int nDuration, int nMaxCapacity) Create in database a working day and its time slots- Parameters:
nIdReservationRule- the week rule IddayOfWeek- the day of week of the woking daystartingTime- the starting time of the working dayendingTime- the ending time of the working daynDuration- the duration of the time slot of the working daynMaxCapacity- the max capacity for the slots of the working day
-
getOpenDays
Get the open days of an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO- Returns:
- the list of day of week opened
-
findListWorkingDayByWeekDefinitionRule
Find the working days of a week definition- Parameters:
nIdWeekDefinition- the week definition Id- Returns:
- a list of the working days of the week definition
-
deleteListWorkingDay
Delete a list of working days- Parameters:
listWorkingDay- the list of working days to delete
-
findWorkingDayLightById
Find a working day with its primary key- Parameters:
nIdWorkingDay- the working day Id- Returns:
- the working day found
-
findWorkingDayById
Find a working day and set its time slots- Parameters:
nIdWorkingDay- the working day Id- Returns:
- the working day found with its time slots
-
getMaxEndingTimeOfAWorkingDay
Get the max ending time of a working day- Parameters:
workingDay- the working day- Returns:
- the max ending time of the working day
-
getMaxEndingTimeOfAListOfWorkingDay
Get the max ending time of a list of working days- Parameters:
listWorkingDay- the list of working days- Returns:
- the max ending time of the working days
-
getMinStartingTimeOfAWorkingDay
Get the min starting time of a working day- Parameters:
workingDay- the working day- Returns:
- the min starting time of the working day
-
getMinStartingTimeOfAListOfWorkingDay
Get the min starting time of a list of working days- Parameters:
listWorkingDay- the list of working days- Returns:
- the min starting time of the working days
-
getMinDurationTimeSlotOfAWorkingDay
Get the min duration slot of a working day- Parameters:
workingDay- the working day- Returns:
- the min duration slot of a working day
-
getMinDurationTimeSlotOfAListOfWorkingDay
Get the min duration slot of a list of working days- Parameters:
listWorkingDay- the list of working days- Returns:
- the min duration slot of the working days
-
getSetDaysOfWeekOfAListOfWorkingDayForFullCalendar
public static HashSet<String> getSetDaysOfWeekOfAListOfWorkingDayForFullCalendar(List<WorkingDay> listWorkingDay) Get all the day of week of working days- Parameters:
listWorkingDay- the list of working days- Returns:
- a set of day of week
-
getWorkingDayOfDayOfWeek
public static WorkingDay getWorkingDayOfDayOfWeek(List<WorkingDay> listWorkingDay, DayOfWeek dayOfWeek) Find the working day in a list of working day which matches the day of week given- Parameters:
listWorkingDay- the list of working daysdayOfWeek- the day of week to search- Returns:
- the working day that matches
-