Search in sources :

Example 11 with ViewDefinitionState

use of com.qcadoo.view.api.ViewDefinitionState in project mes by qcadoo.

the class DeliveryDetailsListeners method downloadProductAttachment.

public void downloadProductAttachment(final ViewDefinitionState view, final ComponentState state, final String[] args) {
    FormComponent deliveryForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    GridComponent orderedProductsGrid = (GridComponent) view.getComponentByReference(DeliveryFields.ORDERED_PRODUCTS);
    Set<Long> ids = orderedProductsGrid.getSelectedEntitiesIds();
    SearchCriteriaBuilder searchCriteria = deliveriesService.getOrderedProductDD().find().createAlias(BasicConstants.MODEL_PRODUCT, BasicConstants.MODEL_PRODUCT, JoinType.INNER).createAlias(BasicConstants.MODEL_PRODUCT + L_DOT + ProductFields.PRODUCT_ATTACHMENTS, ProductFields.PRODUCT_ATTACHMENTS, JoinType.INNER).setProjection(SearchProjections.list().add(alias(field(ProductFields.PRODUCT_ATTACHMENTS + L_DOT + ProductAttachmentFields.ATTACHMENT), ProductAttachmentFields.ATTACHMENT)));
    if (ids.isEmpty()) {
        searchCriteria.createAlias(DeliveriesConstants.MODEL_DELIVERY, DeliveriesConstants.MODEL_DELIVERY, JoinType.INNER).add(SearchRestrictions.in(DeliveriesConstants.MODEL_DELIVERY + L_DOT + "id", deliveryForm.getEntityId()));
    } else {
        searchCriteria.add(SearchRestrictions.in("id", ids));
    }
    List<Entity> result = searchCriteria.list().getEntities();
    if (result.isEmpty()) {
        return;
    }
    List<File> attachments = result.stream().map(productAttachment -> new File(productAttachment.getStringField(ProductAttachmentFields.ATTACHMENT))).collect(Collectors.toList());
    File zipFile;
    try {
        zipFile = fileService.compressToZipFile(attachments, false);
    } catch (IOException e) {
        LOG.error("Unable to compress documents to zip file.", e);
        return;
    }
    view.redirectTo(fileService.getUrl(zipFile.getAbsolutePath()) + "?clean", true, false);
}
Also used : MessageType(com.qcadoo.view.api.ComponentState.MessageType) java.util(java.util) CurrencyService(com.qcadoo.mes.basic.util.CurrencyService) ComponentState(com.qcadoo.view.api.ComponentState) QcadooViewConstants(com.qcadoo.view.constants.QcadooViewConstants) LoggerFactory(org.slf4j.LoggerFactory) com.qcadoo.mes.deliveries.constants(com.qcadoo.mes.deliveries.constants) Autowired(org.springframework.beans.factory.annotation.Autowired) UnitConversionService(com.qcadoo.model.api.units.UnitConversionService) ReservationService(com.qcadoo.mes.deliveries.ReservationService) StringUtils(org.apache.commons.lang3.StringUtils) com.qcadoo.model.api(com.qcadoo.model.api) FileService(com.qcadoo.model.api.file.FileService) DeliveriesService(com.qcadoo.mes.deliveries.DeliveriesService) DeliveryStateStringValues(com.qcadoo.mes.deliveries.states.constants.DeliveryStateStringValues) BigDecimal(java.math.BigDecimal) ViewDefinitionState(com.qcadoo.view.api.ViewDefinitionState) Lists(com.google.common.collect.Lists) ProductFieldsCNFP(com.qcadoo.mes.costNormsForProduct.constants.ProductFieldsCNFP) PossibleUnitConversions(com.qcadoo.model.api.units.PossibleUnitConversions) NumberGeneratorService(com.qcadoo.view.api.utils.NumberGeneratorService) PdfHelper(com.qcadoo.report.api.pdf.PdfHelper) FormComponent(com.qcadoo.view.api.components.FormComponent) PluginUtils(com.qcadoo.plugin.api.PluginUtils) DeliveredProductMultiPositionService(com.qcadoo.mes.deliveries.DeliveredProductMultiPositionService) OrderReportPdf(com.qcadoo.mes.deliveries.print.OrderReportPdf) com.qcadoo.model.api.search(com.qcadoo.model.api.search) SearchProjections.field(com.qcadoo.model.api.search.SearchProjections.field) Logger(org.slf4j.Logger) IOException(java.io.IOException) Maps(com.google.common.collect.Maps) Collectors(java.util.stream.Collectors) GridComponent(com.qcadoo.view.api.components.GridComponent) File(java.io.File) Component(org.springframework.stereotype.Component) ParameterService(com.qcadoo.mes.basic.ParameterService) FieldComponent(com.qcadoo.view.api.components.FieldComponent) com.qcadoo.mes.basic.constants(com.qcadoo.mes.basic.constants) LookupComponent(com.qcadoo.view.api.components.LookupComponent) CalculationQuantityService(com.qcadoo.mes.basic.CalculationQuantityService) SearchProjections.alias(com.qcadoo.model.api.search.SearchProjections.alias) DeliveryReportPdf(com.qcadoo.mes.deliveries.print.DeliveryReportPdf) FormComponent(com.qcadoo.view.api.components.FormComponent) GridComponent(com.qcadoo.view.api.components.GridComponent) IOException(java.io.IOException) File(java.io.File)

