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

# Class ContractParamDAO

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

public class ContractParamDAO extends BillingDAO

- ## Field Summary

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

  `dbInfo, jsonMapper, jsonTypeFactory, transferData, user`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContractParamDAO(User user, String billingId)`
  `ContractParamDAO(User user, DBInfo dbInfo)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `copyObjectParamsToContract(Connection con, int objectId, int contractId)`
  `void`
  `copyObjectParamToContract(int objectId, int contractId, int fromParamId, Connection con)`
  `ParamAddressValue`
  `getAddressParam(int contractId, int paramId)`
  `Document`
  `getContractParams(int contractId)`
  Использовать только для генерации документов! Кэшированние результата убрано, т.к.
  `Date`
  `getDateParam(int contractId, int paramId)`
  `ParamEmailValue`
  `getEmailParam(int contractId, int paramId)`
  `ParamList`
  `getListParamValue(int contractId, int paramId)`
  `List<ContractParameter>`
  `getParameterList(int contractId)`
  Вызывает `getParameterListWithDir(int, boolean, boolean)` с false, false.
  `Pair<ParamList,List<ContractParameter>>`
  `getParameterListWithDir(int contractId, boolean loadGroups, boolean onlyGroup)`
  Возвращает параметры договора со справочниками.
  `List<IdTitle>`
  `getParamListValues(int paramId)`
  `ParameterPhoneValue`
  `getPhoneParam(int contractId, int paramId)`
  `String`
  `getTextParam(int contractId, int paramId)`
  `static ParameterAddressValue`
  `toCrmObject(ParamAddressValue item, Connection con)`
  `void`
  `updateAddressParameter(int contractId, int paramId, ParamAddressValue address)`
  `void`
  `updateDateParameter(int contractId, int paramId, String value)`
  `void`
  `updateDateParameter(int contractId, int paramId, Date value)`
  `void`
  `updateEmailParameter(int contractId, int paramId, Collection<ParameterEmailValue> emailValues)`
  `void`
  `updateFlagParameter(int contractId, int paramId, boolean value)`
  `void`
  `updateListParameter(int contractId, int paramId, int value)`
  `void`
  `updateListParameter(int contractId, int paramId, String value)`
  `void`
  `updateParameterGroup(int contractId, int groupId)`
  `void`
  `updatePhoneParameter(int contractId, int paramId, ParameterPhoneValue phoneValue)`
  `void`
  `updateTextParameter(int contractId, int paramId, String value)`

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

- ## Constructor Details

  - ### ContractParamDAO

    public ContractParamDAO(User user, String billingId)

  - ### ContractParamDAO

    public ContractParamDAO(User user, DBInfo dbInfo)

- ## Method Details

  - ### toCrmObject

    public static ParameterAddressValue toCrmObject(ParamAddressValue item, Connection con) throws SQLException
    Throws:
      `SQLException`

  - ### getParameterList

    public List<ContractParameter> getParameterList(int contractId)
    Вызывает `getParameterListWithDir(int, boolean, boolean)` с false, false.
    Parameters:
      `contractId` -
    Returns:

  - ### getParameterListWithDir

    public Pair<ParamList,List<ContractParameter>> getParameterListWithDir(int contractId, boolean loadGroups, boolean onlyGroup)
    Возвращает параметры договора со справочниками.
    Parameters:
      `contractId` - код договора.
      `loadGroups` - загружать группы.
      `onlyGroup` - учитывать группу параметров договора.
    Returns:

  - ### getContractParams

    public Document getContractParams(int contractId)
    Использовать только для генерации документов! Кэшированние результата убрано, т.к. потенциально может съесть много памяти.
    Parameters:
      `contractId` -
    Returns:

  - ### getTextParam

    public String getTextParam(int contractId, int paramId)

  - ### getDateParam

    public Date getDateParam(int contractId, int paramId)

  - ### getParamListValues

    public List<IdTitle> getParamListValues(int paramId)

  - ### getPhoneParam

    public ParameterPhoneValue getPhoneParam(int contractId, int paramId)

  - ### getEmailParam

    public ParamEmailValue getEmailParam(int contractId, int paramId)

  - ### getAddressParam

    public ParamAddressValue getAddressParam(int contractId, int paramId)

  - ### getListParamValue

    public ParamList getListParamValue(int contractId, int paramId)

  - ### updateFlagParameter

    public void updateFlagParameter(int contractId, int paramId, boolean value)

  - ### updateTextParameter

    public void updateTextParameter(int contractId, int paramId, String value)

  - ### updateListParameter

    public void updateListParameter(int contractId, int paramId, int value)

  - ### updateListParameter

    public void updateListParameter(int contractId, int paramId, String value)

  - ### updateAddressParameter

    public void updateAddressParameter(int contractId, int paramId, ParamAddressValue address)

  - ### updateDateParameter

    public void updateDateParameter(int contractId, int paramId, Date value)

  - ### updateDateParameter

    public void updateDateParameter(int contractId, int paramId, String value)

  - ### updatePhoneParameter

    public void updatePhoneParameter(int contractId, int paramId, ParameterPhoneValue phoneValue)

  - ### updateEmailParameter

    public void updateEmailParameter(int contractId, int paramId, Collection<ParameterEmailValue> emailValues)

  - ### updateParameterGroup

    public void updateParameterGroup(int contractId, int groupId)

  - ### copyObjectParamsToContract

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

  - ### copyObjectParamToContract

    public void copyObjectParamToContract(int objectId, int contractId, int fromParamId, Connection con) throws SQLException, BGMessageException
    Throws:
      `SQLException`
      `BGMessageException`