Class CustomerDao
java.lang.Object
ru.bitel.bgbilling.kernel.contract.api.server.bean.customer.CustomerDao
public class CustomerDao
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTABLE_CUSTOMERstatic java.lang.StringTABLE_CUSTOMER_LINKstatic java.lang.StringTABLE_CUSTOMER_LOG -
Constructor Summary
Constructors Constructor Description CustomerDao(java.sql.Connection con) -
Method Summary
Modifier and Type Method Description voidaddCustomerLink(CustomerLink customerLink)CustomergetCustomer(int customerId)Строка в JSON формате с данными клиентаorg.json.JSONArraygetCustomerContracts(int customerId, java.time.LocalDateTime onTime)org.json.JSONObjectgetCustomerDataJson(int customerId)java.util.Optional<CustomerLink>getCustomerLink(int contractId, java.time.LocalDateTime dateTime)java.lang.StringgetCustomerParameter(int customerId, java.lang.String fieldKey)java.lang.StringgetCustomerParameterHistory(int customerId, java.lang.String fieldKey, int lastRecordCount)intgetNewCustomerId(Customer.CustomerType type)org.json.JSONArraysearchByKey(Customer.CustomerType customerType, java.lang.String key, java.lang.String value)org.json.JSONArraysearchByPassportRF(java.lang.String serial, java.lang.String number)voidsetCustomerLink(int contractId, int сustomerId, java.time.LocalDateTime linkDateTimeFrom)Установка связки клиент - договорbooleansetCustomerUnlinkContract(int contractId, java.time.LocalDateTime unlinkTime)java.lang.StringupdateCustomerFieldValue(int customerId, java.lang.String fieldKey, java.lang.String fieldValue, int userId)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
TABLE_CUSTOMER
public static final java.lang.String TABLE_CUSTOMER- See Also:
- Constant Field Values
-
TABLE_CUSTOMER_LOG
public static final java.lang.String TABLE_CUSTOMER_LOG- See Also:
- Constant Field Values
-
TABLE_CUSTOMER_LINK
public static final java.lang.String TABLE_CUSTOMER_LINK- See Also:
- Constant Field Values
-
-
Constructor Details
-
CustomerDao
public CustomerDao(java.sql.Connection con)
-
-
Method Details
-
getCustomerLink
public java.util.Optional<CustomerLink> getCustomerLink(int contractId, java.time.LocalDateTime dateTime) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
addCustomerLink
public void addCustomerLink(CustomerLink customerLink) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getNewCustomerId
public int getNewCustomerId(Customer.CustomerType type) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
updateCustomerFieldValue
public java.lang.String updateCustomerFieldValue(int customerId, java.lang.String fieldKey, java.lang.String fieldValue, int userId) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getCustomerDataJson
public org.json.JSONObject getCustomerDataJson(int customerId) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getCustomer
Строка в JSON формате с данными клиента- Parameters:
customerId-- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
searchByKey
public org.json.JSONArray searchByKey(Customer.CustomerType customerType, java.lang.String key, java.lang.String value) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
searchByPassportRF
public org.json.JSONArray searchByPassportRF(java.lang.String serial, java.lang.String number) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
setCustomerLink
public void setCustomerLink(int contractId, int сustomerId, java.time.LocalDateTime linkDateTimeFrom) throws ru.bitel.bgbilling.common.BGExceptionУстановка связки клиент - договор- Parameters:
contractId- id договора\u0441ustomerId- id кастомераlinkDateTimeFrom- время привязки- Throws:
ru.bitel.bgbilling.common.BGException
-
getCustomerContracts
public org.json.JSONArray getCustomerContracts(int customerId, java.time.LocalDateTime onTime) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
setCustomerUnlinkContract
public boolean setCustomerUnlinkContract(int contractId, java.time.LocalDateTime unlinkTime) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getCustomerParameterHistory
public java.lang.String getCustomerParameterHistory(int customerId, java.lang.String fieldKey, int lastRecordCount) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getCustomerParameter
public java.lang.String getCustomerParameter(int customerId, java.lang.String fieldKey) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-