Example 12 with ViewDefinitionState

use of com.qcadoo.view.api.ViewDefinitionState in project mes by qcadoo.

the class DeliveryDetailsListeners method fillBasedOnPricesFromLastDeliveryOffer.

private void fillBasedOnPricesFromLastDeliveryOffer(final ViewDefinitionState view, final boolean deliveryUseNominalCostWhenPriceNotSpecified) {
    GridComponent orderedProductsGrid = (GridComponent) view.getComponentByReference(DeliveryFields.ORDERED_PRODUCTS);
    FieldComponent currencyField = (FieldComponent) view.getComponentByReference(DeliveryFields.CURRENCY);
    Long deliveryCurrencyId = (Long) currencyField.getFieldValue();
    Entity plnCurrency = currencyService.getCurrencyByAlphabeticCode(CurrencyService.PLN);
    List<Entity> orderedProducts = deliveriesService.getSelectedOrderedProducts(orderedProductsGrid);
    List<Entity> productsToMessage = Lists.newArrayList();
    orderedProducts.forEach(orderedProduct -> {
        Entity product = orderedProduct.getBelongsToField(OrderedProductFields.PRODUCT);
        Entity supplier = orderedProduct.getBelongsToField(OrderedProductFields.DELIVERY).getBelongsToField(DeliveryFields.SUPPLIER);
        if (Objects.isNull(supplier)) {
            if (deliveryUseNominalCostWhenPriceNotSpecified) {
                Entity currency = product.getBelongsToField(ProductFieldsCNFP.NOMINAL_COST_CURRENCY);
                BigDecimal pricePerUnit = getPricePerUnit(deliveryCurrencyId, plnCurrency, product, productsToMessage, currency, product.getDecimalField(ProductFieldsCNFP.NOMINAL_COST));
                orderedProduct.setField(OrderedProductFields.PRICE_PER_UNIT, pricePerUnit);
                orderedProduct.getDataDefinition().save(orderedProduct);
            }
            return;
        }
        Entity offerProduct = getLastOfferProduct(supplier, product);
        if (Objects.nonNull(offerProduct)) {
            Entity currency = currencyService.getCurrentCurrency();
            BigDecimal pricePerUnit = getPricePerUnit(deliveryCurrencyId, plnCurrency, product, productsToMessage, currency, offerProduct.getDecimalField(OrderedProductFields.PRICE_PER_UNIT));
            orderedProduct.setField(OrderedProductFields.PRICE_PER_UNIT, pricePerUnit);
            orderedProduct.setField(L_OFFER, offerProduct.getBelongsToField(L_OFFER));
            orderedProduct.getDataDefinition().save(orderedProduct);
        } else if (deliveryUseNominalCostWhenPriceNotSpecified) {
            Entity currency = product.getBelongsToField(ProductFieldsCNFP.NOMINAL_COST_CURRENCY);
            BigDecimal pricePerUnit = getPricePerUnit(deliveryCurrencyId, plnCurrency, product, productsToMessage, currency, product.getDecimalField(ProductFieldsCNFP.NOMINAL_COST));
            orderedProduct.setField(OrderedProductFields.PRICE_PER_UNIT, pricePerUnit);
            orderedProduct.getDataDefinition().save(orderedProduct);
        }
    });
    if (!productsToMessage.isEmpty()) {
        view.addMessage("deliveries.orderedProducts.differentCurrencies", MessageType.INFO, false, productsToMessage.stream().map(e -> e.getStringField(ProductFields.NUMBER)).collect(Collectors.joining(", ")));
    }
    orderedProductsGrid.reloadEntities();
    BigDecimal totalPrice = orderedProducts.stream().filter(orderedProduct -> Objects.nonNull(orderedProduct.getDecimalField(OrderedProductFields.TOTAL_PRICE))).map(orderedProduct -> orderedProduct.getDecimalField(OrderedProductFields.TOTAL_PRICE)).reduce(BigDecimal.ZERO, BigDecimal::add);
    FieldComponent totalPriceComponent = (FieldComponent) view.getComponentByReference(L_ORDERED_PRODUCTS_CUMULATED_TOTAL_PRICE);
    totalPriceComponent.setFieldValue(numberService.formatWithMinimumFractionDigits(totalPrice, 0));
    totalPriceComponent.requestComponentUpdateState();
}
Also used : MessageType(com.qcadoo.view.api.ComponentState.MessageType) java.util(java.util) CurrencyService(com.qcadoo.mes.basic.util.CurrencyService) ComponentState(com.qcadoo.view.api.ComponentState) QcadooViewConstants(com.qcadoo.view.constants.QcadooViewConstants) LoggerFactory(org.slf4j.LoggerFactory) com.qcadoo.mes.deliveries.constants(com.qcadoo.mes.deliveries.constants) Autowired(org.springframework.beans.factory.annotation.Autowired) UnitConversionService(com.qcadoo.model.api.units.UnitConversionService) ReservationService(com.qcadoo.mes.deliveries.ReservationService) StringUtils(org.apache.commons.lang3.StringUtils) com.qcadoo.model.api(com.qcadoo.model.api) FileService(com.qcadoo.model.api.file.FileService) DeliveriesService(com.qcadoo.mes.deliveries.DeliveriesService) DeliveryStateStringValues(com.qcadoo.mes.deliveries.states.constants.DeliveryStateStringValues) BigDecimal(java.math.BigDecimal) ViewDefinitionState(com.qcadoo.view.api.ViewDefinitionState) Lists(com.google.common.collect.Lists) ProductFieldsCNFP(com.qcadoo.mes.costNormsForProduct.constants.ProductFieldsCNFP) PossibleUnitConversions(com.qcadoo.model.api.units.PossibleUnitConversions) NumberGeneratorService(com.qcadoo.view.api.utils.NumberGeneratorService) PdfHelper(com.qcadoo.report.api.pdf.PdfHelper) FormComponent(com.qcadoo.view.api.components.FormComponent) PluginUtils(com.qcadoo.plugin.api.PluginUtils) DeliveredProductMultiPositionService(com.qcadoo.mes.deliveries.DeliveredProductMultiPositionService) OrderReportPdf(com.qcadoo.mes.deliveries.print.OrderReportPdf) com.qcadoo.model.api.search(com.qcadoo.model.api.search) SearchProjections.field(com.qcadoo.model.api.search.SearchProjections.field) Logger(org.slf4j.Logger) IOException(java.io.IOException) Maps(com.google.common.collect.Maps) Collectors(java.util.stream.Collectors) GridComponent(com.qcadoo.view.api.components.GridComponent) File(java.io.File) Component(org.springframework.stereotype.Component) ParameterService(com.qcadoo.mes.basic.ParameterService) FieldComponent(com.qcadoo.view.api.components.FieldComponent) com.qcadoo.mes.basic.constants(com.qcadoo.mes.basic.constants) LookupComponent(com.qcadoo.view.api.components.LookupComponent) CalculationQuantityService(com.qcadoo.mes.basic.CalculationQuantityService) SearchProjections.alias(com.qcadoo.model.api.search.SearchProjections.alias) DeliveryReportPdf(com.qcadoo.mes.deliveries.print.DeliveryReportPdf) GridComponent(com.qcadoo.view.api.components.GridComponent) FieldComponent(com.qcadoo.view.api.components.FieldComponent) BigDecimal(java.math.BigDecimal)

