我正在尝试了解如何扩展 Broadleaf,以便可以添加多个履行地点(仓库)。我知道这在 Broadleaf 的商业版中可用,但我买不起...... :-)
我计划添加几个表,例如 blc_ext_fulfilment_locations (location_id,location_name) 和 blc_ext_fulfilment_location_inventory (location_id,sku_id,quantity)。
问题是哪个是正确的扩展对象- http://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/inventory中提到的 InventoryServiceImpl 或 InventoryServiceExtensionHandler 或 CheckAvailabilityActivity
我假设我应该扩展 InventoryServiceImpl,但我无法在此调用extensionManager.getProxy().retrieveQuantitiesAvailable中了解如何从代理实际调用 DAO 。
下面是相关代码:
@Service("blInventoryService")
public class InventoryServiceImpl implements ContextualInventoryService {
...
@Resource(name = "blInventoryServiceExtensionManager")
protected InventoryServiceExtensionManager extensionManager;
...
@Override
public Map<Sku, Integer> retrieveQuantitiesAvailable(Collection<Sku> skus, Map<String, Object> context) {
ExtensionResultHolder<Map<Sku, Integer>> holder = new ExtensionResultHolder<Map<Sku, Integer>>();
ExtensionResultStatusType res = extensionManager.getProxy().retrieveQuantitiesAvailable(skus, context, holder);
...
}
...
}