Package ru.bgcrm.plugin.bgbilling.proto.dao

# Class ContractDAO

java.lang.Object
ru.bgcrm.plugin.bgbilling.dao.BillingDAO
ru.bgcrm.plugin.bgbilling.proto.dao.ContractDAO

Direct Known Subclasses:
  `ContractNoteDAO`

public class ContractDAO extends BillingDAO

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `ContractDAO.SearchOptions`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `KERNEL_CONTRACT_API`
  `static final String`
  `KERNEL_CONTRACT_LIMIT`

  ### Fields inherited from class ru.bgcrm.plugin.bgbilling.dao.BillingDAO

  `dbInfo, jsonMapper, jsonTypeFactory, transferData, user`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContractDAO(User user, String billingId)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<IdTitle>`
  `additionalActionList(int contractId)`
  `void`
  `addSearchResult(Pageable<Contract> result, Page page, Request req)`
  `void`
  `bgbillingOpenContract(int contractId)`
  `void`
  `bgbillingUpdateContractTitleAndComment(int contractId, String comment, int patid)`
  `void`
  `copyObjectParamsToContract(Connection con, String copyParamsMapping, int objectId, int contractId, Customer customer)`
  `static void`
  `copyParametersToAllContracts(Connection con, User user, int customerId)`
  `void`
  `copyParametersToBilling(Connection con, int customerId, int contractId, String title)`
  `Contract`
  `createContract(int patternId, Date date, String title, String customTitle, int superId)`
  `void`
  `dateToUpdate(int contractId, Date dateTo)`
  `void`
  `deleteLimitTask(int contractId, int id)`
  `String`
  `executeAdditionalAction(int contractId, int actionId)`
  `void`
  `faceLog(Pageable<ContractFace> result, int contractId)`
  `Contract`
  `getContractById(int contractId)`
  `byte[]`
  `getContractCard2Pdf(int contractId, String type)`
  `Document`
  `getContractCardDoc(int contractId)`
  `List<String[]>`
  `getContractCardTypes(int contractId)`
  `String`
  `getContractFullCard(int contractId)`
  `ContractInfo`
  `getContractInfo(int contractId)`
  `List<ContractGroup>`
  `getContractLabelTreeItemList(int contractId)`
  `String`
  `getContractStatisticPassword(int contractId)`
  Deprecated.
  `List<IdTitle>`
  `getParameterList(int parameterTypeId)`
  `Pair<List<IdTitle>,Set<Integer>>`
  `groupsGet(int contractId)`
  `BigDecimal`
  `limit(int contractId, Pageable<LimitLogItem> log, List<LimitChangeTask> taskList)`
  `void`
  `modeLog(Pageable<ContractMode> result, int contractId)`
  `Pair<List<IdTitle>,List<IdTitle>>`
  `moduleList(int contractId)`
  `void`
  `searchContractByAddressParam(Pageable<ParameterSearchedObject<Contract>> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, int streetId, int houseId, String house, String flat, String room)`
  `void`
  `searchContractByDateParam(Pageable<Contract> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, Date dateFrom, Date dateTo)`
  `void`
  `searchContractByEmailParam(Pageable<Contract> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, String email)`
  `void`
  `searchContractByObjectAddressParam(Pageable<ParameterSearchedObject<Contract>> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, int streetId, String house, String flat, String room)`
  Осуществляет поиск договоров по адресным параметам объекта, либо заданным аргументом, либо, если таковых нет, определяет адресный параметр объекта в конфигурции биллинга.
  `void`
  `searchContractByPhoneParam(Pageable<Contract> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, String phone)`
  `void`
  `searchContractByTextParam(Pageable<Contract> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, String value)`
  `void`
  `searchContractByTitleComment(Pageable<IdTitle> searchResult, String title, String comment, ContractDAO.SearchOptions searchOptions)`
  `void`
  `updateContractDateTo(int contractId, Date date)`
  `void`
  `updateContractPassword(int contractId, String value, boolean generate)`
  `void`
  `updateFace(int contractId, int face)`
  `void`
  `updateLabels(int contractId, Set<Integer> labelIds)`
  `void`
  `updateLimit(int contractId, BigDecimal limit, int days, String comment)`
  `void`
  `updateMode(int contractId, int mode)`
  `void`
  `updateModule(int contractId, int moduleId, String command)`

  ### Methods inherited from class ru.bgcrm.plugin.bgbilling.dao.BillingDAO

  `doRequest, getDbInfo, getPage, getParameterId, getVersion, linesToString, readJsonValue, setPage`

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

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

- ## Field Details

  - ### KERNEL_CONTRACT_API

    public static final String KERNEL_CONTRACT_API
    See Also:
      - Constant Field Values

  - ### KERNEL_CONTRACT_LIMIT

    public static final String KERNEL_CONTRACT_LIMIT
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ContractDAO

    public ContractDAO(User user, String billingId)

- ## Method Details

  - ### copyParametersToAllContracts

    public static void copyParametersToAllContracts(Connection con, User user, int customerId) throws Exception
    Throws:
      `Exception`

  - ### getContractById

    public Contract getContractById(int contractId)

  - ### searchContractByTitleComment

    public void searchContractByTitleComment(Pageable<IdTitle> searchResult, String title, String comment, ContractDAO.SearchOptions searchOptions)

  - ### updateContractDateTo

    public void updateContractDateTo(int contractId, Date date)

  - ### searchContractByObjectAddressParam

    public void searchContractByObjectAddressParam(Pageable<ParameterSearchedObject<Contract>> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, int streetId, String house, String flat, String room)
    Осуществляет поиск договоров по адресным параметам объекта, либо заданным аргументом, либо, если таковых нет, определяет адресный параметр объекта в конфигурции биллинга.
    Parameters:
      `result` -
      `options` -
      `paramIds` - - необязательный параметр, коды адресных параметров
      `streetId` -
      `house` -
      `flat` -
      `room` -

  - ### searchContractByAddressParam

    public void searchContractByAddressParam(Pageable<ParameterSearchedObject<Contract>> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, int streetId, int houseId, String house, String flat, String room)

  - ### searchContractByTextParam

    public void searchContractByTextParam(Pageable<Contract> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, String value)

  - ### searchContractByPhoneParam

    public void searchContractByPhoneParam(Pageable<Contract> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, String phone)

  - ### searchContractByDateParam

    public void searchContractByDateParam(Pageable<Contract> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, Date dateFrom, Date dateTo)

  - ### searchContractByEmailParam

    public void searchContractByEmailParam(Pageable<Contract> result, ContractDAO.SearchOptions options, Set<Integer> paramIds, String email)

  - ### addSearchResult

    public void addSearchResult(Pageable<Contract> result, Page page, Request req)

  - ### createContract

    public Contract createContract(int patternId, Date date, String title, String customTitle, int superId) throws BGMessageException
    Throws:
      `BGMessageException`

  - ### faceLog

    public void faceLog(Pageable<ContractFace> result, int contractId)

  - ### updateFace

    public void updateFace(int contractId, int face)

  - ### modeLog

    public void modeLog(Pageable<ContractMode> result, int contractId)

  - ### updateMode

    public void updateMode(int contractId, int mode)

  - ### getContractLabelTreeItemList

    public List<ContractGroup> getContractLabelTreeItemList(int contractId)

  - ### groupsGet

    public Pair<List<IdTitle>,Set<Integer>> groupsGet(int contractId)

  - ### updateLabels

    public void updateLabels(int contractId, Set<Integer> labelIds)

  - ### additionalActionList

    public List<IdTitle> additionalActionList(int contractId)

  - ### executeAdditionalAction

    public String executeAdditionalAction(int contractId, int actionId)

  - ### moduleList

    public Pair<List<IdTitle>,List<IdTitle>> moduleList(int contractId)

  - ### updateModule

    public void updateModule(int contractId, int moduleId, String command) throws BGMessageException
    Throws:
      `BGMessageException`

  - ### limit

    public BigDecimal limit(int contractId, Pageable<LimitLogItem> log, List<LimitChangeTask> taskList)

  - ### updateLimit

    public void updateLimit(int contractId, BigDecimal limit, int days, String comment)

  - ### deleteLimitTask

    public void deleteLimitTask(int contractId, int id)

  - ### updateContractPassword

    public void updateContractPassword(int contractId, String value, boolean generate)

  - ### getContractFullCard

    public String getContractFullCard(int contractId)

  - ### getContractCardDoc

    public Document getContractCardDoc(int contractId)

  - ### getContractCardTypes

    public List<String[]> getContractCardTypes(int contractId)

  - ### getContractCard2Pdf

    public byte[] getContractCard2Pdf(int contractId, String type)

  - ### bgbillingOpenContract

    public void bgbillingOpenContract(int contractId)

  - ### bgbillingUpdateContractTitleAndComment

    public void bgbillingUpdateContractTitleAndComment(int contractId, String comment, int patid)

  - ### dateToUpdate

    public void dateToUpdate(int contractId, Date dateTo)

  - ### getParameterList

    public List<IdTitle> getParameterList(int parameterTypeId)

  - ### getContractInfo

    public ContractInfo getContractInfo(int contractId) throws Exception
    Throws:
      `Exception`

  - ### copyParametersToBilling

    public void copyParametersToBilling(Connection con, int customerId, int contractId, String title) throws Exception
    Throws:
      `Exception`

  - ### copyObjectParamsToContract

    public void copyObjectParamsToContract(Connection con, String copyParamsMapping, int objectId, int contractId, Customer customer) throws SQLException, BGMessageException
    Throws:
      `SQLException`
      `BGMessageException`

  - ### getContractStatisticPassword

    @Deprecated public String getContractStatisticPassword(int contractId)
    Deprecated.