Package ru.bitel.bgbilling.server.util
Class ClosedDateChecker
java.lang.Object
ru.bitel.bgbilling.server.util.ClosedDateChecker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkDatesForDelete
(Calendar closedDate, LocalDate date) static void
checkDatesForDelete
(Calendar closedDate, Calendar dateFrom) Для любых сущностей.static void
checkDatesForDelete
(Calendar closedDate, Date date) static void
checkDatesForUpdate
(Calendar closedDate, LocalDate date, LocalDate newDate) static void
checkDatesForUpdate
(Calendar closedDate, Calendar date, Calendar newDate) Для сущностей с одной датой формированияstatic void
checkDatesForUpdate
(Calendar closedDate, Calendar dateFrom, Calendar dateTo, Calendar newDateFrom, Calendar newDateTo) Для сущностей с периодомstatic void
checkDatesForUpdate
(Calendar closedDate, Date date, Date newDate) static void
checkDatesForUpdate
(Calendar closedDate, Date dateFrom, Date dateTo, Date newDateFrom, Date newDateTo) getClosePeriodDate
(int typeId) static Calendar
getClosePeriodDateIfChecking
(String key, int mid, int userId) static ClosedDateChecker
void
setClosePeriodDate
(int typeId, Date dt)
-
Constructor Details
-
ClosedDateChecker
public ClosedDateChecker()
-
-
Method Details
-
getInstance
-
getClosePeriodDate
-
setClosePeriodDate
-
getClosePeriodDateIfChecking
-
checkDatesForDelete
public static void checkDatesForDelete(Calendar closedDate, Date date) throws ru.bitel.bgbilling.common.BGMessageException - Throws:
ru.bitel.bgbilling.common.BGMessageException
-
checkDatesForDelete
public static void checkDatesForDelete(Calendar closedDate, LocalDate date) throws ru.bitel.bgbilling.common.BGMessageException - Throws:
ru.bitel.bgbilling.common.BGMessageException
-
checkDatesForDelete
public static void checkDatesForDelete(Calendar closedDate, Calendar dateFrom) throws ru.bitel.bgbilling.common.BGMessageException Для любых сущностей. Для сущностей с периодом достаточна проверка лишь левой границы.- Parameters:
dateFrom
- левая граница- Throws:
ru.bitel.bgbilling.common.BGMessageException
- если изменение нельзя производить
-
checkDatesForUpdate
public static void checkDatesForUpdate(Calendar closedDate, Date dateFrom, Date dateTo, Date newDateFrom, Date newDateTo) throws ru.bitel.bgbilling.common.BGMessageException - Throws:
ru.bitel.bgbilling.common.BGMessageException
-
checkDatesForUpdate
public static void checkDatesForUpdate(Calendar closedDate, Date date, Date newDate) throws ru.bitel.bgbilling.common.BGMessageException - Throws:
ru.bitel.bgbilling.common.BGMessageException
-
checkDatesForUpdate
public static void checkDatesForUpdate(Calendar closedDate, LocalDate date, LocalDate newDate) throws ru.bitel.bgbilling.common.BGMessageException - Throws:
ru.bitel.bgbilling.common.BGMessageException
-
checkDatesForUpdate
public static void checkDatesForUpdate(Calendar closedDate, Calendar dateFrom, Calendar dateTo, Calendar newDateFrom, Calendar newDateTo) throws ru.bitel.bgbilling.common.BGMessageException Для сущностей с периодом- Parameters:
dateFrom
- старая левая датаdateTo
- старая права датаnewDateFrom
- новая левая датаnewDateTo
- новая права дата- Throws:
ru.bitel.bgbilling.common.BGMessageException
- если изменение нельзя производить
-
checkDatesForUpdate
public static void checkDatesForUpdate(Calendar closedDate, Calendar date, Calendar newDate) throws ru.bitel.bgbilling.common.BGMessageException Для сущностей с одной датой формирования- Parameters:
date
-newDate
-- Throws:
ru.bitel.bgbilling.common.BGMessageException
-