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

# Class AbstractManager

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

Direct Known Subclasses:
  `BillManager`, `InvoiceManager`

public abstract class AbstractManager extends ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `BILL_ALL`
  `static final int`
  `BILL_NEW`
  `static final int`
  `BILL_PAYED`
  `protected Connection`
  `con`
  `protected final ContractManager`
  `contractManager`
  `static final int`
  `DT_CREATED`
  `static final int`
  `DT_PAYED`
  `protected int`
  `mid`
  Deprecated.
  `protected int`
  `moduleId`
  `protected Preferences`
  `moduleSetup`
  `protected Setup`
  `setup`
  `protected String`
  `table`
  `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`

- ## Constructor Summary

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

- ## 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.kernel.base.server.logger.BGLogger

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

  ### 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

  - ### con

    protected Connection con

  - ### mid

    @Deprecated protected int mid
    Deprecated.

  - ### moduleId

    protected int moduleId

  - ### setup

    protected Setup setup

  - ### moduleSetup

    protected Preferences moduleSetup

  - ### table

    protected String table

  - ### contractManager

    protected final ContractManager contractManager

- ## Constructor Details

  - ### AbstractManager

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

- ## Method Details

  - ### getXMLData

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

  - ### getXMLData

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

  - ### delete

    public final void delete(int id)

  - ### delete

    @Deprecated public final void delete(String ids)
    Deprecated.
    use delete(Iterable ids)

  - ### delete

    public final void delete(Collection<?> ids) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### 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 XMLStreamException
    Throws:
      `XMLStreamException`

  - ### 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)

  - ### getBillDoc

    protected abstract BillDoc getBillDoc(XMLUtils.BGXMLEventReader reader, StartElement element)

  - ### setBankAccount

    protected void setBankAccount(Bill bill, int bankAccountId)

  - ### setOrganization

    protected void setOrganization(BillDoc billDoc, int organizationId)

  - ### 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`