Class SalesCatalogServiceImpl

    • Constructor Detail

      • SalesCatalogServiceImpl

        public SalesCatalogServiceImpl()
    • Method Detail

      • getPaginationUnits

        public java.util.Deque<java.util.Map<java.lang.String,​java.lang.Object>> getPaginationUnits​(java.lang.String requestJson)
        Description copied from interface: SalesCatalogService
        This method does calculation for a pages based on the request.
        Specified by:
        getPaginationUnits in interface SalesCatalogService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        map-representation of data
      • searchUnits

        public java.util.LinkedHashSet<UnitDTO> searchUnits​(java.lang.String requestJson)
        Description copied from interface: SalesCatalogService
        This method does search requests and returns data as list.
        Specified by:
        searchUnits in interface SalesCatalogService
        Parameters:
        requestJson - search request
        Returns:
        data transport entities as list
      • searchUnitsPaged

        public org.springframework.data.domain.Page<Unit> searchUnitsPaged​(java.lang.String requestJson)
        Description copied from interface: SalesCatalogService
        This method does search requests and returns data as pages.
        Specified by:
        searchUnitsPaged in interface SalesCatalogService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        database entities separated to pages
      • getSellerSkuFromChatTopic

        public SellerSKU getSellerSkuFromChatTopic​(java.lang.String topic)
        Description copied from interface: SalesCatalogService
        This method returns database entity.
        Specified by:
        getSellerSkuFromChatTopic in interface SalesCatalogService
        Parameters:
        topic - field for database entity which related entities list be returned
        Returns:
        database entity
      • getCountOfSellerSkusBySeller

        public java.util.Map<java.lang.String,​java.lang.String> getCountOfSellerSkusBySeller​(java.lang.String sellerId)
        Description copied from interface: SalesCatalogService
        This method returns data as map.
        Specified by:
        getCountOfSellerSkusBySeller in interface SalesCatalogService
        Parameters:
        sellerId - identification for filter and return data
        Returns:
        data as map
      • getCountOfSellerSkus

        public java.util.Map<java.lang.String,​java.lang.String> getCountOfSellerSkus​(java.lang.String requestJson)
        Description copied from interface: SalesCatalogService
        This method returns data as map.
        Specified by:
        getCountOfSellerSkus in interface SalesCatalogService
        Parameters:
        requestJson - identification for filter and return data
        Returns:
        data as map
      • xssFiltering

        private void xssFiltering​(SellerSKU sku)
      • addRelations

        private void addRelations​(SellerSKU sellerSKU)
      • prepareRelations

        private void prepareRelations​(SellerSKU inputSellerSKU)
      • addRelationsForUnit

        private void addRelationsForUnit​(Unit unit)
      • prepareRelationsForUnit

        private void prepareRelationsForUnit​(Unit unit)
      • removeRelationsForUnit

        private void removeRelationsForUnit​(Unit unitUI,
                                            Unit unitDB)
      • createUnit

        @Transactional
        public java.util.Optional<Unit> createUnit​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> unitAsMap)
        Description copied from interface: SalesCatalogService
        This method creates a database entity.
        Specified by:
        createUnit in interface SalesCatalogService
        Parameters:
        unitAsMap - map-representation of database entity
        Returns:
        database entity
      • createUnit

        public java.util.Optional<Unit> createUnit​(Unit unit)
        Description copied from interface: SalesCatalogService
        This method creates a database entity.
        Specified by:
        createUnit in interface SalesCatalogService
        Parameters:
        unit - database entity
        Returns:
        database entity
      • addPackageItemToSellerSku

        public SellerSKU addPackageItemToSellerSku​(java.lang.String sellerSkuId,
                                                   java.util.LinkedHashMap<java.lang.String,​java.lang.Object> packageAsMap)
        Description copied from interface: SalesCatalogService
        This method creates a database entity.
        Specified by:
        addPackageItemToSellerSku in interface SalesCatalogService
        Parameters:
        sellerSkuId - unique identification for database entity
        packageAsMap - map-representation of database entity
        Returns:
        database entity
      • removePackageItemFromSellerSku

        public void removePackageItemFromSellerSku​(java.lang.String sellerSkuId,
                                                   java.lang.String packageId)
        Description copied from interface: SalesCatalogService
        This method removes a database entity.
        Specified by:
        removePackageItemFromSellerSku in interface SalesCatalogService
        Parameters:
        sellerSkuId - unique identification for database entity
        packageId - unique identification for database entity
      • removeFileResources

        public void removeFileResources​(java.lang.String sellerSkuId)
        Description copied from interface: SalesCatalogService
        This method removes all attached files and images.
        Specified by:
        removeFileResources in interface SalesCatalogService
        Parameters:
        sellerSkuId - unique identification for database entity
      • saveSellerSkuAsDraft

        public SellerSKU saveSellerSkuAsDraft​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> sellerSkuAsMap)
        Description copied from interface: SalesCatalogService
        This method save an updates of database entity.
        Specified by:
        saveSellerSkuAsDraft in interface SalesCatalogService
        Parameters:
        sellerSkuAsMap - map-representation of database entity
        Returns:
        saved instance of database entity
      • saveSellerSKU

        @Transactional
        public SellerSKU saveSellerSKU​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> sellerSkuAsMap)
        Description copied from interface: SalesCatalogService
        This method save an updates of database entity.
        Specified by:
        saveSellerSKU in interface SalesCatalogService
        Parameters:
        sellerSkuAsMap - map-representation of database entity
        Returns:
        saved instance of database entity
      • saveUnit

        @Transactional
        public Unit saveUnit​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> unitAsMap)
        Description copied from interface: SalesCatalogService
        This method save an updates of database entity.
        Specified by:
        saveUnit in interface SalesCatalogService
        Parameters:
        unitAsMap - map-representation of database entity
        Returns:
        saved instance of database entity
      • saveUnit

        public Unit saveUnit​(Unit unit)
        Description copied from interface: SalesCatalogService
        This method save an updates of database entity.
        Specified by:
        saveUnit in interface SalesCatalogService
        Parameters:
        unit - database entity
        Returns:
        saved instance of database entity
      • getAllSellerTariff

        public java.util.Map<java.lang.String,​java.lang.String> getAllSellerTariff()
        Description copied from interface: SalesCatalogService
        This method returns data as map.
        Specified by:
        getAllSellerTariff in interface SalesCatalogService
        Returns:
        data as map
      • removeSellerSkuAndClean

        @Transactional
        public void removeSellerSkuAndClean​(java.lang.String sellerSkuId)
        Description copied from interface: SalesCatalogService
        This method removes a database entity and clean all relationships from another entities.
        Specified by:
        removeSellerSkuAndClean in interface SalesCatalogService
        Parameters:
        sellerSkuId - identification for database entity which will be removed
      • removeSellerSkusByIds

        public void removeSellerSkusByIds​(java.util.ArrayList<java.lang.String> sellerSkusIds)
        Description copied from interface: SalesCatalogService
        This method removes a list of database entities.
        Specified by:
        removeSellerSkusByIds in interface SalesCatalogService
        Parameters:
        sellerSkusIds - the list of database entities which will be removed
      • createSellerSKU

        @Transactional
        public java.util.Optional<SellerSKU> createSellerSKU​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> sellerSkuAsMap)
      • createSellerSKU

        private java.util.Optional<SellerSKU> createSellerSKU​(SellerSKU sellerSku)
      • removeSellerSkuFromSKUs

        private void removeSellerSkuFromSKUs​(java.lang.String sellerSkuId)
      • removeSellerSkuFromSellers

        private void removeSellerSkuFromSellers​(java.lang.String sellerSkuId)
      • removeSellerSkuAndAttributeValues

        private void removeSellerSkuAndAttributeValues​(java.lang.String sellerSkuId)
      • removeSellerSkuAndAttributeValue

        private void removeSellerSkuAndAttributeValue​(java.lang.String sellerSkuId,
                                                      java.lang.String attributeValueId)
      • removeSellerSkuFromSku

        private void removeSellerSkuFromSku​(java.lang.String sellerSkuId,
                                            java.lang.String embeddedId)
      • removeSellerSkuFromSeller

        private void removeSellerSkuFromSeller​(java.lang.String sellerSkuId,
                                               java.lang.String embeddedId)
      • removeSellerSkuFromInventory

        private void removeSellerSkuFromInventory​(java.lang.String sellerSkuId)
      • removeSellerSkuFromUnit

        private void removeSellerSkuFromUnit​(java.lang.String sellerSkuId)
      • removeSellerSkuFromCommerceItem

        private void removeSellerSkuFromCommerceItem​(java.lang.String sellerSkuId)
      • removeSellerSkuPackagedItems

        private void removeSellerSkuPackagedItems​(java.lang.String sellerSkuId)
      • removeUnitFromTranslation

        private void removeUnitFromTranslation​(java.lang.String unitId,
                                               java.lang.String tranId)
      • removeUnitFromTranslations

        private void removeUnitFromTranslations​(java.lang.String unitId)
      • removeUnitFromSellerSKU

        private void removeUnitFromSellerSKU​(java.lang.String unitId,
                                             java.lang.String sellerSkuId)
      • removeUnitFromSellerSKUs

        private void removeUnitFromSellerSKUs​(java.lang.String unitId)
      • removeUnitAndClean

        @Transactional
        public void removeUnitAndClean​(java.lang.String unitId)
        Description copied from interface: SalesCatalogService
        This method removes a database entity and clean all relationships from another entities.
        Specified by:
        removeUnitAndClean in interface SalesCatalogService
        Parameters:
        unitId - identification for database entity which will be removed
      • removeUnitsByIds

        @Transactional
        public void removeUnitsByIds​(java.util.ArrayList<java.lang.String> unitsIds)
        Description copied from interface: SalesCatalogService
        This method removes a list of database entities.
        Specified by:
        removeUnitsByIds in interface SalesCatalogService
        Parameters:
        unitsIds - the list of database entities which will be removed
      • publishForSale

        public SellerSKU publishForSale​(java.lang.String sellerSkuId)
        Description copied from interface: SalesCatalogService
        This method does update a database entity.
        Specified by:
        publishForSale in interface SalesCatalogService
        Parameters:
        sellerSkuId - database entity id
        Returns:
        database entity
      • withdrawFromSale

        public SellerSKU withdrawFromSale​(java.lang.String sellerSkuId)
        Description copied from interface: SalesCatalogService
        This method does update a database entity.
        Specified by:
        withdrawFromSale in interface SalesCatalogService
        Parameters:
        sellerSkuId - database entity id
        Returns:
        database entity
      • changeType

        public SellerSKU changeType​(java.lang.String sellerSkuId,
                                    java.lang.String type)
        Description copied from interface: SalesCatalogService
        This method is changing a type of SellerSKU
        Specified by:
        changeType in interface SalesCatalogService
        Parameters:
        sellerSkuId - database entity id
        type - type to change
        Returns:
        database entity
      • duplicate

        public SellerSKU duplicate​(java.lang.String sellerSkuId)
        Description copied from interface: SalesCatalogService
        This method creates a copy of SellerSKU
        Specified by:
        duplicate in interface SalesCatalogService
        Parameters:
        sellerSkuId - database entity id
        Returns:
        database entity
      • mapUnitToDto

        public UnitDTO mapUnitToDto​(Unit unit,
                                    boolean optimal)
        Description copied from interface: SalesCatalogService
        This method does map product entity to dto object
        Specified by:
        mapUnitToDto in interface SalesCatalogService
        Parameters:
        unit - database entity which be used to map to dto
        optimal - this pointer optimises the data transfer object
        Returns:
        data transport object
      • getSellerSkuDocumentUrls

        public java.util.List<Attachment> getSellerSkuDocumentUrls​(java.lang.String sellerSkuId)
        Description copied from interface: SalesCatalogService
        This method returns data as list.
        Specified by:
        getSellerSkuDocumentUrls in interface SalesCatalogService
        Parameters:
        sellerSkuId - identification for database entity which related beans list be returned
        Returns:
        database beans as list
      • isValidToSave

        private boolean isValidToSave​(SellerSKU sellerSKU)