Class AbstractManager
java.lang.Object
ru.bitel.bgbilling.modules.bill.server.bean.AbstractManager
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
BillManager
,InvoiceManager
public abstract class AbstractManager
extends java.lang.Object
implements java.lang.AutoCloseable
-
Field Summary
Fields Modifier and Type Field Description static int
BILL_ALL
static int
BILL_NEW
static int
BILL_PAYED
protected java.sql.Connection
con
protected ContractManager
contractManager
static int
DT_CREATED
static int
DT_PAYED
protected static org.apache.logging.log4j.Logger
log
protected int
mid
Deprecated.protected int
moduleId
protected Preferences
moduleSetup
protected Setup
setup
protected java.lang.String
table
static int
USER_ADMIN
static int
USER_ALL
static int
USER_USER
static int
UT_ALL
static int
UT_NOTUNLOADED
static int
UT_UNLOADED
-
Constructor Summary
Constructors Constructor Description AbstractManager(java.sql.Connection con, int moduleId, java.lang.String tableName)
-
Method Summary
Modifier and Type Method Description int
addBillDoc(int userId, BillDoc billDoc, java.util.List<PositionValue> posList, java.util.List<BillDoc> subList)
abstract int
addBillDoc(int userId, BillDoc billDoc, java.util.List<PositionValue> posList, java.util.List<BillDoc> subList, boolean checkPast)
protected void
addBillDocData(java.sql.Connection con, BillDoc billDoc, java.util.List<PositionValue> posList, java.util.List<BillDoc> subList, javax.xml.stream.XMLStreamWriter doc, Contract contract)
void
addBillDocs(int userId, java.io.InputStream billsXML, int yy, int mm, java.util.Date date)
void
addBillDocs(int userId, java.io.InputStream billsXML, int yy, int mm, java.util.Date date, boolean checkPast)
protected void
addNameCol(java.lang.String nameSortParam, int sortMode, int secSortMode, java.lang.StringBuffer query)
protected void
addNameJoin(java.lang.String nameSortParam, int sortMode, int secSortMode, java.lang.StringBuffer query)
protected void
addPackageFilterJoin(int packageParamId, int packageId, int sortMode, java.lang.StringBuffer query)
protected void
addSortMode(int addressSortParam, java.lang.String nameSortParam, int sortMode, int secondarySortMode, java.lang.StringBuffer query)
protected void
addStreetCol(int addressSortParam, int sortMode, int secSortMode, java.lang.StringBuffer query, boolean forRegister)
protected void
addStreetJoin(int addressSortParam, int sortMode, int secSortMode, java.lang.StringBuffer query, boolean forRegister)
void
close()
void
delete(int id)
void
delete(java.lang.String ids)
Deprecated.use delete(Iterable ids)void
delete(java.util.Collection<?> ids)
protected abstract BillDoc
getBillDoc(org.xml.sax.Attributes attributes)
protected abstract BillDoc
getBillDoc(XMLUtils.BGXMLEventReader reader, javax.xml.stream.events.StartElement element)
BillDoc
getBillDocInfo(int id)
protected int[]
getNextNumbers(java.sql.Connection con, int numberPoolId, int yy, int mm)
byte[]
getXMLData(int id)
Получение данных xml-ки документа по id.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)
java.lang.String
updateNumber(int id, int number, int numberYear, int numberMonth, java.util.Calendar date, int month, int year)
void
updatePositions(int id, java.lang.String posList, int correction, java.lang.String payDocData, java.lang.String identifierGovermentContract)
void
updatePositions(int id, java.lang.String posList, java.lang.String identifierGovermentContract)
void
updatePositions(int id, org.w3c.dom.Element positions, int correction, java.lang.String payDoc, java.lang.String payDocDate, java.lang.String identifierGovermentContract)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
log
protected static final org.apache.logging.log4j.Logger log -
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 java.sql.Connection con -
mid
@Deprecated protected int midDeprecated. -
moduleId
protected int moduleId -
setup
-
moduleSetup
-
table
protected java.lang.String table -
contractManager
-
-
Constructor Details
-
AbstractManager
public AbstractManager(java.sql.Connection con, int moduleId, java.lang.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(java.lang.String ids)Deprecated.use delete(Iterable ids) -
delete
public final void delete(java.util.Collection<?> ids) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
updatePositions
public final void updatePositions(int id, java.lang.String posList, int correction, java.lang.String payDocData, java.lang.String identifierGovermentContract) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
updatePositions
public final void updatePositions(int id, java.lang.String posList, java.lang.String identifierGovermentContract) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
updatePositions
public final void updatePositions(int id, org.w3c.dom.Element positions, int correction, java.lang.String payDoc, java.lang.String payDocDate, java.lang.String identifierGovermentContract) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
updateNumber
public java.lang.String updateNumber(int id, int number, int numberYear, int numberMonth, java.util.Calendar date, int month, int year) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
addPackageFilterJoin
protected void addPackageFilterJoin(int packageParamId, int packageId, int sortMode, java.lang.StringBuffer query) -
addSortMode
protected void addSortMode(int addressSortParam, java.lang.String nameSortParam, int sortMode, int secondarySortMode, java.lang.StringBuffer query) -
addStreetCol
protected void addStreetCol(int addressSortParam, int sortMode, int secSortMode, java.lang.StringBuffer query, boolean forRegister) -
addStreetJoin
protected void addStreetJoin(int addressSortParam, int sortMode, int secSortMode, java.lang.StringBuffer query, boolean forRegister) -
addNameCol
protected void addNameCol(java.lang.String nameSortParam, int sortMode, int secSortMode, java.lang.StringBuffer query) -
addNameJoin
protected void addNameJoin(java.lang.String nameSortParam, int sortMode, int secSortMode, java.lang.StringBuffer query) -
getNextNumbers
protected final int[] getNextNumbers(java.sql.Connection con, int numberPoolId, int yy, int mm) -
addBillDocs
public void addBillDocs(int userId, java.io.InputStream billsXML, int yy, int mm, java.util.Date date) throws ru.bitel.bgbilling.common.BGException, java.sql.SQLException- Throws:
ru.bitel.bgbilling.common.BGException
java.sql.SQLException
-
addBillDocs
public void addBillDocs(int userId, java.io.InputStream billsXML, int yy, int mm, java.util.Date date, boolean checkPast) throws ru.bitel.bgbilling.common.BGException, java.sql.SQLException- Throws:
ru.bitel.bgbilling.common.BGException
java.sql.SQLException
-
addBillDocData
protected void addBillDocData(java.sql.Connection con, BillDoc billDoc, java.util.List<PositionValue> posList, java.util.List<BillDoc> subList, javax.xml.stream.XMLStreamWriter doc, Contract contract) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
addBillDoc
public int addBillDoc(int userId, BillDoc billDoc, java.util.List<PositionValue> posList, java.util.List<BillDoc> subList)- Returns:
- - id созданного счета
-
addBillDoc
public abstract int addBillDoc(int userId, BillDoc billDoc, java.util.List<PositionValue> posList, java.util.List<BillDoc> subList, boolean checkPast) -
getBillDoc
-
getBillDoc
protected abstract BillDoc getBillDoc(XMLUtils.BGXMLEventReader reader, javax.xml.stream.events.StartElement element) -
setBankAccount
-
setOrganization
-
getBillDocInfo
-
publishEvent
protected abstract void publishEvent(int userID, BillDoc billDoc, int billId) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
close
public void close()- Specified by:
close
in interfacejava.lang.AutoCloseable
-