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