Class ClosingDayService


  • public final class ClosingDayService
    extends Object
    Service class for the closing day
    Author:
    Laurent Payen
    • Method Detail

      • findListDateOfClosingDayByIdFormAndDateRange

        public static List<LocalDate> findListDateOfClosingDayByIdFormAndDateRange​(int nIdForm,
                                                                                   LocalDate startingDate,
                                                                                   LocalDate endingDate)
        Find all the closing dates of the form on a given period
        Parameters:
        nIdForm - the form Id
        startingDate - the starting date
        endingDate - the ending date
        Returns:
        a list of closing dates
      • findClosingDayByIdFormAndDateOfClosingDay

        public static ClosingDay findClosingDayByIdFormAndDateOfClosingDay​(int nIdForm,
                                                                           LocalDate dateOfClosingDay)
        Find, if it exists, the closing day of a form for a given date
        Parameters:
        nIdForm - the form Id
        date - the date
        Returns:
        the closing day, if it exists
      • findListDateOfClosingDayByIdForm

        public static List<LocalDate> findListDateOfClosingDayByIdForm​(int nIdForm)
        Find all the dates of the closing days of the form
        Parameters:
        nIdForm - the form Id
        Returns:
        the list of closing dates
      • findListClosingDay

        public static List<ClosingDay> findListClosingDay​(int nIdForm)
        Returns a list of the closing days of a form
        Parameters:
        nIdForm - the form id
        Returns:
        a list of the closing days of the form
      • saveListClosingDay

        public static void saveListClosingDay​(int nIdForm,
                                              List<LocalDate> listClosingDate)
        Save the closing days of a form
        Parameters:
        nIdForm - the form id
        listClosingDate - the closing dates to save
      • saveClosingDay

        public static void saveClosingDay​(int nIdForm,
                                          LocalDate closingDate)
        Save a closing day of a form
        Parameters:
        nIdForm - the form Id
        closingDate - the closing date
      • saveClosingDay

        public static void saveClosingDay​(ClosingDay closingDay)
        Save a closing day of a form
        Parameters:
        closingDay - the closing day to save
      • removeClosingDay

        public static void removeClosingDay​(ClosingDay closingDay)
        Remove a closing day
        Parameters:
        closingDay - the closing day to remove
      • getImportClosingDays

        public static List<LocalDate> getImportClosingDays​(org.apache.commons.fileupload.FileItem item)
                                                    throws IOException
        Import the closing dates of a given file
        Parameters:
        item - the file in input
        Returns:
        the list of the closing dates in the file
        Throws:
        IOException - if error during reading file