Class DefaultB2BApproverService
- java.lang.Object
-
- de.hybris.platform.b2b.services.impl.DefaultB2BApproverService
-
- All Implemented Interfaces:
B2BApproverService<B2BCustomerModel>
public class DefaultB2BApproverService extends java.lang.Object implements B2BApproverService<B2BCustomerModel>
Default implementation of theB2BApproverService.- Spring Bean ID:
- b2bApproverService
-
-
Constructor Summary
Constructors Constructor Description DefaultB2BApproverService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description B2BCustomerModeladdApproverToCustomer(java.lang.String user, java.lang.String approver)Add an approver for a given user and return the updatedB2BCustomerModelobject updated with approver detailsB2BCustomerModeladdApproverToUnit(java.lang.String unitUid, java.lang.String approverUid)Add approver to given unitSearchPageData<B2BCustomerModel>findPagedApproversForUnitByGroupMembership(PageableData pageableData, java.lang.String unitUid, java.lang.String... usergroupUid)Gets list ofSearchPageDataB2BCustomerModelprovided with required pagination parameters withPageableDatajava.util.List<UserModel>getAccountManagerApprovers(PrincipalModel principal)Gets the list of account manager approvers.java.util.List<B2BCustomerModel>getAllActiveApprovers(B2BCustomerModel principal)Gets all the active approvers for a given customerjava.util.List<B2BCustomerModel>getAllApprovers(B2BCustomerModel principal)Gets the approvers assigned to principal(customer) directly or as approver groups including its parent unit and all the units assigned to its parent up to the root unit.protected B2BCommerceUnitServicegetB2bCommerceUnitService()protected B2BUnitService<B2BUnitModel,B2BCustomerModel>getB2bUnitService()protected java.util.List<B2BCustomerModel>getImmediateApprovers(PrincipalModel principal)Gets the immediate approvers for either a B2BCustomer or B2BUnit (the principal) which also includes the members of the principal's approver groups.protected ModelServicegetModelService()protected PagedB2BCustomerDao<B2BCustomerModel>getPagedB2BCustomerDao()protected UserServicegetUserService()booleanisMemberOf(PrincipalGroupModel principal, java.lang.String userGroupUid)Deprecated.Since 4.4.protected java.lang.StringprincipalListToUidString(java.util.List<B2BCustomerModel> allApprovers)Gets the id's for a list of approvers.B2BCustomerModelremoveApproverFromCustomer(java.lang.String user, java.lang.String approver)Remove an approver for a given user and return the updatedB2BCustomerModelobject updated with approver detailsB2BCustomerModelremoveApproverFromUnit(java.lang.String unitUid, java.lang.String approverUid)If an approver is a member of the B2BUnit remove b2bapprovergroup role, if the approver is a member of the current branch of units the approver will be removed fromB2BUnitModel.getApprovers()relationshipvoidsetB2bCommerceUnitService(B2BCommerceUnitService b2bCommerceUnitService)voidsetB2bUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)voidsetModelService(ModelService modelService)voidsetPagedB2BCustomerDao(PagedB2BCustomerDao<B2BCustomerModel> pagedB2BCustomerDao)voidsetUserService(UserService userService)
-
-
-
Method Detail
-
getAllApprovers
public java.util.List<B2BCustomerModel> getAllApprovers(B2BCustomerModel principal)
Description copied from interface:B2BApproverServiceGets the approvers assigned to principal(customer) directly or as approver groups including its parent unit and all the units assigned to its parent up to the root unit.- Specified by:
getAllApproversin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
principal- the principal (customer)- Returns:
- A collection of approvers
-
getAllActiveApprovers
public java.util.List<B2BCustomerModel> getAllActiveApprovers(B2BCustomerModel principal)
Description copied from interface:B2BApproverServiceGets all the active approvers for a given customer- Specified by:
getAllActiveApproversin interfaceB2BApproverService<B2BCustomerModel>- Returns:
- list of approvers
-
principalListToUidString
protected java.lang.String principalListToUidString(java.util.List<B2BCustomerModel> allApprovers)
Gets the id's for a list of approvers.- Parameters:
allApprovers-- Returns:
- String list of approver id's
-
getImmediateApprovers
protected java.util.List<B2BCustomerModel> getImmediateApprovers(PrincipalModel principal)
Gets the immediate approvers for either a B2BCustomer or B2BUnit (the principal) which also includes the members of the principal's approver groups.- Parameters:
principal- the principal- Returns:
- the immediate approvers - a list of
B2BCustomerModel
-
getAccountManagerApprovers
public java.util.List<UserModel> getAccountManagerApprovers(PrincipalModel principal)
Description copied from interface:B2BApproverServiceGets the list of account manager approvers.- Specified by:
getAccountManagerApproversin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
principal- the principal- Returns:
- the approvers
-
addApproverToCustomer
public B2BCustomerModel addApproverToCustomer(java.lang.String user, java.lang.String approver)
Description copied from interface:B2BApproverServiceAdd an approver for a given user and return the updatedB2BCustomerModelobject updated with approver details- Specified by:
addApproverToCustomerin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
user- A unique identifier forB2BCustomerModelrepresenting a userapprover- A unique identifier forB2BCustomerModelrepresenting a approver- Returns:
- Updated
B2BCustomerModelobject updated with approvers
-
removeApproverFromCustomer
public B2BCustomerModel removeApproverFromCustomer(java.lang.String user, java.lang.String approver)
Description copied from interface:B2BApproverServiceRemove an approver for a given user and return the updatedB2BCustomerModelobject updated with approver details- Specified by:
removeApproverFromCustomerin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
user- A unique identifier forB2BCustomerModelrepresenting a userapprover- A unique identifier forB2BCustomerModelrepresenting a approver- Returns:
- Updated
B2BCustomerModelobject removed with approver
-
isMemberOf
@Deprecated(since="4.4") public boolean isMemberOf(PrincipalGroupModel principal, java.lang.String userGroupUid)
Deprecated.Since 4.4.Description copied from interface:B2BApproverServiceChecks if the principal is a member of the user group.- Specified by:
isMemberOfin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
principal- the principaluserGroupUid- the uid of the user group to check if the principal is a memeber of.- Returns:
- true, if is member of
-
addApproverToUnit
public B2BCustomerModel addApproverToUnit(java.lang.String unitUid, java.lang.String approverUid)
Description copied from interface:B2BApproverServiceAdd approver to given unit- Specified by:
addApproverToUnitin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
unitUid- A unique identifier forB2BUnitModelapproverUid- A unique identifier forB2BCustomerModelwho is a approver- Returns:
- Updated
B2BCustomerModelobject after adding approver to customer.
-
removeApproverFromUnit
public B2BCustomerModel removeApproverFromUnit(java.lang.String unitUid, java.lang.String approverUid)
Description copied from interface:B2BApproverServiceIf an approver is a member of the B2BUnit remove b2bapprovergroup role, if the approver is a member of the current branch of units the approver will be removed fromB2BUnitModel.getApprovers()relationship- Specified by:
removeApproverFromUnitin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
unitUid- A unique identifier ofB2BUnitModelapproverUid- A unique identifier ofB2BCustomerModel- Returns:
- An approver who was removed from a
B2BUnitModel.getApprovers()
-
findPagedApproversForUnitByGroupMembership
public SearchPageData<B2BCustomerModel> findPagedApproversForUnitByGroupMembership(PageableData pageableData, java.lang.String unitUid, java.lang.String... usergroupUid)
Description copied from interface:B2BApproverServiceGets list ofSearchPageDataB2BCustomerModelprovided with required pagination parameters withPageableData- Specified by:
findPagedApproversForUnitByGroupMembershipin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
pageableData- Pagination informationunitUid- A unique identifier ofB2BUnitModelusergroupUid- A unique identifier ofB2BUserGroupModel- Returns:
- Collection of paginated
B2BCostCenterModelobjects
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getB2bUnitService
protected B2BUnitService<B2BUnitModel,B2BCustomerModel> getB2bUnitService()
-
setB2bUnitService
public void setB2bUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getB2bCommerceUnitService
protected B2BCommerceUnitService getB2bCommerceUnitService()
-
setB2bCommerceUnitService
public void setB2bCommerceUnitService(B2BCommerceUnitService b2bCommerceUnitService)
-
getPagedB2BCustomerDao
protected PagedB2BCustomerDao<B2BCustomerModel> getPagedB2BCustomerDao()
-
setPagedB2BCustomerDao
public void setPagedB2BCustomerDao(PagedB2BCustomerDao<B2BCustomerModel> pagedB2BCustomerDao)
-
-