public class AppointmentService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BEAN_NAME
Name of the bean of the service
|
| Constructor and Description |
|---|
AppointmentService() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkFormDays(AppointmentForm form)
Check that a form has every days created for its coming weeks
|
List<AppointmentDay> |
computeDayList(AppointmentForm form)
Compute the list of days with the list of slots for a given form and a
given week.
|
List<AppointmentSlot> |
computeDaySlots(AppointmentDay day)
Get the list of appointment slots for a given day
|
List<AppointmentSlot> |
computeDaySlots(AppointmentDay day,
int nDayOfWeek)
Get the list of appointment slots for a given day
|
String |
computeRefAppointment(Appointment appointment)
Compute the unique reference of an appointment
|
List<AppointmentDay> |
findAndComputeDayList(AppointmentForm form,
int nOffsetWeeks,
boolean bLoadSlotsFromDb)
Find a list of days with the list of slots for a given form and a given
week, and compute missing data.
|
List<AppointmentDay> |
getAllAvailableDays(AppointmentForm form)
Get the list of every days between the current day and the last day of
the form open for appointments.
|
AppointmentDay |
getAppointmentDayFromForm(AppointmentForm appointmentForm)
Get an appointment day from an appointment form.
|
static long |
getDateDiff(Date date1,
Date date2)
Compute dateDiff
|
Date |
getDateLastMonday()
Get the date of the last Monday.
|
Date |
getDateMonday(int nOffsetWeek)
Get the date of a Monday.
|
List<AppointmentDay> |
getDayListForCalendar(AppointmentForm form,
org.apache.commons.lang.mutable.MutableInt nOffsetWeeks,
boolean bIsForFront,
boolean bGetFirstEmptyWeek)
Get the list of days of a form to display them in a calendar.
|
int |
getDayOfWeek(Date date)
Get the day of the week of a date.
|
String |
getFormatedStringTime(int nHour,
int nMinute)
Get a string that describe a given time
|
List<String> |
getListAppointmentTimes(int nAppointmentDuration,
int nOpeningHour,
int nOpeningMinutes,
int nClosingHour,
int nClosingMinutes)
Get a list of string that describes times of appointments available for a
day
|
static String[] |
getListDaysOfWeek()
Get a string array containing a list of i118n keys of days of week
|
int |
getListTimeBegin(List<AppointmentDay> listDays,
AppointmentForm form,
List<String> listTimeBegin)
Get the minimum appointment duration in a list of days for a given form,
and add the list of begin time in a given list
|
int |
getRefSizeRandomPart()
Get the size of the random part of the reference of appointments
|
static AppointmentService |
getService()
Get an instance of the service
|
void |
modifySlotsDays(AppointmentForm form,
Date dateMin)
Modify the slots of a form
|
void |
notifyAppointmentFormModified(int nAppointmentFormId)
Notify listeners, for example indexers
|
int |
parseInt(String strNumber)
Parse a string representing a positive or negative integer
|
void |
resetFormDays(AppointmentForm form)
Reset days and slots of a form.
|
void |
resetFormDays(AppointmentForm form,
Date dateMin)
Reset days and slots of a form.
|
public static final String BEAN_NAME
public static AppointmentService getService()
public static String[] getListDaysOfWeek()
public List<AppointmentDay> computeDayList(AppointmentForm form)
form - The form to get days of. Opening and closing hour of the form
are updated by this methodpublic List<AppointmentDay> findAndComputeDayList(AppointmentForm form, int nOffsetWeeks, boolean bLoadSlotsFromDb)
form - The form to get days of. Opening and closing hour of the form
are updated by this methodnOffsetWeeks - The offset of the week to getbLoadSlotsFromDb - True if slots should be loaded from the database,
false if they should be computedpublic static long getDateDiff(Date date1, Date date2)
date1 - first datedate2 - second datepublic List<AppointmentDay> getDayListForCalendar(AppointmentForm form, org.apache.commons.lang.mutable.MutableInt nOffsetWeeks, boolean bIsForFront, boolean bGetFirstEmptyWeek)
form - The form the get days of.nOffsetWeeks - The offset of weeks (0 for the current week, 1 for
the next, ...). If the parameter bGetFirstEmptyWeek is set to
true, then the value of this parameter will be updated with
the offset of the loaded weekbIsForFront - True if the calendar is for Front Office, false if it
is for Back Office. If the calendar is for Front Office, then
the n next days will be closed (n is set by the
AppointmentForm.getMinDaysBeforeAppointment()
attribute).bGetFirstEmptyWeek - True to automatically load the first week with
an available slot, false to load the required weekpublic List<AppointmentDay> getAllAvailableDays(AppointmentForm form)
form - The formpublic List<AppointmentSlot> computeDaySlots(AppointmentDay day)
day - the day to initializepublic List<AppointmentSlot> computeDaySlots(AppointmentDay day, int nDayOfWeek)
day - the day to initialize. The date of the day will NOT be usednDayOfWeek - The day of the week of the daypublic List<String> getListAppointmentTimes(int nAppointmentDuration, int nOpeningHour, int nOpeningMinutes, int nClosingHour, int nClosingMinutes)
nAppointmentDuration - The appointment durationnOpeningHour - The opening hour of the daynOpeningMinutes - The opening minutes of the daynClosingHour - The closing hour of the daynClosingMinutes - The closing minutes of the daypublic String getFormatedStringTime(int nHour, int nMinute)
nHour - The hour of the time to describenMinute - The minute of the time to describepublic AppointmentDay getAppointmentDayFromForm(AppointmentForm appointmentForm)
appointmentForm - The formpublic int getDayOfWeek(Date date)
date - The date to get the day of the week ofpublic void checkFormDays(AppointmentForm form)
form - The form to checkpublic Date getDateLastMonday()
public Date getDateMonday(int nOffsetWeek)
nOffsetWeek - The offset of the week (0 for the current week, 1 for
the next one, ...)public void resetFormDays(AppointmentForm form)
form - The form to rest days ofpublic int getListTimeBegin(List<AppointmentDay> listDays, AppointmentForm form, List<String> listTimeBegin)
listDays - The list of days to considerform - The form associated with the given dayslistTimeBegin - The list to insert begin times inpublic int getRefSizeRandomPart()
public String computeRefAppointment(Appointment appointment)
appointment - The appointmentpublic int parseInt(String strNumber)
strNumber - The string to parsepublic void resetFormDays(AppointmentForm form, Date dateMin)
form - The form to rest days ofpublic void modifySlotsDays(AppointmentForm form, Date dateMin)
form - The form to rest days ofdateMin - the date after that the form will changepublic void notifyAppointmentFormModified(int nAppointmentFormId)
nAppointmentFormId - The slot idCopyright © 2016 City of Paris. All rights reserved.