Class ContractManager
java.lang.Object
bitel.billing.server.contract.bean.ContractManager
- All Implemented Interfaces:
AutoCloseable,ru.bitel.common.worker.Recyclable
public class ContractManager
extends Object
implements ru.bitel.common.worker.Recyclable, AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContractGroup(int cid, int groupId) Привязываем договор к группе.booleancheckContractService(int contractId, int serviceId, Date date) Проверка наличия на договоре услуги на указанную датуvoidclose()voiddeleteContractGroup(int cid, long groupId) Удаляем договор из группы.getContractById(int contractId) Возвращает договор по его кодуgetContractByTitle(String title) Deprecated.Возвращает Map содержащий коды групп параметров договоров и кол-ва договоров в каждой из них ("SELECT pgid, COUNT(*) FROM contract GROUP BY pgid")ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSetgetRealtimeTariffTreeSet(int cid, Calendar time, String module, int mid, boolean useChache) Deprecated.ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSetgetRealtimeTariffTreeSet(int cid, Calendar time, String module, int mid, int emid, int eid, boolean useChache) Deprecated.ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSetgetRealtimeTariffTreeSet(int cid, Date date, String module, int mid, boolean useChache) Создает TariffTreeSet для обсчета сессийru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSetgetRealtimeTariffTreeSet(int cid, Date time, String module, int mid, int emid, int eid, boolean useChache) Создает TariffTreeSet для обсчета сессийgetSubContracts(int contractId) Получает все субдоговоры данного договора.getSubContracts(int cid, int subMode) Получает зависимые или независимые субдоговора данного договораru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSetgetTariffTreeSetForDay(int contractId, LocalDate time, String module, int moduleId, boolean useChache) Создает TariffTreeSet для обработки одного дняru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSetgetTariffTreeSetForDay(int contractId, Calendar time, String module, int moduleId, boolean useChache) Deprecated.booleanisSubContract(int cid, int subcid) Проверят зависимый ли контракт один от другого.voidrecycle()voidupdateContract(Contract contract) Обновление записи о договореvoidupdateLastTariffChange(int cid) Deprecated.Вместо этого метода теперь будет добавление события на изменение тарифных планов
-
Constructor Details
-
ContractManager
-
-
Method Details
-
getContractById
Возвращает договор по его коду- Parameters:
contractId- код договора- Returns:
-
getContractByTitle
Deprecated.Использовать ContractDao - getByTitle Возвращает договор по его номеру- Parameters:
title- номер договора- Returns:
-
getRealtimeTariffTreeSet
public ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSet getRealtimeTariffTreeSet(int cid, Date date, String module, int mid, boolean useChache) Создает TariffTreeSet для обсчета сессий- Parameters:
contract- BGContractmodule- Stringmid- intuseChache- boolean
-
getRealtimeTariffTreeSet
@Deprecated public ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSet getRealtimeTariffTreeSet(int cid, Calendar time, String module, int mid, boolean useChache) Deprecated. -
getRealtimeTariffTreeSet
@Deprecated public ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSet getRealtimeTariffTreeSet(int cid, Calendar time, String module, int mid, int emid, int eid, boolean useChache) Deprecated. -
getRealtimeTariffTreeSet
public ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSet getRealtimeTariffTreeSet(int cid, Date time, String module, int mid, int emid, int eid, boolean useChache) Создает TariffTreeSet для обсчета сессий- Parameters:
contract- BGContractmodule- Stringmid- intuseChache- boolean
-
getTariffTreeSetForDay
@Deprecated public ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSet getTariffTreeSetForDay(int contractId, Calendar time, String module, int moduleId, boolean useChache) Deprecated. -
getTariffTreeSetForDay
public ru.bitel.bgbilling.kernel.tariff.server.tree.TariffTreeSet getTariffTreeSetForDay(int contractId, LocalDate time, String module, int moduleId, boolean useChache) Создает TariffTreeSet для обработки одного дня -
getSubContracts
Получает все субдоговоры данного договора.- Parameters:
contractId- код договора.- Returns:
- список субдоговоров.
- Throws:
ru.bitel.bgbilling.common.BGException
-
isSubContract
public boolean isSubContract(int cid, int subcid) throws ru.bitel.bgbilling.common.BGException Проверят зависимый ли контракт один от другого.- Parameters:
cid- договорsubcid- потенциальный зависимый субконтракт.- Returns:
- true - зависимость есть.
- Throws:
ru.bitel.bgbilling.common.BGException
-
getSubContracts
Получает зависимые или независимые субдоговора данного договора- Parameters:
cid-subMode- зависимый или независимый режим из KernelConst- Returns:
-
updateLastTariffChange
Deprecated.Вместо этого метода теперь будет добавление события на изменение тарифных планов- Parameters:
cid-
-
updateContract
Обновление записи о договоре- Parameters:
contract-
-
addContractGroup
public void addContractGroup(int cid, int groupId) throws ru.bitel.bgbilling.common.BGException Привязываем договор к группе.- Parameters:
cid- код договораgroupId- код группы- Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
deleteContractGroup
public void deleteContractGroup(int cid, long groupId) throws ru.bitel.bgbilling.common.BGException Удаляем договор из группы.- Parameters:
cid- код договораgroupId- код группы- Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
recycle
public void recycle()- Specified by:
recyclein interfaceru.bitel.common.worker.Recyclable
-
getContractParameterGroupCountMap
public Map<Integer,Integer> getContractParameterGroupCountMap() throws ru.bitel.bgbilling.common.BGExceptionВозвращает Map содержащий коды групп параметров договоров и кол-ва договоров в каждой из них ("SELECT pgid, COUNT(*) FROM contract GROUP BY pgid")- Returns:
- Map<Integer, Integer> в какой группе сколько договоров
- Throws:
ru.bitel.bgbilling.common.BGException
-
checkContractService
public boolean checkContractService(int contractId, int serviceId, Date date) throws ru.bitel.bgbilling.common.BGException Проверка наличия на договоре услуги на указанную дату- Parameters:
contractId- код договораserviceId- код услугиdate- дата- Returns:
- true - если услуга есть, false - услуги нет или дата вне периода
- Throws:
ru.bitel.bgbilling.common.BGException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-