ru.bitel.bgbilling.kernel.contract.autopayment.server.bean

## Class AbstractAutopaymentManager

- java.lang.Object
- - ru.bitel.common.dao.AbstarctDaoConstant
  - - ru.bitel.common.dao.AbstractDao<Autopayment>
    - - ru.bitel.bgbilling.kernel.contract.autopayment.server.bean.AbstractAutopaymentManager

- All Implemented Interfaces:
    java.lang.AutoCloseable
  Direct Known Subclasses:
    AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager, AutopaymentManager

      public abstract class AbstractAutopaymentManager
      extends ru.bitel.common.dao.AbstractDao<Autopayment>

- - ### 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, mid, moduleId, orderByPattern, tableName`

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

      `ERROR, 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 and Description
    `AbstractAutopaymentManager(java.sql.Connection con, java.lang.String tableNamePrefix, int moduleId)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `autopaymentOff(Autopayment autopayment)`
    `Autopayment` | `getAutopayment(int id)`
    `Autopayment` | `getCurrentAutopayment(int contractId)`
    `protected Autopayment` | `getFromRS(java.sql.ResultSet rs)`
    `void` | `invokeAutopayment(int contractId, java.math.BigDecimal amount)`
    `static <T> Autopayment` | `registerAutopayment(java.sql.Connection con, int moduleId, AbstractAutopaymentManager autopaymentManager, int contractId, ContractAutopaymentMode mode, ru.bitel.common.function.ThrowingFunction<Autopayment,T> registerFunction)` Регистрация автоплатежа - создается Autopayment, вызывается registerFunction.
    `<T extends BGAbstractTransaction> T` | `registerAutopayment(int contractId, ContractAutopaymentMode mode, java.util.function.Function<java.math.BigDecimal,T> registerOrder)`
    `void` | `searchActivateAutopayment(SearchResult<Autopayment> searchResult, java.util.Date date, int mode)`
    `void` | `searchAutopayment(SearchResult<Autopayment> searchResult, int contractId)`
    `void` | `searchCurrentAutopayment(SearchResult<Autopayment> searchResult, java.util.Date date, int mode)` Выбрать подписки которые должны исполниться в указанный день
    `static void` | `unregisterAutopayment(java.sql.Connection con, int moduleId, AbstractAutopaymentManager autopaymentManager, int contractId)` Отмена автоплатежа в биллинге.
    `Autopayment` | `updateAutopayment(Autopayment autopayment)`
    `protected void` | `updateImpl(Autopayment autopayment)`

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

      `close, delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getPeriod, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, 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 Detail

    - #### AbstractAutopaymentManager

          public AbstractAutopaymentManager(java.sql.Connection con,
                                            java.lang.String tableNamePrefix,
                                            int moduleId)

  - ### Method Detail

    - #### getAutopayment

          public Autopayment getAutopayment(int id)
                                     throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### getCurrentAutopayment

          public Autopayment getCurrentAutopayment(int contractId)
                                            throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### updateImpl

          protected void updateImpl(Autopayment autopayment)
                             throws ru.bitel.bgbilling.common.BGException,
                                    java.sql.SQLException

      Specified by:
        `updateImpl` in class `ru.bitel.common.dao.AbstractDao<Autopayment>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `java.sql.SQLException`

    - #### updateAutopayment

          public Autopayment updateAutopayment(Autopayment autopayment)
                                        throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### searchAutopayment

          public void searchAutopayment(SearchResult<Autopayment> searchResult,
                                        int contractId)
                                 throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### searchActivateAutopayment

          public void searchActivateAutopayment(SearchResult<Autopayment> searchResult,
                                                java.util.Date date,
                                                int mode)
                                         throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### searchCurrentAutopayment

          public void searchCurrentAutopayment(SearchResult<Autopayment> searchResult,
                                               java.util.Date date,
                                               int mode)
                                        throws ru.bitel.bgbilling.common.BGException

      Выбрать подписки которые должны исполниться в указанный день
      Parameters:
        `searchResult` -
        `date` -
        `mode` -
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### getFromRS

          protected Autopayment getFromRS(java.sql.ResultSet rs)
                                   throws java.sql.SQLException,
                                          ru.bitel.bgbilling.common.BGException

      Specified by:
        `getFromRS` in class `ru.bitel.common.dao.AbstractDao<Autopayment>`
      Throws:
        `java.sql.SQLException`
        `ru.bitel.bgbilling.common.BGException`

    - #### registerAutopayment

          public <T extends BGAbstractTransaction> T registerAutopayment(int contractId,
                                                                         ContractAutopaymentMode mode,
                                                                         java.util.function.Function<java.math.BigDecimal,T> registerOrder)
                                                                  throws ru.bitel.bgbilling.common.BGException,
                                                                         ru.bitel.bgbilling.common.BGMessageException

      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `ru.bitel.bgbilling.common.BGMessageException`

    - #### autopaymentOff

          public void autopaymentOff(Autopayment autopayment)
                              throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### invokeAutopayment

          public void invokeAutopayment(int contractId,
                                        java.math.BigDecimal amount)
                                 throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### registerAutopayment

          public static <T> Autopayment registerAutopayment(java.sql.Connection con,
                                                            int moduleId,
                                                            AbstractAutopaymentManager autopaymentManager,
                                                            int contractId,
                                                            ContractAutopaymentMode mode,
                                                            ru.bitel.common.function.ThrowingFunction<Autopayment,T> registerFunction)
                                                     throws ru.bitel.bgbilling.common.BGException

      Регистрация автоплатежа - создается Autopayment, вызывается registerFunction.
      Parameters:
        `con` -
        `moduleId` -
        `contractId` -
        `mode` -
        `registerFunction` -
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### unregisterAutopayment

          public static void unregisterAutopayment(java.sql.Connection con,
                                                   int moduleId,
                                                   AbstractAutopaymentManager autopaymentManager,
                                                   int contractId)
                                            throws ru.bitel.bgbilling.common.BGException

      Отмена автоплатежа в биллинге. Если есть какой-то вызов к платежной системе - то его нужно вызвать (кроме вызова данного метода).
      Parameters:
        `con` -
        `moduleId` -
        `contractId` -
      Throws:
        `ru.bitel.bgbilling.common.BGException`