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
  • Field Details

  • 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, 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)
      Search contracts by phone parameters
      Parameters:
      result - result
      options - contract search options
      paramIds - parameter IDs
      phone - SQL LIKE filter with 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.