Class B2BOrdersController
java.lang.Object
de.hybris.platform.b2b.occ.v2.controllers.BaseController
de.hybris.platform.b2b.occ.v2.controllers.B2BOrdersController
@Controller
@RequestMapping("#{ ${occ.rewrite.overlapping.paths.enabled:false} ? \'/{baseSiteId}/orgUsers/{userId}\' : \'/{baseSiteId}/users/{userId}\'}")
public class B2BOrdersController
extends BaseController
-
Field Summary
FieldsFields inherited from class de.hybris.platform.b2b.occ.v2.controllers.BaseController
BASIC_FIELD_SET, DEFAULT_CURRENT_PAGE, DEFAULT_FIELD_SET, DEFAULT_PAGE_SIZE, HEADER_TOTAL_COUNT, INVALID_REQUEST_BODY_ERROR_MESSAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCartFromOrder(String orderCode, String fields, javax.servlet.http.HttpServletResponse response) protected PlaceOrderDatacreatePlaceOrderData(ScheduleReplenishmentFormWsDTO scheduleReplenishmentForm) createReplenishmentOrder(String cartId, boolean termsChecked, ScheduleReplenishmentFormWsDTO scheduleReplenishmentForm, String fields) getBranchOrder(String code, String fields) getUserBranchOrderHistory(String statuses, String filters, int currentPage, int pageSize, String sort, String fields, javax.servlet.http.HttpServletResponse response) placeOrgOrder(String cartId, boolean termsChecked, String fields) protected voidvalidateAndAuthorizePayment(CartData cartData) protected voidvalidateCart(CartData cartData) protected voidvalidateScheduleReplenishmentForm(ScheduleReplenishmentFormWsDTO scheduleReplenishmentForm) protected voidvalidateStatusesEnumValue(String statuses) Checks if given statuses are validprotected voidvalidateTerms(boolean termsChecked) protected voidMethods inherited from class de.hybris.platform.b2b.occ.v2.controllers.BaseController
addPaginationField, getDataMapper, handleDuplicateUidException, handleErrorInternal, handleHttpMessageNotReadableException, handleModelNotFoundException, logParam, logParam, logParam, logValue, sanitize, setDataMapper, setTotalCountHeader, setTotalCountHeader, validate
-
Field Details
-
API_COMPATIBILITY_B2B_CHANNELS
- See Also:
-
userFacade
-
-
Constructor Details
-
B2BOrdersController
public B2BOrdersController()
-
-
Method Details
-
placeOrgOrder
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @PostMapping("/orders") @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2b.channels") @ResponseStatus(OK) @ResponseBody public OrderWsDTO placeOrgOrder(@RequestParam(required=true) String cartId, @RequestParam(required=true) boolean termsChecked, @RequestParam(required=false,defaultValue="DEFAULT") String fields) throws InvalidCartException, PaymentAuthorizationException -
createCartFromOrder
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP","ROLE_CLIENT"}) @PostMapping("/cartFromOrder") @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2b.channels") @ResponseBody @ResponseStatus(CREATED) public CartModificationListWsDTO createCartFromOrder(@RequestParam String orderCode, @RequestParam(defaultValue="DEFAULT") String fields, javax.servlet.http.HttpServletResponse response) -
createReplenishmentOrder
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @PostMapping(value="/replenishmentOrders", consumes="application/json", produces="application/json") @ResponseStatus(CREATED) @ResponseBody public ReplenishmentOrderWsDTO createReplenishmentOrder(@RequestParam(required=true) String cartId, @RequestParam(required=true) boolean termsChecked, @RequestBody(required=true) ScheduleReplenishmentFormWsDTO scheduleReplenishmentForm, @RequestParam(required=false,defaultValue="DEFAULT") String fields) throws InvalidCartException, PaymentAuthorizationException -
getUserBranchOrderHistory
@Secured({"ROLE_TRUSTED_CLIENT","ROLE_UNITORDERVIEWERGROUP"}) @GetMapping("/orgUnits/orders") @ResponseBody public OrderHistoryListWsDTO getUserBranchOrderHistory(@RequestParam(required=false) String statuses, @RequestParam(required=false) String filters, @RequestParam(defaultValue="0") int currentPage, @RequestParam(defaultValue="20") int pageSize, @RequestParam(required=false) String sort, @RequestParam(defaultValue="DEFAULT") String fields, javax.servlet.http.HttpServletResponse response) -
getBranchOrder
@Secured({"ROLE_TRUSTED_CLIENT","ROLE_UNITORDERVIEWERGROUP"}) @GetMapping("/orgUnits/orders/{code}") @ResponseBody public OrderWsDTO getBranchOrder(@PathVariable String code, @RequestParam(defaultValue="DEFAULT") String fields) -
validateStatusesEnumValue
Checks if given statuses are valid- Parameters:
statuses-
-
validateUser
protected void validateUser() -
validateTerms
protected void validateTerms(boolean termsChecked) -
validateScheduleReplenishmentForm
protected void validateScheduleReplenishmentForm(ScheduleReplenishmentFormWsDTO scheduleReplenishmentForm) -
validateAndAuthorizePayment
- Throws:
PaymentAuthorizationException
-
validateCart
- Throws:
InvalidCartException
-
createPlaceOrderData
protected PlaceOrderData createPlaceOrderData(ScheduleReplenishmentFormWsDTO scheduleReplenishmentForm)
-