Package ru.bitel.bgbilling.modules.bill.server.bean

# Class AbstractManager

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.bgbilling.common.dao.AbstarctDaoConstant
ru.bitel.bgbilling.modules.bill.server.bean.AbstractManager

Direct Known Subclasses:
  `BillManager`, `InvoiceManager`

public abstract class AbstractManager extends ru.bitel.bgbilling.common.dao.AbstarctDaoConstant

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `BILL_ALL`
  `static final int`
  `BILL_NEW`
  `static final int`
  `BILL_PAYED`
  `protected final ContractManager`
  `contractManager`
  `static final int`
  `DT_CREATED`
  `static final int`
  `DT_PAYED`
  `protected Preferences`
  `moduleSetup`
  `protected Setup`
  `setup`
  `static final int`
  `USER_ADMIN`
  `static final int`
  `USER_ALL`
  `static final int`
  `USER_USER`
  `static final int`
  `UT_ALL`
  `static final int`
  `UT_NOTUNLOADED`
  `static final int`
  `UT_UNLOADED`

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

  `con, ERROR, fields, moduleId, SQL_ALL, SQL_AND, SQL_CALC_FOUND_ROWS, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_JOIN, SQL_LEFT_JOIN, SQL_LIMIT, SQL_NOT_IN, SQL_ON, SQL_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE, tableName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractManager(Connection con, String tableName, int moduleId)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `addBillDoc(int userId, BillDoc billDoc, List<PositionValue> posList, List<BillDoc> subList)`
  `abstract int`
  `addBillDoc(int userId, BillDoc billDoc, List<PositionValue> posList, List<BillDoc> subList, boolean checkPast)`
  `protected void`
  `addBillDocData(Connection con, BillDoc billDoc, List<PositionValue> posList, List<BillDoc> subList, XMLStreamWriter doc, Contract contract)`
  `void`
  `addBillDocs(int userId, InputStream billsXML, int yy, int mm, Date date)`
  `void`
  `addBillDocs(int userId, InputStream billsXML, int yy, int mm, Date date, boolean checkPast)`
  `protected void`
  `addNameCol(String nameSortParam, int sortMode, int secSortMode, StringBuffer query)`
  `protected void`
  `addNameJoin(String nameSortParam, int sortMode, int secSortMode, StringBuffer query)`
  `protected void`
  `addPackageFilterJoin(int packageParamId, int packageId, int sortMode, StringBuffer query)`
  `protected void`
  `addSortMode(int addressSortParam, String nameSortParam, int sortMode, int secondarySortMode, StringBuffer query)`
  `protected void`
  `addStreetCol(int addressSortParam, int sortMode, int secSortMode, StringBuffer query, boolean forRegister)`
  `protected void`
  `addStreetJoin(int addressSortParam, int sortMode, int secSortMode, StringBuffer query, boolean forRegister)`
  `final void`
  `delete(int id)`
  `final void`
  `delete(String ids)`
  Deprecated.
  use delete(Iterable ids)
  `final void`
  `delete(Collection<?> ids)`
  `protected abstract BillDoc`
  `getBillDoc(Attributes attributes)`
  `protected abstract BillDoc`
  `getBillDoc(XMLUtils.BGXMLEventReader reader, StartElement element)`
  `BillDoc`
  `getBillDocInfo(int id)`
  Возвращает подмножество общих полей из bill/invoice в виде родительского BillDoc.
  `protected final int[]`
  `getNextNumbers(Connection con, int numberPoolId, int yy, int mm)`
  `final byte[]`
  `getXMLData(int id)`
  Получение данных xml-ки документа по id.
  `final byte[]`
  `getXMLData(int contractId, int id)`
  Получение данных xml-ки документа по contractId и id.
  `protected abstract void`
  `publishEvent(int userID, BillDoc billDoc, int billId)`
  `protected void`
  `setBankAccount(Bill bill, int bankAccountId)`
  `protected void`
  `setOrganization(BillDoc billDoc, int organizationId)`
  `String`
  `updateNumber(int id, int number, int numberYear, int numberMonth, Calendar date, int month, int year)`
  `final void`
  `updatePositions(int id, String posList, int correction, String payDocData, String identifierGovermentContract, String shipmentDocument)`
  `final void`
  `updatePositions(int id, String posList, String identifierGovermentContract, String shipmentDocument)`
  `final void`
  `updatePositions(int id, Element positions, int correction, String payDoc, String payDocDate, String identifierGovermentContract, String shipmentDocument)`

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

  `getPeriod, getSQLOrder, getTableName, psSetDate, psSetInt, psSetString`

  ### Methods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

  `error, error, error, getLogger, logError, logError, warn`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DT_CREATED

    public static final int DT_CREATED
    See Also:
      - Constant Field Values

  - ### DT_PAYED

    public static final int DT_PAYED
    See Also:
      - Constant Field Values

  - ### BILL_NEW

    public static final int BILL_NEW
    See Also:
      - Constant Field Values

  - ### BILL_PAYED

    public static final int BILL_PAYED
    See Also:
      - Constant Field Values

  - ### BILL_ALL

    public static final int BILL_ALL
    See Also:
      - Constant Field Values

  - ### USER_ALL

    public static final int USER_ALL
    See Also:
      - Constant Field Values

  - ### USER_ADMIN

    public static final int USER_ADMIN
    See Also:
      - Constant Field Values

  - ### USER_USER

    public static final int USER_USER
    See Also:
      - Constant Field Values

  - ### UT_NOTUNLOADED

    public static final int UT_NOTUNLOADED
    See Also:
      - Constant Field Values

  - ### UT_UNLOADED

    public static final int UT_UNLOADED
    See Also:
      - Constant Field Values

  - ### UT_ALL

    public static final int UT_ALL
    See Also:
      - Constant Field Values

  - ### setup

    protected Setup setup

  - ### moduleSetup

    protected Preferences moduleSetup

  - ### contractManager

    protected final ContractManager contractManager

- ## Constructor Details

  - ### AbstractManager

    public AbstractManager(Connection con, String tableName, int moduleId)

- ## Method Details

  - ### getXMLData

    public final byte[] getXMLData(int contractId, int id) throws SQLException
    Получение данных xml-ки документа по contractId и id. Нужно учесть, что кодировка неизвестна. До перехода на utf-8 байты лежали в cp1251, оно же было прописано в хедере самой xml-ки. Потому работать надо только через parseDocument итд.
    Returns:
      массив байтов - представление xml.
    Throws:
      `SQLException`

  - ### getXMLData

    public final byte[] getXMLData(int id) throws SQLException
    Получение данных xml-ки документа по id. Нужно учесть, что кодировка неизвестна. До перехода на utf-8 байты лежали в cp1251, оно же было прописано в хедере самой xml-ки. Потому работать надо только через parseDocument итд.
    Returns:
      массив байтов - представление xml.
    Throws:
      `SQLException`

  - ### delete

    public final void delete(int id) throws SQLException
    Throws:
      `SQLException`

  - ### delete

    @Deprecated public final void delete(String ids) throws SQLException
    Deprecated.
    use delete(Iterable ids)
    Throws:
      `SQLException`

  - ### delete

    public final void delete(Collection<?> ids) throws SQLException
    Throws:
      `SQLException`

  - ### updatePositions

    public final void updatePositions(int id, String posList, int correction, String payDocData, String identifierGovermentContract, String shipmentDocument) throws Exception
    Throws:
      `Exception`

  - ### updatePositions

    public final void updatePositions(int id, String posList, String identifierGovermentContract, String shipmentDocument) throws Exception
    Throws:
      `Exception`

  - ### updatePositions

    public final void updatePositions(int id, Element positions, int correction, String payDoc, String payDocDate, String identifierGovermentContract, String shipmentDocument) throws Exception
    Throws:
      `Exception`

  - ### updateNumber

    public String updateNumber(int id, int number, int numberYear, int numberMonth, Calendar date, int month, int year) throws Exception
    Throws:
      `Exception`

  - ### addPackageFilterJoin

    protected void addPackageFilterJoin(int packageParamId, int packageId, int sortMode, StringBuffer query)

  - ### addSortMode

    protected void addSortMode(int addressSortParam, String nameSortParam, int sortMode, int secondarySortMode, StringBuffer query)

  - ### addStreetCol

    protected void addStreetCol(int addressSortParam, int sortMode, int secSortMode, StringBuffer query, boolean forRegister)

  - ### addStreetJoin

    protected void addStreetJoin(int addressSortParam, int sortMode, int secSortMode, StringBuffer query, boolean forRegister)

  - ### addNameCol

    protected void addNameCol(String nameSortParam, int sortMode, int secSortMode, StringBuffer query)

  - ### addNameJoin

    protected void addNameJoin(String nameSortParam, int sortMode, int secSortMode, StringBuffer query)

  - ### getNextNumbers

    protected final int[] getNextNumbers(Connection con, int numberPoolId, int yy, int mm)

  - ### addBillDocs

    public void addBillDocs(int userId, InputStream billsXML, int yy, int mm, Date date) throws Exception
    Throws:
      `Exception`

  - ### addBillDocs

    public void addBillDocs(int userId, InputStream billsXML, int yy, int mm, Date date, boolean checkPast) throws Exception
    Throws:
      `Exception`

  - ### addBillDocData

    protected void addBillDocData(Connection con, BillDoc billDoc, List<PositionValue> posList, List<BillDoc> subList, XMLStreamWriter doc, Contract contract) throws Exception
    Throws:
      `Exception`

  - ### addBillDoc

    public int addBillDoc(int userId, BillDoc billDoc, List<PositionValue> posList, List<BillDoc> subList)
    Returns:
      - id созданного счета

  - ### addBillDoc

    public abstract int addBillDoc(int userId, BillDoc billDoc, List<PositionValue> posList, List<BillDoc> subList, boolean checkPast)

  - ### getBillDoc

    protected abstract BillDoc getBillDoc(Attributes attributes) throws Exception
    Throws:
      `Exception`

  - ### getBillDoc

    protected abstract BillDoc getBillDoc(XMLUtils.BGXMLEventReader reader, StartElement element) throws Exception
    Throws:
      `Exception`

  - ### setBankAccount

    protected void setBankAccount(Bill bill, int bankAccountId) throws Exception
    Throws:
      `Exception`

  - ### setOrganization

    protected void setOrganization(BillDoc billDoc, int organizationId) throws SQLException
    Throws:
      `SQLException`

  - ### getBillDocInfo

    public BillDoc getBillDocInfo(int id) throws ru.bitel.bgbilling.common.BGException
    Возвращает подмножество общих полей из bill/invoice в виде родительского BillDoc. Можно рассматривать как легковесную альтернативу для getBill/getInvoice, или если тип неизвестен.
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### publishEvent

    protected abstract void publishEvent(int userID, BillDoc billDoc, int billId) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`