Package ru.bitel.bgbilling.kernel.contract.label.server.bean

# Class ContractLabelManager

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.bgbilling.common.dao.AbstarctDaoConstant
ru.bitel.bgbilling.common.dao.AbstractDao<ContractLabelItem>
ru.bitel.bgbilling.common.dao.AbstractIdDao<ContractLabelItem>
ru.bitel.bgbilling.kernel.contract.label.server.bean.ContractLabelManager

public class ContractLabelManager extends ru.bitel.bgbilling.common.dao.AbstractIdDao<ContractLabelItem>

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final String`
  `TABLE_CONTRACT_LABEL`
  `protected static final String`
  `TABLE_CONTRACT_LABEL_LINK`

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

  `orderByPattern`

  ### 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
  `ContractLabelManager(Connection con)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `addChild(int up, ContractLabelItem rootItem, List<ContractLabelItem> list)`
  `int`
  `getContractCountByLabel(int labelId)`
  `List<Integer>`
  `getContractLabelIds(int contractId)`
  `List<ContractLabelItem>`
  `getContractLabelItemList(boolean calcCount)`
  `Map<Integer,List<Integer>>`
  `getContractListWithLabels()`
  `protected ContractLabelItem`
  `getFromRS(ResultSet rs)`
  `ContractLabelItem`
  `getTree()`
  `void`
  `removeContractLabelItem(int contractLabelItemId)`
  `void`
  `setContractLabelIds(int contractId, List<Integer> ids)`
  `void`
  `syncLabelAndGroupContract(int contractId)`
  Синхронизация групп договоров и меток договоров (копирует группы в метки)
  `void`
  `syncLabelAndGroupDirectory()`
  `void`
  `updateContractLabelTreeItem(ContractLabelItem contractLabelItem)`
  `protected void`
  `updateImpl(ContractLabelItem contractLabelItem)`

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

  `delete, executeUpdate, get, getAndDelete, getAndUpdate, opt, prepareStatement, sqlCommand, sqlCommandAndTable, sqlQuery, sqlWhereId`

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

  `delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getSQLOrder, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, psSetPeriod, queryPeriod, setStatementParam, update`

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

  `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

  - ### TABLE_CONTRACT_LABEL

    protected static final String TABLE_CONTRACT_LABEL
    See Also:
      - Constant Field Values

  - ### TABLE_CONTRACT_LABEL_LINK

    protected static final String TABLE_CONTRACT_LABEL_LINK
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ContractLabelManager

    public ContractLabelManager(Connection con)

- ## Method Details

  - ### getContractLabelItemList

    public List<ContractLabelItem> getContractLabelItemList(boolean calcCount) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getContractLabelIds

    public List<Integer> getContractLabelIds(int contractId) throws SQLException
    Throws:
      `SQLException`

  - ### setContractLabelIds

    public void setContractLabelIds(int contractId, List<Integer> ids) throws SQLException
    Throws:
      `SQLException`

  - ### updateContractLabelTreeItem

    public void updateContractLabelTreeItem(ContractLabelItem contractLabelItem) throws SQLException
    Throws:
      `SQLException`

  - ### removeContractLabelItem

    public void removeContractLabelItem(int contractLabelItemId) throws SQLException
    Throws:
      `SQLException`

  - ### getTree

    public ContractLabelItem getTree() throws SQLException
    Throws:
      `SQLException`

  - ### syncLabelAndGroupDirectory

    public void syncLabelAndGroupDirectory() throws SQLException
    Throws:
      `SQLException`

  - ### syncLabelAndGroupContract

    public void syncLabelAndGroupContract(int contractId) throws ru.bitel.bgbilling.common.BGException
    Синхронизация групп договоров и меток договоров (копирует группы в метки)
    Parameters:
      `contractId` - больше 0 - для одного договора, иначе для всех договоров
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### addChild

    protected void addChild(int up, ContractLabelItem rootItem, List<ContractLabelItem> list)

  - ### getContractListWithLabels

    public Map<Integer,List<Integer>> getContractListWithLabels() throws SQLException
    Returns:
      список всех договоров в базе с их метками
    Throws:
      `SQLException`

  - ### getContractCountByLabel

    public int getContractCountByLabel(int labelId) throws SQLException
    Throws:
      `SQLException`

  - ### getFromRS

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

  - ### updateImpl

    protected void updateImpl(ContractLabelItem contractLabelItem) throws SQLException
    Specified by:
      `updateImpl` in class `ru.bitel.bgbilling.common.dao.AbstractDao<ContractLabelItem>`
    Throws:
      `SQLException`