java.lang.Object
ru.bitel.common.dao.AbstarctDaoConstant
ru.bitel.common.dao.AbstractDao<B>
ru.bitel.common.dao.AbstractIdDao<Charge>
ru.bitel.bgbilling.kernel.contract.balance.server.bean.ChargeDao
All Implemented Interfaces:
AutoCloseable

public class ChargeDao extends ru.bitel.common.dao.AbstractIdDao<Charge>
DAO для манипулирования расходами договоров.
  • Nested Class Summary

    Nested classes/interfaces inherited from class ru.bitel.common.dao.AbstractDao

    ru.bitel.common.dao.AbstractDao.ResultSetIterator
  • Field Summary

    Fields inherited from class ru.bitel.common.dao.AbstractDao

    cacheFilter, cacheJoin, cacheOrderBy, cachePaged, cachePS, cacheWhat, con, getByIdPS, moduleId, orderByPattern, tableName

    Fields inherited from class ru.bitel.common.dao.AbstarctDaoConstant

    ERROR, fields, SQL_CALC_FOUND_ROWS, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_LIMIT, SQL_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    deleteCharges(int contractId)
    Удаление всех расходов для договора
    getChargeList(int contractId, int chargeTypeId, Period period, int members, javax.xml.ws.Holder<BigDecimal> holderTotalSum)
    Получает список расходов для договора
    getChargeList(List<Integer> contractIds, Period period, javax.xml.ws.Holder<BigDecimal> totalSum)
     
    protected Charge
     
    getPaybackList(int contractId, int paybackTypeId, Period period, int members, javax.xml.ws.Holder<BigDecimal> totalSum)
     
    getSum(int contractId, Date dateFrom, Date dateTo, int typeId, int members, Boolean isPayback)
    Получение суммы по расходам или возвратам.
    void
    searchChargeList(SearchResult<Charge> searchResult, List<Integer> contractIds)
     
    void
    searchLastChargeList(SearchResult<Charge> searchResult, List<Integer> contractIds, int lastCharges)
     
    protected void
    Обновляет существующий (charge.getId() > 0) или добавляет новый расход (charge.getId() <= 0).

    Methods inherited from class ru.bitel.common.dao.AbstractIdDao

    delete, get, getAndDelete, getAndUpdate

    Methods inherited from class ru.bitel.common.dao.AbstractDao

    close, delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, processException, recycle, setStatementParam, update

    Methods inherited from class ru.bitel.common.dao.AbstarctDaoConstant

    getSQLOrder

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getChargeList

      public List<Charge> getChargeList(int contractId, int chargeTypeId, Period period, int members, javax.xml.ws.Holder<BigDecimal> holderTotalSum) throws ru.bitel.bgbilling.common.BGException
      Получает список расходов для договора
      Parameters:
      contractId - код договора.
      chargeTypeId - код типа расхода, если <1, то значит всех типов.
      period - период начисления расхода для поиска. может быть = null(тогда вернет все) или может быть одна из дат = null.
      members - - если == 1, то только расходы данного договора, если = 2 то вернет еще и расходы з.субдоговоров, если = 3 то только расходы зависемых субдоговоров.
      holderTotalSum - - возвращаемое поле, если != null, то сюда занесется общая сумма по всем выбранным приходам. Если вам не нужно это, ставте null.
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getChargeList

      public List<Charge> getChargeList(List<Integer> contractIds, Period period, javax.xml.ws.Holder<BigDecimal> totalSum) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • searchChargeList

      public void searchChargeList(SearchResult<Charge> searchResult, List<Integer> contractIds) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • searchLastChargeList

      public void searchLastChargeList(SearchResult<Charge> searchResult, List<Integer> contractIds, int lastCharges) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getPaybackList

      public List<Charge> getPaybackList(int contractId, int paybackTypeId, Period period, int members, javax.xml.ws.Holder<BigDecimal> totalSum) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • deleteCharges

      public int deleteCharges(int contractId) throws ru.bitel.bgbilling.common.BGException
      Удаление всех расходов для договора
      Parameters:
      contractId -
      Returns:
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getSum

      public BigDecimal getSum(int contractId, Date dateFrom, Date dateTo, int typeId, int members, Boolean isPayback) throws ru.bitel.bgbilling.common.BGException
      Получение суммы по расходам или возвратам.
      Parameters:
      contractId - - код договора.
      dateFrom - - от даты, может быть = null.
      dateTo - - до даты, может быть = null.
      typeId - - тип, если < 1, то все типы.
      members - - если == 1, то только данного договора, если = 2 то вернет еще и з.субдоговоров, если = 3 то только зависемых субдоговоров.
      isPayback - - true - возврат, false - расход, null - все.
      Throws:
      ru.bitel.bgbilling.common.BGException
    • updateImpl

      protected void updateImpl(Charge charge) throws ru.bitel.bgbilling.common.BGException, SQLException
      Обновляет существующий (charge.getId() > 0) или добавляет новый расход (charge.getId() <= 0).
      Specified by:
      updateImpl in class ru.bitel.common.dao.AbstractDao<Charge>
      Parameters:
      charge - объект с данными расхода
      Throws:
      ru.bitel.bgbilling.common.BGException
      SQLException
    • getFromRS

      protected Charge getFromRS(ResultSet rs) throws SQLException, ru.bitel.bgbilling.common.BGException
      Specified by:
      getFromRS in class ru.bitel.common.dao.AbstractDao<Charge>
      Throws:
      SQLException
      ru.bitel.bgbilling.common.BGException