wrapDetails(model, request);
}
@Override
public FulfillmentGroupRequest unwrap(HttpServletRequest request, ApplicationContext appContext) {
FulfillmentGroupRequest fulfillmentGroupRequest = new FulfillmentGroupRequest();
List<FulfillmentGroupItemRequest> fulfillmentGroupItemRequests = new ArrayList<FulfillmentGroupItemRequest>();
for (FulfillmentGroupItemWrapper wrapper : this.fulfillmentGroupItems) {
fulfillmentGroupItemRequests.add(wrapper.unwrap(request, appContext));
}
fulfillmentGroupRequest.setFulfillmentGroupItemRequests(fulfillmentGroupItemRequests);
OrderService orderService = (OrderService) appContext.getBean("blOrderService");
Order order = orderService.findOrderById(this.orderId);
if (order != null) {
fulfillmentGroupRequest.setOrder(order);
}
if (this.address != null) {
fulfillmentGroupRequest.setAddress(this.address.unwrap(request, appContext));
}
if (this.phone != null) {
fulfillmentGroupRequest.setPhone(this.phone.unwrap(request, appContext));
}
if (this.fulfillmentOption != null && this.fulfillmentOption.getId() != null) {
FulfillmentOptionService fulfillmentOptionService = (FulfillmentOptionService) appContext.getBean("blFulfillmentOptionService");
FulfillmentOption option = fulfillmentOptionService.readFulfillmentOptionById(this.fulfillmentOption.getId());
fulfillmentGroupRequest.setOption(option);
}
return fulfillmentGroupRequest;
}