Class ContractParamDAO
java.lang.Object
ru.bgcrm.plugin.bgbilling.dao.BillingDAO
ru.bgcrm.plugin.bgbilling.proto.dao.ContractParamDAO
-
Field Summary
Fields inherited from class BillingDAO
dbInfo, jsonMapper, jsonTypeFactory, transferData, user -
Constructor Summary
ConstructorsConstructorDescriptionContractParamDAO(User user, String billingId) ContractParamDAO(User user, DBInfo dbInfo) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyObjectParamsToContract(Connection con, int objectId, int contractId) voidcopyObjectParamToContract(int objectId, int contractId, int fromParamId, Connection con) getAddressParam(int contractId, int paramId) getContractParams(int contractId) Returns the raw contract parameters document.getDateParam(int contractId, int paramId) getEmailParam(int contractId, int paramId) getListParamValue(int contractId, int paramId) getParameterList(int contractId) Returns the contract's parameters, without loading the group directorygetParameterListWithDir(int contractId, boolean loadGroups, boolean onlyGroup) Returns the contract's parameters together with the group directorygetParamListValues(int paramId) getPhoneParam(int contractId, int paramId) getTextParam(int contractId, int paramId) static ParameterAddressValuetoCrmObject(ParamAddressValue item, Connection con) voidupdateAddressParameter(int contractId, int paramId, ParamAddressValue address) voidupdateDateParameter(int contractId, int paramId, String value) voidupdateDateParameter(int contractId, int paramId, Date value) voidupdateEmailParameter(int contractId, int paramId, Collection<ParameterEmailValue> emailValues) voidupdateFlagParameter(int contractId, int paramId, boolean value) voidupdateListParameter(int contractId, int paramId, int value) voidupdateListParameter(int contractId, int paramId, String value) voidupdateParameterGroup(int contractId, int groupId) voidupdatePhoneParameter(int contractId, int paramId, ParameterPhoneValue phoneValue) voidupdateTextParameter(int contractId, int paramId, String value) Methods inherited from class BillingDAO
doRequest, getDbInfo, getPage, getVersion, linesToString, readJsonValue, setPage
-
Constructor Details
-
ContractParamDAO
-
ContractParamDAO
-
-
Method Details
-
toCrmObject
public static ParameterAddressValue toCrmObject(ParamAddressValue item, Connection con) throws SQLException - Throws:
SQLException
-
getParameterList
Returns the contract's parameters, without loading the group directory- Parameters:
contractId- the contract ID- Returns:
- the parameter list
-
getParameterListWithDir
public Pair<ParamList, List<ContractParameter>> getParameterListWithDir(int contractId, boolean loadGroups, boolean onlyGroup) Returns the contract's parameters together with the group directory- Parameters:
contractId- the contract IDloadGroups- whether to load the groupsonlyGroup- whether to consider the contract's parameter group- Returns:
- the group directory and the parameter list
-
getContractParams
Returns the raw contract parameters document. Use only for document generation, the result is not cached since it may consume a lot of memory- Parameters:
contractId- the contract ID- Returns:
- the document
-
getTextParam
-
getDateParam
-
getParamListValues
-
getPhoneParam
-
getEmailParam
-
getAddressParam
-
getListParamValue
-
updateFlagParameter
public void updateFlagParameter(int contractId, int paramId, boolean value) -
updateTextParameter
-
updateListParameter
public void updateListParameter(int contractId, int paramId, int value) -
updateListParameter
-
updateAddressParameter
-
updateDateParameter
-
updateDateParameter
-
updatePhoneParameter
-
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:
SQLExceptionBGMessageException
-
copyObjectParamToContract
public void copyObjectParamToContract(int objectId, int contractId, int fromParamId, Connection con) throws SQLException, BGMessageException - Throws:
SQLExceptionBGMessageException
-