Class WorkingDayService
- java.lang.Object
-
- fr.paris.lutece.plugins.appointment.service.WorkingDayService
-
public final class WorkingDayService extends Object
Service class of a working day- Author:
- Laurent Payen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 daystatic List<DayOfWeek>getOpenDays(AppointmentFormDTO appointmentForm)Get the open days of an appointmentForm DTOstatic HashSet<String>getSetDaysOfWeekOfAListOfWorkingDayForFullCalendar(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 Detail
-
generateWorkingDay
public static WorkingDay generateWorkingDay(int nIdReservationRule, 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, 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
public static List<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 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(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 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 LocalTime getMaxEndingTimeOfAListOfWorkingDay(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 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 LocalTime getMinStartingTimeOfAListOfWorkingDay(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(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 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
-
-