Class ProcessDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.process.ProcessDAO

public class ProcessDAO extends CommonDAO
  • Field Details

  • Constructor Details

    • ProcessDAO

      public ProcessDAO(Connection con)
    • ProcessDAO

      public ProcessDAO(Connection con, boolean history)
    • ProcessDAO

      public ProcessDAO(Connection con, boolean history, int userId)
  • Method Details

    • getProcessFromRs

      public static Process getProcessFromRs(ResultSet rs, String prefix) throws SQLException
      Throws:
      SQLException
    • getProcessFromRs

      public static Process getProcessFromRs(ResultSet rs) throws SQLException
      Throws:
      SQLException
    • getProcessGroups

      public Set<ProcessGroup> getProcessGroups(int processId)
    • getProcessExecutors

      public Set<ProcessExecutor> getProcessExecutors(int processId)
    • searchProcess

      public void searchProcess(SearchResult<Object[]> searchResult, List<String> aggregateValues, Queue queue, DynActionForm form) throws BGException
      Throws:
      BGException
    • getCountQuery

      public String getCountQuery(Queue queue, DynActionForm form) throws BGException
      Throws:
      BGException
    • addDateTimeFilter

      public void addDateTimeFilter(DynActionForm form, StringBuilder wherePart, String paramPrefix, String paramId, FilterParam filter)
    • addDateFilter

      public void addDateFilter(DynActionForm form, StringBuilder wherePart, String paramPrefix, String column, Date dateFromOnEmptyValue)
    • getProcess

      public Process getProcess(int id) throws BGException
      Throws:
      BGException
    • getProcessListByType

      public List<Process> getProcessListByType(Collection<Integer> typeIds, Boolean open) throws BGException
      Throws:
      BGException
    • getProcessList

      public List<Process> getProcessList(Collection<Integer> processIds) throws BGException
      Throws:
      BGException
    • updateProcessGroups

      public void updateProcessGroups(Set<ProcessGroup> processGroups, int processId) throws BGException
      Throws:
      BGException
    • updateProcessGroups

      public void updateProcessGroups(Set<ProcessGroup> processGroups, int processId, boolean needDeleteOld) throws BGException
      Throws:
      BGException
    • updateProcessExecutors

      @Deprecated public void updateProcessExecutors(int processId, Set<Integer> executorIds) throws BGException
      Deprecated.
      Устаревшая функция - исполнители устанавливаются без привязки к группам, привязка восстанавливается затем по членству пользователей в группах. Использовать updateProcessExecutors(Set, int).
      Throws:
      BGException
    • updateProcessExecutors

      public void updateProcessExecutors(Set<ProcessExecutor> processExecutors, int processId) throws BGException
      Throws:
      BGException
    • updateProcessExecutors

      public void updateProcessExecutors(Set<ProcessExecutor> processExecutors, int processId, boolean needClearGroups) throws BGException
      Throws:
      BGException
    • updateProcess

      public void updateProcess(Process process) throws BGException
      Throws:
      BGException
    • deleteProcess

      public void deleteProcess(int processId) throws BGException
      Throws:
      BGException
    • processIdInvert

      public void processIdInvert(Process process) throws BGException
      Throws:
      BGException
    • searchProcessListByAddress

      public void searchProcessListByAddress(SearchResult<AddressSearchedObject<Process>> searchResult, Set<Integer> typeIds, Set<Integer> addressParamIdList, int houseId, String houseFlat, String houseRoom) throws BGException
      Выбирает процессы по адресному параметру.
      Parameters:
      searchResult -
      addressParamIdList -
      houseId - код дома
      houseFlat - квартира
      houseRoom - комната
      Throws:
      SQLException
      BGException
    • searchProcessListForMessage

      public void searchProcessListForMessage(SearchResult<Process> searchResult, String from, List<CommonObjectLink> links, Boolean open) throws BGException
      Выбор списка процесс.
      Parameters:
      searchResult -
      from -
      Throws:
      SQLException
      BGException
    • searchProcessListForUser

      public void searchProcessListForUser(SearchResult<Process> searchResult, int userId, Boolean open) throws BGException
      Выбор списка процесс.
      Parameters:
      searchResult -
      Throws:
      BGException
    • searchProcessLog

      public void searchProcessLog(ProcessType processType, int processId, SearchResult<EntityLogItem> result) throws BGException
      Throws:
      BGException
    • findProcessesByListParam

      public Set<Process> findProcessesByListParam(int processType, int status, int paramId, List<Integer> value) throws BGException
      Throws:
      BGException
    • findProcessesByCreator

      public Set<Process> findProcessesByCreator(int processType, int userId, int statusId, int limit)
    • findProcessesByExecutorUserId

      public Set<Process> findProcessesByExecutorUserId(int processType, int roleId, int userId, Set<Integer> statusIds, int limit)
      Поиск процессов по userId исполнителя
      Parameters:
      processType - тип искомых процессов
      roleId - роль исполнителя, в случае отрицательного значения параметр в запросе не участвует
      userId - ID пользователя исполнителя
      statusIds - список допустимых ID статусов
      limit - количество записей
    • findProcessesByCreator

      public Set<Process> findProcessesByCreator(int processType, int userId, Set<Integer> statusIds, int limit)
    • findProcesses

      public Set<Process> findProcesses(int processType, Set<Integer> statuses, int limit)
    • findProcessAtAddress

      public Set<Process> findProcessAtAddress(int houseId, int processTypeId, List<Integer> excludedStatuses) throws BGException
      Throws:
      BGException
    • findProcessesAtTextParam

      public SearchResult<Process> findProcessesAtTextParam(int parameterId, @NotNull @NotNull String parameterValue, @NotNull @NotNull Set<Integer> typesFilter, @NotNull @NotNull SearchResult<Process> result)
      Поиск процессов по точному значению текстового параметра
      Parameters:
      parameterId - ID параметра
      parameterValue - предполагаемое значение параметра
      typesFilter - фильтр по типам процессов, если пустой, то тип процесса будет игнорироваться
    • findProcessesAtRegexTextParam

      public SearchResult<Process> findProcessesAtRegexTextParam(int parameterId, @NotNull @NotNull String parameterValue, @NotNull @NotNull Set<Integer> typesFilter, @NotNull @NotNull SearchResult<Process> result)
      Поиск процессов по похожему значению текстового параметра
      Parameters:
      parameterId - ID параметра
      parameterValue - предполагаемое значение параметра
      typesFilter - фильтр по типам процессов, если пустой, то тип процесса будет игнорироваться
    • findProcessesByDateAtDateTimeParam

      public SearchResult<Process> findProcessesByDateAtDateTimeParam(int parameterId, @NotNull @NotNull Date parameterValue, @NotNull @NotNull Set<Integer> typesFilter, @NotNull @NotNull SearchResult<Process> result)
      Поиск процессов по точному значению календарного параметра
      Parameters:
      parameterId - ID параметра
      parameterValue - предполагаемое значение параметра
      typesFilter - фильтр по типам процессов, если пустой, то тип процесса будет игнорироваться
    • updateProcessOrder

      public void updateProcessOrder(int processId, int newOrder)
    • findProcessesByTypesAndStatuses

      public SearchResult<Process> findProcessesByTypesAndStatuses(Set<Integer> processTypes, Set<Integer> statuses, @NotNull @NotNull SearchResult<Process> result)
    • findProcessesByPhoneValue

      public SearchResult<Process> findProcessesByPhoneValue(Set<Integer> processTypes, Set<Integer> statuses, Set<Integer> paramIds, ParameterPhoneValue phoneValue)