Example 13 with ViewDefinitionState

use of com.qcadoo.view.api.ViewDefinitionState in project mes by qcadoo.

the class DeliveryDetailsListeners method fillBasedOnLastPurchasePrice.

private void fillBasedOnLastPurchasePrice(final ViewDefinitionState view, final boolean deliveryUseNominalCostWhenPriceNotSpecified) {
    GridComponent orderedProductsGrid = (GridComponent) view.getComponentByReference(DeliveryFields.ORDERED_PRODUCTS);
    FieldComponent currencyField = (FieldComponent) view.getComponentByReference(DeliveryFields.CURRENCY);
    Long deliveryCurrencyId = (Long) currencyField.getFieldValue();
    Entity plnCurrency = currencyService.getCurrencyByAlphabeticCode(CurrencyService.PLN);
    List<Entity> orderedProducts = deliveriesService.getSelectedOrderedProducts(orderedProductsGrid);
    List<Entity> productsToMessage = Lists.newArrayList();
    orderedProducts.forEach(orderedProduct -> {
        Entity product = orderedProduct.getBelongsToField(OrderedProductFields.PRODUCT);
        BigDecimal lastPurchaseCost = product.getDecimalField(ProductFieldsCNFP.LAST_PURCHASE_COST);
        BigDecimal pricePerUnit;
        if (BigDecimalUtils.convertNullToZero(lastPurchaseCost).compareTo(BigDecimal.ZERO) == 0 && deliveryUseNominalCostWhenPriceNotSpecified) {
            Entity currency = product.getBelongsToField(ProductFieldsCNFP.NOMINAL_COST_CURRENCY);
            pricePerUnit = getPricePerUnit(deliveryCurrencyId, plnCurrency, product, productsToMessage, currency, product.getDecimalField(ProductFieldsCNFP.NOMINAL_COST));
        } else {
            if (Objects.isNull(lastPurchaseCost)) {
                orderedProduct.setField(OrderedProductFields.TOTAL_PRICE, null);
            }
            Entity currency = product.getBelongsToField(ProductFieldsCNFP.LAST_PURCHASE_COST_CURRENCY);
            pricePerUnit = getPricePerUnit(deliveryCurrencyId, plnCurrency, product, productsToMessage, currency, lastPurchaseCost);
        }
        orderedProduct.setField(OrderedProductFields.PRICE_PER_UNIT, pricePerUnit);
        orderedProduct.getDataDefinition().save(orderedProduct);
    });
    if (!productsToMessage.isEmpty()) {
        view.addMessage("deliveries.orderedProducts.differentCurrencies", MessageType.INFO, false, productsToMessage.stream().map(e -> e.getStringField(ProductFields.NUMBER)).collect(Collectors.joining(", ")));
    }
    orderedProductsGrid.reloadEntities();
    BigDecimal totalPrice = orderedProducts.stream().filter(orderedProduct -> Objects.nonNull(orderedProduct.getDecimalField(OrderedProductFields.TOTAL_PRICE))).map(orderedProduct -> orderedProduct.getDecimalField(OrderedProductFields.TOTAL_PRICE)).reduce(BigDecimal.ZERO, BigDecimal::add);
    FieldComponent totalPriceComponent = (FieldComponent) view.getComponentByReference(L_ORDERED_PRODUCTS_CUMULATED_TOTAL_PRICE);
    totalPriceComponent.setFieldValue(numberService.formatWithMinimumFractionDigits(totalPrice, 0));
    totalPriceComponent.requestComponentUpdateState();
}
Also used : MessageType(com.qcadoo.view.api.ComponentState.MessageType) java.util(java.util) CurrencyService(com.qcadoo.mes.basic.util.CurrencyService) ComponentState(com.qcadoo.view.api.ComponentState) QcadooViewConstants(com.qcadoo.view.constants.QcadooViewConstants) LoggerFactory(org.slf4j.LoggerFactory) com.qcadoo.mes.deliveries.constants(com.qcadoo.mes.deliveries.constants) Autowired(org.springframework.beans.factory.annotation.Autowired) UnitConversionService(com.qcadoo.model.api.units.UnitConversionService) ReservationService(com.qcadoo.mes.deliveries.ReservationService) StringUtils(org.apache.commons.lang3.StringUtils) com.qcadoo.model.api(com.qcadoo.model.api) FileService(com.qcadoo.model.api.file.FileService) DeliveriesService(com.qcadoo.mes.deliveries.DeliveriesService) DeliveryStateStringValues(com.qcadoo.mes.deliveries.states.constants.DeliveryStateStringValues) BigDecimal(java.math.BigDecimal) ViewDefinitionState(com.qcadoo.view.api.ViewDefinitionState) Lists(com.google.common.collect.Lists) ProductFieldsCNFP(com.qcadoo.mes.costNormsForProduct.constants.ProductFieldsCNFP) PossibleUnitConversions(com.qcadoo.model.api.units.PossibleUnitConversions) NumberGeneratorService(com.qcadoo.view.api.utils.NumberGeneratorService) PdfHelper(com.qcadoo.report.api.pdf.PdfHelper) FormComponent(com.qcadoo.view.api.components.FormComponent) PluginUtils(com.qcadoo.plugin.api.PluginUtils) DeliveredProductMultiPositionService(com.qcadoo.mes.deliveries.DeliveredProductMultiPositionService) OrderReportPdf(com.qcadoo.mes.deliveries.print.OrderReportPdf) com.qcadoo.model.api.search(com.qcadoo.model.api.search) SearchProjections.field(com.qcadoo.model.api.search.SearchProjections.field) Logger(org.slf4j.Logger) IOException(java.io.IOException) Maps(com.google.common.collect.Maps) Collectors(java.util.stream.Collectors) GridComponent(com.qcadoo.view.api.components.GridComponent) File(java.io.File) Component(org.springframework.stereotype.Component) ParameterService(com.qcadoo.mes.basic.ParameterService) FieldComponent(com.qcadoo.view.api.components.FieldComponent) com.qcadoo.mes.basic.constants(com.qcadoo.mes.basic.constants) LookupComponent(com.qcadoo.view.api.components.LookupComponent) CalculationQuantityService(com.qcadoo.mes.basic.CalculationQuantityService) SearchProjections.alias(com.qcadoo.model.api.search.SearchProjections.alias) DeliveryReportPdf(com.qcadoo.mes.deliveries.print.DeliveryReportPdf) GridComponent(com.qcadoo.view.api.components.GridComponent) FieldComponent(com.qcadoo.view.api.components.FieldComponent) BigDecimal(java.math.BigDecimal)

