use of com.salesmanager.core.model.shipping.PackageDetails in project shopizer by shopizer-ecommerce.
the class ShippingFacadeImpl method listPackages.
@Override
public List<PackageDetails> listPackages(MerchantStore store) {
Validate.notNull(store, "MerchantStore cannot be null");
ShippingConfiguration config = getDbConfig(store);
return config.getPackages().stream().map(p -> this.toPackageDetails(p)).collect(Collectors.toList());
}
use of com.salesmanager.core.model.shipping.PackageDetails in project shopizer by shopizer-ecommerce.
the class ShippingFacadeImpl method toPackageDetails.
private PackageDetails toPackageDetails(com.salesmanager.core.model.shipping.Package pack) {
PackageDetails details = new PackageDetails();
details.setCode(pack.getCode());
details.setShippingHeight(pack.getBoxHeight());
details.setShippingLength(pack.getBoxLength());
details.setShippingMaxWeight(pack.getMaxWeight());
// details.setShippingQuantity(pack.getShippingQuantity());
details.setShippingWeight(pack.getBoxWeight());
details.setShippingWidth(pack.getBoxWidth());
details.setTreshold(pack.getTreshold());
details.setType(pack.getShipPackageType().name());
return details;
}
use of com.salesmanager.core.model.shipping.PackageDetails in project shopizer by shopizer-ecommerce.
the class ShippingServiceImpl method getPackagesDetails.
@Override
public List<PackageDetails> getPackagesDetails(List<ShippingProduct> products, MerchantStore store) throws ServiceException {
List<PackageDetails> packages = null;
ShippingConfiguration shippingConfiguration = this.getShippingConfiguration(store);
// determine if the system has to use BOX or ITEM
ShippingPackageType shippingPackageType = ShippingPackageType.ITEM;
if (shippingConfiguration != null) {
shippingPackageType = shippingConfiguration.getShippingPackageType();
}
if (shippingPackageType.name().equals(ShippingPackageType.BOX.name())) {
packages = packaging.getBoxPackagesDetails(products, store);
} else {
packages = packaging.getItemPackagesDetails(products, store);
}
return packages;
}
Aggregations