Class WorkingDayService
- java.lang.Object
-
- fr.paris.lutece.plugins.appointment.service.WorkingDayService
-
public final class WorkingDayService extends java.lang.ObjectService class of a working day- Author:
- Laurent Payen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteListWorkingDay(java.util.List<WorkingDay> listWorkingDay)Delete a list of working daysstatic java.util.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, java.time.DayOfWeek dayOfWeek)Create in database a working day object with the given parametersstatic voidgenerateWorkingDayAndListTimeSlot(int nIdReservationRule, java.time.DayOfWeek dayOfWeek, java.time.LocalTime startingTime, java.time.LocalTime endingTime, int nDuration, int nMaxCapacity)Create in database a working day and its time slotsstatic java.time.LocalTimegetMaxEndingTimeOfAListOfWorkingDay(java.util.List<WorkingDay> listWorkingDay)Get the max ending time of a list of working daysstatic java.time.LocalTimegetMaxEndingTimeOfAWorkingDay(WorkingDay workingDay)Get the max ending time of a working daystatic intgetMinDurationTimeSlotOfAListOfWorkingDay(java.util.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 java.time.LocalTimegetMinStartingTimeOfAListOfWorkingDay(java.util.List<WorkingDay> listWorkingDay)Get the min starting time of a list of working daysstatic java.time.LocalTimegetMinStartingTimeOfAWorkingDay(WorkingDay workingDay)Get the min starting time of a working daystatic java.util.List<java.time.DayOfWeek>getOpenDays(AppointmentFormDTO appointmentForm)Get the open days of an appointmentForm DTOstatic java.util.HashSet<java.lang.String>getSetDaysOfWeekOfAListOfWorkingDayForFullCalendar(java.util.List<WorkingDay> listWorkingDay)Get all the day of week of working daysstatic WorkingDaygetWorkingDayOfDayOfWeek(java.util.List<WorkingDay> listWorkingDay, java.time.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 Detail
-
generateWorkingDay
public static WorkingDay generateWorkingDay(int nIdReservationRule, java.time.DayOfWeek dayOfWeek)
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
public static WorkingDay saveWorkingDay(WorkingDay workingDay)
Save a working day- Parameters:
workingDay- the working day to save- Returns:
- the working day saved
-
generateWorkingDayAndListTimeSlot
public static void generateWorkingDayAndListTimeSlot(int nIdReservationRule, java.time.DayOfWeek dayOfWeek, java.time.LocalTime startingTime, java.time.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
public static java.util.List<java.time.DayOfWeek> getOpenDays(AppointmentFormDTO appointmentForm)
Get the open days of an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO- Returns:
- the list of day of week opened
-
findListWorkingDayByWeekDefinitionRule
public static java.util.List<WorkingDay> findListWorkingDayByWeekDefinitionRule(int nIdWeekDefinitionRule)
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
public static void deleteListWorkingDay(java.util.List<WorkingDay> listWorkingDay)
Delete a list of working days- Parameters:
listWorkingDay- the list of working days to delete
-
findWorkingDayLightById
public static WorkingDay findWorkingDayLightById(int nIdWorkingDay)
Find a working day with its primary key- Parameters:
nIdWorkingDay- the working day Id- Returns:
- the working day found
-
findWorkingDayById
public static WorkingDay findWorkingDayById(int nIdWorkingDay)
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
public static java.time.LocalTime getMaxEndingTimeOfAWorkingDay(WorkingDay workingDay)
Get the max ending time of a working day- Parameters:
workingDay- the working day- Returns:
- the max ending time of the working day
-
getMaxEndingTimeOfAListOfWorkingDay
public static java.time.LocalTime getMaxEndingTimeOfAListOfWorkingDay(java.util.List<WorkingDay> listWorkingDay)
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
public static java.time.LocalTime getMinStartingTimeOfAWorkingDay(WorkingDay workingDay)
Get the min starting time of a working day- Parameters:
workingDay- the working day- Returns:
- the min starting time of the working day
-
getMinStartingTimeOfAListOfWorkingDay
public static java.time.LocalTime getMinStartingTimeOfAListOfWorkingDay(java.util.List<WorkingDay> listWorkingDay)
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
public static int getMinDurationTimeSlotOfAWorkingDay(WorkingDay workingDay)
Get the min duration slot of a working day- Parameters:
workingDay- the working day- Returns:
- the min duration slot of a working day
-
getMinDurationTimeSlotOfAListOfWorkingDay
public static int getMinDurationTimeSlotOfAListOfWorkingDay(java.util.List<WorkingDay> listWorkingDay)
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 java.util.HashSet<java.lang.String> getSetDaysOfWeekOfAListOfWorkingDayForFullCalendar(java.util.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(java.util.List<WorkingDay> listWorkingDay, java.time.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
-
-