Example 14 with ViewDefinitionState

use of com.qcadoo.view.api.ViewDefinitionState in project mes by qcadoo.

the class SalesPlanDetailsHooks method setRibbonEnabled.

private void setRibbonEnabled(final ViewDefinitionState view) {
    FormComponent salesPlanForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    Entity salesPlan = salesPlanForm.getEntity();
    String state = salesPlan.getStringField(SalesPlanFields.STATE);
    GridComponent productsGrid = (GridComponent) view.getComponentByReference(SalesPlanFields.PRODUCTS);
    WindowComponent window = (WindowComponent) view.getComponentByReference(QcadooViewConstants.L_WINDOW);
    Ribbon ribbon = window.getRibbon();
    RibbonGroup salesPlanMaterialRequirementRibbonGroup = ribbon.getGroupByName(L_SALES_PLAN_MATERIAL_REQUIREMENT);
    RibbonActionItem createSalesPlanMaterialRequirementRibbonActionItem = salesPlanMaterialRequirementRibbonGroup.getItemByName(L_CREATE_SALES_PLAN_MATERIAL_REQUIREMENT);
    RibbonActionItem openPositionsImportPageRibbonActionItem = window.getRibbon().getGroupByName(L_IMPORT).getItemByName(L_OPEN_POSITIONS_IMPORT_PAGE);
    RibbonGroup technologiesRibbonGroup = ribbon.getGroupByName("technologies");
    RibbonActionItem useOtherTechnologyActionItem = technologiesRibbonGroup.getItemByName("useOtherTechnology");
    RibbonActionItem fillTechnologyActionItem = technologiesRibbonGroup.getItemByName("fillTechnology");
    boolean isEnabled = Objects.nonNull(salesPlanForm.getEntityId()) && state.equals(SalesPlanStateStringValues.DRAFT);
    createSalesPlanMaterialRequirementRibbonActionItem.setEnabled(isEnabled);
    createSalesPlanMaterialRequirementRibbonActionItem.requestUpdate(true);
    openPositionsImportPageRibbonActionItem.setEnabled(isEnabled);
    openPositionsImportPageRibbonActionItem.requestUpdate(true);
    useOtherTechnologyActionItem.setEnabled(isEnabled && !productsGrid.getSelectedEntitiesIds().isEmpty() && productsGrid.getSelectedEntities().stream().noneMatch(e -> e.getStringField(TECHNOLOGY_NUMBER) == null) && productsGrid.getSelectedEntities().stream().map(e -> e.getStringField(TECHNOLOGY_NUMBER)).distinct().count() == 1L);
    useOtherTechnologyActionItem.requestUpdate(true);
    fillTechnologyActionItem.setEnabled(isEnabled && !productsGrid.getSelectedEntitiesIds().isEmpty() && productsGrid.getSelectedEntities().stream().allMatch(e -> e.getStringField(TECHNOLOGY_NUMBER) == null && e.getStringField("productFamily") != null) && productsGrid.getSelectedEntities().stream().map(e -> e.getStringField("productFamily")).distinct().count() == 1L);
    fillTechnologyActionItem.requestUpdate(true);
}
Also used : WindowComponent(com.qcadoo.view.api.components.WindowComponent) RibbonActionItem(com.qcadoo.view.api.ribbon.RibbonActionItem) RibbonGroup(com.qcadoo.view.api.ribbon.RibbonGroup) QcadooViewConstants(com.qcadoo.view.constants.QcadooViewConstants) Ribbon(com.qcadoo.view.api.ribbon.Ribbon) SalesPlanFields(com.qcadoo.mes.masterOrders.constants.SalesPlanFields) GridComponent(com.qcadoo.view.api.components.GridComponent) Objects(java.util.Objects) Entity(com.qcadoo.model.api.Entity) ViewDefinitionState(com.qcadoo.view.api.ViewDefinitionState) Service(org.springframework.stereotype.Service) SalesPlanStateStringValues(com.qcadoo.mes.masterOrders.states.constants.SalesPlanStateStringValues) FormComponent(com.qcadoo.view.api.components.FormComponent) FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity) RibbonGroup(com.qcadoo.view.api.ribbon.RibbonGroup) WindowComponent(com.qcadoo.view.api.components.WindowComponent) Ribbon(com.qcadoo.view.api.ribbon.Ribbon) GridComponent(com.qcadoo.view.api.components.GridComponent) RibbonActionItem(com.qcadoo.view.api.ribbon.RibbonActionItem)

