Package org.openwms.wms.inventory.impl
Class ProductServiceImpl
java.lang.Object
org.openwms.wms.inventory.impl.ProductServiceImpl
- All Implemented Interfaces:
ProductService
A ProductServiceImpl.
- Author:
- Heiko Scherrer
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final ProductMapper
private final ProductRepository
private final org.springframework.context.ApplicationEventPublisher
private final org.ameba.i18n.Translator
private final UomRelationRepository
-
Constructor Summary
ConstructorDescriptionProductServiceImpl
(org.ameba.i18n.Translator translator, ProductMapper productMapper, ProductRepository productRepository, UomRelationRepository uomRelationRepository, org.springframework.context.ApplicationEventPublisher publisher) -
Method Summary
Modifier and TypeMethodDescription@NotNull Product
Create a singleProduct
.void
Create a given list ofProducts
.private Product
createInternal
(Product product) findAll()
Find and return all existingProduct
s.Find an existingProduct
by its synthetic technical key.private Product
findByInternal
(String pKey) findByLabelOrSKUOrThrow
(@NotBlank String bk) Find and return anProduct
identified by its given bk.Find and return anProduct
identified by its given sku.findBySKUandUOM
(@NotBlank String sku, @NotBlank String uom) Find and return anProduct
identified by its given sku and uom.findBySKUorThrow
(@NotBlank String sku) Find and return anProduct
identified by its given sku.protected ProductRepository
@NotNull Product
Update an existingProduct
.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
translator
private final org.ameba.i18n.Translator translator -
productMapper
-
productRepository
-
uomRelationRepository
-
publisher
private final org.springframework.context.ApplicationEventPublisher publisher
-
-
Constructor Details
-
ProductServiceImpl
ProductServiceImpl(org.ameba.i18n.Translator translator, ProductMapper productMapper, ProductRepository productRepository, UomRelationRepository uomRelationRepository, org.springframework.context.ApplicationEventPublisher publisher)
-
-
Method Details
-
getProductRepository
-
create
Create a singleProduct
.- Specified by:
create
in interfaceProductService
- Parameters:
product
- The Product to create
-
createInternal
-
createAll
Create a given list ofProducts
.- Specified by:
createAll
in interfaceProductService
- Parameters:
products
- The list of Products to create
-
findAll
Find and return all existingProduct
s.- Specified by:
findAll
in interfaceProductService
- Returns:
- As list but never null
-
findBy
Find an existingProduct
by its synthetic technical key.- Specified by:
findBy
in interfaceProductService
- Parameters:
pKey
- The persistent key- Returns:
- The Product instance
-
findByInternal
-
findBySKUorThrow
@Measured @Transactional(readOnly=true) public Product findBySKUorThrow(@NotBlank @NotBlank String sku) Find and return anProduct
identified by its given sku.- Specified by:
findBySKUorThrow
in interfaceProductService
- Parameters:
sku
- The product SKU- Returns:
- The product instance
-
findByLabelOrSKUOrThrow
@Measured @Transactional(readOnly=true) public Product findByLabelOrSKUOrThrow(@NotBlank @NotBlank String bk) Find and return anProduct
identified by its given bk.- Specified by:
findByLabelOrSKUOrThrow
in interfaceProductService
- Parameters:
bk
- The product SKU or the label- Returns:
- The product instance
-
findBySKU
@Measured @Transactional(readOnly=true) public Optional<Product> findBySKU(@NotBlank @NotBlank String sku) Find and return anProduct
identified by its given sku.- Specified by:
findBySKU
in interfaceProductService
- Parameters:
sku
- The product SKU- Returns:
- The product instance
-
findBySKUandUOM
@Measured public Optional<Product> findBySKUandUOM(@NotBlank @NotBlank String sku, @NotBlank @NotBlank String uom) Find and return anProduct
identified by its given sku and uom.- Specified by:
findBySKUandUOM
in interfaceProductService
- Parameters:
sku
- The product SKUuom
- The product UOM- Returns:
- The product instance
-
update
Update an existingProduct
.- Specified by:
update
in interfaceProductService
- Parameters:
entity
- The instance to update- Returns:
- The updated instance
-