Class RSCMContractServiceManager
java.lang.Object
ru.bitel.bgbilling.modules.rscm.server.bean.RSCMContractServiceManager
- All Implemented Interfaces:
java.lang.AutoCloseable
public class RSCMContractServiceManager
extends java.lang.Object
implements java.lang.AutoCloseable
DAO потребленных договором услуг модуля.
-
Constructor Summary
Constructors Constructor Description RSCMContractServiceManager(java.sql.Connection con, int moduleId) -
Method Summary
Modifier and Type Method Description java.lang.StringcheckBalanceForService(int contractId, int serviceId, java.math.BigDecimal amount, java.time.LocalDate date)Проверяет возможность добавление на договор с кодом cid услуги с кодом serviceId в размере amount единиц на текущую дату.voidcheckTariffsForService(int contractId, int serviceId, java.time.LocalDate localDate)voidclose()voiddeleteContractService(int id, int contractId, java.time.LocalDate month)Удаление потребленной услуги договора.RSCMContractServiceInstallmentdeleteContractServiceInstallment(int id)RSCMContractServicegetContractService(int contractId, int id)Получение потребленной услуги договора.RSCMContractServicegetContractServiceByInstallmentId(int installmentId, int contractId, java.time.LocalDate month)Находим начисление по ID рассрочки в заданном месяцеRSCMContractServiceInstallmentgetContractServiceInstallment(int id)java.util.List<RSCMContractServiceInstallment>getContractServiceInstallmentList()java.util.List<RSCMContractService>getContractServiceList(int contractId, java.util.Calendar month)Список потребленных договором услуг.java.util.List<RSCMContractService>getContractServiceList(int contractId, Period period, Page page, boolean dateAscOrder)voidhotCalc(int contractId, java.time.LocalDate date)voidsearchContractServiceInstallment(SearchResult<RSCMContractServiceInstallment> searchResult, int contractId, Page page)voidupdateContractService(RSCMContractService contractService)Изменение/добавление потребленной услуги.voidupdateRSCMContractServiceInstallment(RSCMContractServiceInstallment rscmContractServiceInstallment)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RSCMContractServiceManager
public RSCMContractServiceManager(java.sql.Connection con, int moduleId)
-
-
Method Details
-
checkBalanceForService
public java.lang.String checkBalanceForService(int contractId, int serviceId, java.math.BigDecimal amount, java.time.LocalDate date) throws ru.bitel.bgbilling.common.BGExceptionПроверяет возможность добавление на договор с кодом cid услуги с кодом serviceId в размере amount единиц на текущую дату. В случае, если на договоре достаточно средств, то метод возвращает null, иначе - строку с описанием причины невозможности добавления услуги.- Parameters:
contractId- код договораserviceId- код услугиamount- количество единицdate- дата- Returns:
- null - если добавление возможно, и String - причина невозможности добавления услуги
- Throws:
ru.bitel.bgbilling.common.BGException
-
checkTariffsForService
public void checkTariffsForService(int contractId, int serviceId, java.time.LocalDate localDate) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getContractServiceList
public java.util.List<RSCMContractService> getContractServiceList(int contractId, java.util.Calendar month) throws ru.bitel.bgbilling.common.BGExceptionСписок потребленных договором услуг.- Parameters:
contractId- код договораmonth- месяц- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
getContractServiceList
public java.util.List<RSCMContractService> getContractServiceList(int contractId, Period period, Page page, boolean dateAscOrder) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
updateContractService
public void updateContractService(RSCMContractService contractService) throws ru.bitel.bgbilling.common.BGExceptionИзменение/добавление потребленной услуги. Добавление происходит при getId() <= 0.- Parameters:
contractService-- Throws:
ru.bitel.bgbilling.common.BGException
-
deleteContractService
public void deleteContractService(int id, int contractId, java.time.LocalDate month) throws ru.bitel.bgbilling.common.BGExceptionУдаление потребленной услуги договора.- Parameters:
id- код записиcontractId- код договораmonth- месяц- Throws:
ru.bitel.bgbilling.common.BGException
-
getContractService
public RSCMContractService getContractService(int contractId, int id) throws ru.bitel.bgbilling.common.BGExceptionПолучение потребленной услуги договора.- Parameters:
contractId- код договораid- код записи- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
updateRSCMContractServiceInstallment
public void updateRSCMContractServiceInstallment(RSCMContractServiceInstallment rscmContractServiceInstallment) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
hotCalc
public void hotCalc(int contractId, java.time.LocalDate date) throws ru.bitel.bgbilling.common.BGException, ru.bitel.bgbilling.common.BGMessageException- Throws:
ru.bitel.bgbilling.common.BGExceptionru.bitel.bgbilling.common.BGMessageException
-
searchContractServiceInstallment
public void searchContractServiceInstallment(SearchResult<RSCMContractServiceInstallment> searchResult, int contractId, Page page) throws ru.bitel.bgbilling.common.BGException, ru.bitel.bgbilling.common.BGMessageException- Throws:
ru.bitel.bgbilling.common.BGExceptionru.bitel.bgbilling.common.BGMessageException
-
getContractServiceByInstallmentId
public RSCMContractService getContractServiceByInstallmentId(int installmentId, int contractId, java.time.LocalDate month) throws ru.bitel.bgbilling.common.BGException, ru.bitel.bgbilling.common.BGMessageExceptionНаходим начисление по ID рассрочки в заданном месяце- Parameters:
id-localDate-- Returns:
- Throws:
ru.bitel.bgbilling.common.BGExceptionru.bitel.bgbilling.common.BGMessageException
-
getContractServiceInstallmentList
public java.util.List<RSCMContractServiceInstallment> getContractServiceInstallmentList() throws ru.bitel.bgbilling.common.BGException, ru.bitel.bgbilling.common.BGMessageException- Throws:
ru.bitel.bgbilling.common.BGExceptionru.bitel.bgbilling.common.BGMessageException
-
getContractServiceInstallment
public RSCMContractServiceInstallment getContractServiceInstallment(int id) throws ru.bitel.bgbilling.common.BGException, ru.bitel.bgbilling.common.BGMessageException- Throws:
ru.bitel.bgbilling.common.BGExceptionru.bitel.bgbilling.common.BGMessageException
-
deleteContractServiceInstallment
public RSCMContractServiceInstallment deleteContractServiceInstallment(int id) throws ru.bitel.bgbilling.common.BGException, ru.bitel.bgbilling.common.BGMessageException- Throws:
ru.bitel.bgbilling.common.BGExceptionru.bitel.bgbilling.common.BGMessageException
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-