Example 15 with ViewDefinitionState

use of com.qcadoo.view.api.ViewDefinitionState in project mes by qcadoo.

the class CostNormsGeneratorListeners method updateCostNorms.

public void updateCostNorms(final ViewDefinitionState view, final ComponentState state, final String[] args) {
    FormComponent costNormsGeneratorForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    Entity costNormsGenerator = costNormsGeneratorForm.getPersistedEntityWithIncludedFormValues();
    String costsSource = costNormsGenerator.getStringField(CostNormsGeneratorFields.COSTS_SOURCE);
    if ("01mes".equals(costsSource)) {
        boolean allProducts = ProductsToUpdate.of(costNormsGenerator).compareTo(ProductsToUpdate.ALL) == 0;
        List<Entity> products = Lists.newArrayList();
        if (!allProducts) {
            products = costNormsGenerator.getHasManyField(CostNormsGeneratorFields.PRODUCTS);
            if (products.isEmpty()) {
                view.addMessage("materialFlowResources.info.costNormsNotUpdated", ComponentState.MessageType.INFO);
                return;
            }
        }
        List<Entity> warehouses = costNormsGenerator.getHasManyField(CostNormsGeneratorFields.WAREHOUSES).stream().map(warehouse -> warehouse.getBelongsToField(CostNormsLocationFields.LOCATION)).collect(Collectors.toList());
        costNormsService.updateCostNormsForProductsFromWarehouses(products, warehouses);
    }
    view.addMessage("materialFlowResources.success.costNormsUpdated", ComponentState.MessageType.SUCCESS);
}
Also used : ProductsToUpdate(com.qcadoo.mes.materialFlowResources.constants.ProductsToUpdate) ComponentState(com.qcadoo.view.api.ComponentState) QcadooViewConstants(com.qcadoo.view.constants.QcadooViewConstants) Autowired(org.springframework.beans.factory.annotation.Autowired) CostNormsGeneratorFields(com.qcadoo.mes.materialFlowResources.constants.CostNormsGeneratorFields) CostNormsLocationFields(com.qcadoo.mes.materialFlowResources.constants.CostNormsLocationFields) Collectors(java.util.stream.Collectors) GridComponent(com.qcadoo.view.api.components.GridComponent) List(java.util.List) Entity(com.qcadoo.model.api.Entity) ViewDefinitionState(com.qcadoo.view.api.ViewDefinitionState) Lists(com.google.common.collect.Lists) Service(org.springframework.stereotype.Service) FormComponent(com.qcadoo.view.api.components.FormComponent) CostNormsService(com.qcadoo.mes.materialFlowResources.costNorms.CostNormsService) FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity)

Aggregations

ViewDefinitionState (com.qcadoo.view.api.ViewDefinitionState)50 Autowired (org.springframework.beans.factory.annotation.Autowired)35 QcadooViewConstants (com.qcadoo.view.constants.QcadooViewConstants)32 Service (org.springframework.stereotype.Service)31 ComponentState (com.qcadoo.view.api.ComponentState)29 Collectors (java.util.stream.Collectors)28 Entity (com.qcadoo.model.api.Entity)27 Lists (com.google.common.collect.Lists)25 GridComponent (com.qcadoo.view.api.components.GridComponent)25 DataDefinitionService (com.qcadoo.model.api.DataDefinitionService)24 FormComponent (com.qcadoo.view.api.components.FormComponent)23 BigDecimal (java.math.BigDecimal)21 List (java.util.List)21 Maps (com.google.common.collect.Maps)18 Map (java.util.Map)18 DataDefinition (com.qcadoo.model.api.DataDefinition)16 ProductFields (com.qcadoo.mes.basic.constants.ProductFields)15 SearchRestrictions (com.qcadoo.model.api.search.SearchRestrictions)13 FieldComponent (com.qcadoo.view.api.components.FieldComponent)11 Objects (java.util.Objects)11