Package ru.bgcrm.util

Class AddressUtils

java.lang.Object
ru.bgcrm.util.AddressUtils

public class AddressUtils extends Object
  • Field Details

  • Constructor Details

    • AddressUtils

      public AddressUtils()
  • Method Details

    • normalizeAddress

      public static String normalizeAddress(String address)
    • buildReadableAddress

      public static String buildReadableAddress(ParamAddressValue val)
    • buildAddressValueWithoutEmptyStrings

      public static String buildAddressValueWithoutEmptyStrings(ParamAddressValue val)
    • buildAddressValue

      public static String buildAddressValue(ParamAddressValue val)
    • buildAddressValue

      public static String buildAddressValue(ParameterAddressValue value, Connection con) throws BGException
      Throws:
      BGException
    • buildAddressValue

      public static String buildAddressValue(ParameterAddressValue value, Connection con, String formatName) throws BGException
      Throws:
      BGException
    • getHouseFlat

      public static String getHouseFlat(String value)
    • getHouseRoom

      public static String getHouseRoom(String value)
    • getCityIds

      public static Integer[] getCityIds(int mainCityId)
    • isGPON

      public static boolean isGPON(Connection con, int houseId) throws BGException
      Throws:
      BGException
    • isRadio

      public static boolean isRadio(Connection con, int houseId) throws BGException
      Throws:
      BGException
    • isGPONext

      public static boolean isGPONext(Connection con, int houseId) throws BGException
      Throws:
      BGException
    • isDRS

      public static boolean isDRS(Connection con, int houseId) throws BGException
      Throws:
      BGException
    • isPhoton

      public static boolean isPhoton(Connection con, int houseId) throws BGException
      Throws:
      BGException
    • isFTTH_PON

      public static boolean isFTTH_PON(Connection con, int houseId) throws BGException
      Throws:
      BGException
    • getFirstParameterAddressValue

      public static ParameterAddressValue getFirstParameterAddressValue(Connection connection, int objectId, int paramId) throws BGException
      Throws:
      BGException
    • checkValidParamAddress

      public static void checkValidParamAddress(int idObject, int idParam, Connection con) throws BGException
      Throws:
      BGException
    • fromSetup

      public static String fromSetup(String key, String defaultValue)
    • getOnecCityId

      public static int getOnecCityId(int cityId)
      Получение id города в справочнике 1с по коду города адресного справочника ЕРП
      Parameters:
      cityId - коду города в адресном справочнике ЕРП
      Returns:
      cityId or -1 if not found
    • getObjectAddress

      @Nullable public static @Nullable ParameterAddressValue getObjectAddress(int objectId, Connection connection, int addressParameterId)
    • isEmptyAddress

      public static boolean isEmptyAddress(ParameterAddressValue address)
      Проверяет, является ли адрес пустым значением
      Parameters:
      address - проверяемый адрес
      Returns:
      true если адрес пустой
    • flatInRange

      public static boolean flatInRange(String flat, int from, int to)
      Проверяет, входит ли указанный номер квартиры в заданный диапазон квартир.
      Parameters:
      flat - номер проверяемой квартиры
      from - начало диапазона квартир
      to - окончание диапазона квартир
      Returns:
      {boolean} true если квартира входит в диапазон.
    • compareFlats

      public static Integer compareFlats(String firstFlat, String secondFlat)
      Сравнение номеров двух квартир.
      Parameters:
      firstFlat - первая квартира
      secondFlat - вторая квартира
      Returns:
      {Integer} возвращает 0, если номера квартир совпадают.