Search in sources :

Example 11 with StateChangeContext

use of com.qcadoo.mes.states.StateChangeContext in project mes by qcadoo.

the class OrderCreationService method createOrder.

public OrderCreationResponse createOrder(OrderCreationRequest orderCreationRequest) {
    Entity parameter = parameterService.getParameter();
    boolean createOperationalTasks = !orderCreationRequest.getTechnologyOperations().isEmpty();
    if (Objects.isNull(orderCreationRequest.getTechnologyId())) {
        if (!isParameterSet(parameter, createOperationalTasks)) {
            return new OrderCreationResponse(translationService.translate("basic.dashboard.orderDefinitionWizard.createOrder.parameterNotSet", LocaleContextHolder.getLocale()));
        }
    }
    Entity product = getProduct(orderCreationRequest.getProductId());
    Either<String, Entity> isTechnology = getOrCreateTechnology(orderCreationRequest);
    if (isTechnology.isLeft()) {
        return new OrderCreationResponse(isTechnology.getLeft());
    }
    Entity technology = isTechnology.getRight();
    Entity productionLine = getProductionLine(orderCreationRequest.getProductionLineId(), technology);
    OrderCreationResponse response = new OrderCreationResponse(OrderCreationResponse.StatusCode.OK);
    Entity order = dataDefinitionService.get(OrdersConstants.PLUGIN_IDENTIFIER, OrdersConstants.MODEL_ORDER).create();
    order.setField(OrderFields.NUMBER, numberGeneratorService.generateNumber(OrdersConstants.PLUGIN_IDENTIFIER, OrdersConstants.MODEL_ORDER, 6));
    order.setField(OrderFields.NAME, orderService.makeDefaultName(product, technology, LocaleContextHolder.getLocale()));
    order.setField(OrderFields.PRODUCT, product);
    order.setField(OrderFields.TECHNOLOGY_PROTOTYPE, technology);
    order.setField(OrderFields.PRODUCTION_LINE, productionLine);
    order.setField(OrderFields.DIVISION, orderService.getDivision(technology));
    order.setField(OrderFields.DATE_FROM, orderCreationRequest.getStartDate());
    order.setField(OrderFields.DATE_TO, orderCreationRequest.getFinishDate());
    order.setField(OrderFields.EXTERNAL_SYNCHRONIZED, true);
    order.setField(IS_SUBCONTRACTED, false);
    order.setField(OrderFields.STATE, OrderStateStringValues.PENDING);
    order.setField(OrderFields.PLANNED_QUANTITY, orderCreationRequest.getQuantity());
    order.setField(OrderFields.DESCRIPTION, buildDescription(parameter, orderCreationRequest.getDescription(), technology, product));
    order.setField(IGNORE_MISSING_COMPONENTS, parameter.getBooleanField(IGNORE_MISSING_COMPONENTS));
    order.setField("typeOfProductionRecording", orderCreationRequest.getTypeOfProductionRecording());
    order = order.getDataDefinition().save(order);
    if (order.isValid()) {
        if (!order.getGlobalMessages().isEmpty()) {
            Optional<GlobalMessage> message = order.getGlobalMessages().stream().filter(gm -> gm.getMessage().equals("orders.order.message.plannedQuantityChanged")).findFirst();
            message.ifPresent(m -> {
                response.setAdditionalInformation(translationService.translate(m.getMessage(), LocaleContextHolder.getLocale(), m.getVars()[0], m.getVars()[1]));
            });
        }
        final StateChangeContext orderStateChangeContext = stateChangeContextBuilder.build(orderStateChangeAspect.getChangeEntityDescriber(), order, OrderState.ACCEPTED.getStringValue());
        orderStateChangeAspect.changeState(orderStateChangeContext);
        order = order.getDataDefinition().get(order.getId());
        if (!order.getStringField(OrderFields.STATE).equals(OrderStateStringValues.ACCEPTED)) {
            return new OrderCreationResponse(translationService.translate("basic.dashboard.orderDefinitionWizard.createOrder.acceptError", LocaleContextHolder.getLocale(), order.getStringField(OrderFields.NUMBER)));
        }
    } else {
        return new OrderCreationResponse(translationService.translate("basic.dashboard.orderDefinitionWizard.createOrder.validationError", LocaleContextHolder.getLocale()));
    }
    if (createOperationalTasks) {
        createOperationalTasks(order, orderCreationRequest);
        modifyProductionCountingQuantityForEach(order, orderCreationRequest.getTechnologyOperations());
    } else {
        modifyProductionCountingQuantity(order, orderCreationRequest.getMaterials());
    }
    response.setMessage(translationService.translate("orders.orderCreationService.created", LocaleContextHolder.getLocale(), order.getStringField(OrderFields.NUMBER)));
    if (createOperationalTasks) {
        response.setOperationalTasks(dashboardKanbanDataProvider.getOperationalTasksPendingForOrder(order.getId()));
    } else {
        response.setOrder(dashboardKanbanDataProvider.getOrder(order.getId()));
    }
    return response;
}
Also used : LocaleContextHolder(org.springframework.context.i18n.LocaleContextHolder) ProductFamilyElementType(com.qcadoo.mes.basic.constants.ProductFamilyElementType) OrderDetailsListeners(com.qcadoo.mes.orders.listeners.OrderDetailsListeners) Autowired(org.springframework.beans.factory.annotation.Autowired) ProductionLinesConstants(com.qcadoo.mes.productionLines.constants.ProductionLinesConstants) StringUtils(org.apache.commons.lang3.StringUtils) TechnologyOperationComponentFields(com.qcadoo.mes.technologies.constants.TechnologyOperationComponentFields) ParameterFields(com.qcadoo.mes.basic.constants.ParameterFields) TechnologyStateChangeAspect(com.qcadoo.mes.technologies.states.aop.TechnologyStateChangeAspect) BigDecimal(java.math.BigDecimal) TechnologyNameAndNumberGenerator(com.qcadoo.mes.technologies.TechnologyNameAndNumberGenerator) BasicConstants(com.qcadoo.mes.basic.constants.BasicConstants) Map(java.util.Map) GlobalMessage(com.qcadoo.model.api.validators.GlobalMessage) SearchRestrictions(com.qcadoo.model.api.search.SearchRestrictions) OperationProductInComponentFields(com.qcadoo.mes.technologies.constants.OperationProductInComponentFields) TechnologyState(com.qcadoo.mes.technologies.states.constants.TechnologyState) Set(java.util.Set) WorkstationFields(com.qcadoo.mes.basic.constants.WorkstationFields) TechnologyOperationComponentFieldsTNFO(com.qcadoo.mes.timeNormsForOperations.constants.TechnologyOperationComponentFieldsTNFO) TechnologyOperationDto(com.qcadoo.mes.orders.controllers.dto.TechnologyOperationDto) Collectors(java.util.stream.Collectors) OrderCreationResponse(com.qcadoo.mes.orders.controllers.responses.OrderCreationResponse) Sets(com.google.common.collect.Sets) OperationFields(com.qcadoo.mes.technologies.constants.OperationFields) Objects(java.util.Objects) List(java.util.List) OrderStateChangeAspect(com.qcadoo.mes.orders.states.aop.OrderStateChangeAspect) Entity(com.qcadoo.model.api.Entity) ParameterService(com.qcadoo.mes.basic.ParameterService) ParameterFieldsO(com.qcadoo.mes.orders.constants.ParameterFieldsO) OrderStateStringValues(com.qcadoo.mes.orders.states.constants.OrderStateStringValues) OperationProductOutComponentFields(com.qcadoo.mes.technologies.constants.OperationProductOutComponentFields) Optional(java.util.Optional) SearchCriteriaBuilder(com.qcadoo.model.api.search.SearchCriteriaBuilder) TechnologiesConstants(com.qcadoo.mes.technologies.constants.TechnologiesConstants) TechnologyFields(com.qcadoo.mes.technologies.constants.TechnologyFields) DataDefinitionService(com.qcadoo.model.api.DataDefinitionService) DashboardKanbanDataProvider(com.qcadoo.mes.orders.controllers.dataProvider.DashboardKanbanDataProvider) OrderFields(com.qcadoo.mes.orders.constants.OrderFields) ParameterFieldsPL(com.qcadoo.mes.productionLines.constants.ParameterFieldsPL) OrdersConstants(com.qcadoo.mes.orders.constants.OrdersConstants) TechnologyService(com.qcadoo.mes.technologies.TechnologyService) OrderCreationRequest(com.qcadoo.mes.orders.controllers.requests.OrderCreationRequest) Lists(com.google.common.collect.Lists) GlobalTypeOfMaterial(com.qcadoo.mes.basic.constants.GlobalTypeOfMaterial) NumberGeneratorService(com.qcadoo.view.api.utils.NumberGeneratorService) Service(org.springframework.stereotype.Service) MaterialDto(com.qcadoo.mes.technologies.controller.dataProvider.MaterialDto) StateChangeContext(com.qcadoo.mes.states.StateChangeContext) OrderState(com.qcadoo.mes.orders.states.constants.OrderState) TranslationService(com.qcadoo.localization.api.TranslationService) StateChangeContextBuilder(com.qcadoo.mes.states.service.StateChangeContextBuilder) Either(com.qcadoo.commons.functional.Either) NumberService(com.qcadoo.model.api.NumberService) TechnologyStateStringValues(com.qcadoo.mes.technologies.states.constants.TechnologyStateStringValues) ProductFields(com.qcadoo.mes.basic.constants.ProductFields) ParameterFieldsT(com.qcadoo.mes.technologies.constants.ParameterFieldsT) OrderService(com.qcadoo.mes.orders.OrderService) Comparator(java.util.Comparator) OperationalTaskFields(com.qcadoo.mes.orders.constants.OperationalTaskFields) Entity(com.qcadoo.model.api.Entity) OrderCreationResponse(com.qcadoo.mes.orders.controllers.responses.OrderCreationResponse) GlobalMessage(com.qcadoo.model.api.validators.GlobalMessage) StateChangeContext(com.qcadoo.mes.states.StateChangeContext)

Example 12 with StateChangeContext

use of com.qcadoo.mes.states.StateChangeContext in project mes by qcadoo.

the class OrderCreationService method createTechnologyForEachOperation.

private Either<String, Entity> createTechnologyForEachOperation(OrderCreationRequest orderCreationRequest) {
    Entity product = getProduct(orderCreationRequest.getProductId());
    Entity parameter = parameterService.getParameter();
    Entity dashboardComponentsLocation = parameter.getBelongsToField(OrderCreationService.L_DASHBOARD_COMPONENTS_LOCATION);
    Entity dashboardProductsInputLocation = parameter.getBelongsToField(OrderCreationService.L_DASHBOARD_PRODUCTS_INPUT_LOCATION);
    orderCreationRequest.getTechnologyOperations().sort(Comparator.comparing(TechnologyOperationDto::getNode));
    String range = parameter.getStringField(L_RANGE);
    Entity technology = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY).create();
    technology.setField(TechnologyFields.NUMBER, technologyNameAndNumberGenerator.generateNumber(product));
    technology.setField(TechnologyFields.NAME, technologyNameAndNumberGenerator.generateName(product));
    technology.setField(TechnologyFields.PRODUCT, product);
    technology.setField(TechnologyFields.EXTERNAL_SYNCHRONIZED, true);
    technology.setField(L_RANGE, range);
    technology.setField("componentsLocation", dashboardComponentsLocation);
    technology.setField("productsInputLocation", dashboardProductsInputLocation);
    technology.setField("typeOfProductionRecording", orderCreationRequest.getTypeOfProductionRecording());
    technology = technology.getDataDefinition().save(technology);
    if (!technology.isValid()) {
        return Either.left(translationService.translate("basic.dashboard.orderDefinitionWizard.createTechnology.validationError", LocaleContextHolder.getLocale()));
    }
    Entity parent = null;
    for (TechnologyOperationDto technologyOperation : orderCreationRequest.getTechnologyOperations()) {
        Entity operation = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION).get(technologyOperation.getOperationId());
        Entity toc = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY_OPERATION_COMPONENT).create();
        toc.setField(TechnologyOperationComponentFields.OPERATION, operation);
        toc.setField(TechnologyOperationComponentFields.ENTITY_TYPE, L_OPERATION);
        for (String fieldName : FIELDS_OPERATION) {
            toc.setField(fieldName, operation.getField(fieldName));
        }
        if (operation.getField(NEXT_OPERATION_AFTER_PRODUCED_TYPE) == null) {
            toc.setField(NEXT_OPERATION_AFTER_PRODUCED_TYPE, L_ALL);
        }
        if (operation.getField(PRODUCTION_IN_ONE_CYCLE) == null) {
            toc.setField(PRODUCTION_IN_ONE_CYCLE, "1");
        }
        if (operation.getField(NEXT_OPERATION_AFTER_PRODUCED_QUANTITY) == null) {
            toc.setField(NEXT_OPERATION_AFTER_PRODUCED_QUANTITY, "0");
        }
        if (Objects.isNull(parent)) {
            Entity topoc = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION_PRODUCT_OUT_COMPONENT).create();
            topoc.setField(OperationProductOutComponentFields.QUANTITY, BigDecimal.ONE);
            topoc.setField(OperationProductOutComponentFields.PRODUCT, product);
            toc.setField(TechnologyOperationComponentFields.OPERATION_PRODUCT_OUT_COMPONENTS, Lists.newArrayList(topoc));
        }
        List<Entity> topics = Lists.newArrayList();
        for (MaterialDto material : technologyOperation.getMaterials()) {
            Entity inProduct = getProduct(material.getProductId());
            Entity topic = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION_PRODUCT_IN_COMPONENT).create();
            topic.setField(OperationProductInComponentFields.PRODUCT, inProduct);
            topic.setField(OperationProductInComponentFields.QUANTITY, material.getQuantityPerUnit());
            topics.add(topic);
        }
        toc.setField(TechnologyOperationComponentFields.OPERATION_PRODUCT_IN_COMPONENTS, topics);
        if (Objects.nonNull(parent)) {
            toc.setField(TechnologyOperationComponentFields.PARENT, parent.getId());
        }
        toc.setField(TechnologyOperationComponentFields.TECHNOLOGY, technology.getId());
        toc = toc.getDataDefinition().save(toc);
        if (Objects.nonNull(technologyOperation.getWorkstationId())) {
            List<Entity> workstations = Lists.newArrayList(toc.getHasManyField(TechnologyOperationComponentFields.WORKSTATIONS));
            Entity workstation = dataDefinitionService.get(BasicConstants.PLUGIN_IDENTIFIER, BasicConstants.MODEL_WORKSTATION).get(technologyOperation.getWorkstationId());
            workstations.add(workstation);
            toc.setField(TechnologyOperationComponentFields.WORKSTATIONS, workstations);
        }
        toc = toc.getDataDefinition().save(toc);
        technologyOperation.setId(toc.getId());
        if (toc.getHasManyField(TechnologyOperationComponentFields.OPERATION_PRODUCT_OUT_COMPONENTS).isEmpty()) {
            Entity topoc = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION_PRODUCT_OUT_COMPONENT).create();
            topoc.setField(OperationProductOutComponentFields.QUANTITY, BigDecimal.ONE);
            topoc.setField(OperationProductOutComponentFields.PRODUCT, getOrCreateProduct(operation));
            topoc.setField(OperationProductOutComponentFields.OPERATION_COMPONENT, toc);
            topoc.getDataDefinition().save(topoc);
        }
        parent = toc;
    }
    if (technology.isValid()) {
        final StateChangeContext technologyStateChangeContext = stateChangeContextBuilder.build(technologyStateChangeAspect.getChangeEntityDescriber(), technology, TechnologyState.ACCEPTED.getStringValue());
        technologyStateChangeAspect.changeState(technologyStateChangeContext);
        technology = technology.getDataDefinition().get(technology.getId());
        if (!technology.getStringField(TechnologyFields.STATE).equals(TechnologyStateStringValues.ACCEPTED)) {
            return Either.left(translationService.translate("basic.dashboard.orderDefinitionWizard.createTechnology.acceptError", LocaleContextHolder.getLocale()));
        }
        technology.setField(TechnologyFields.MASTER, Boolean.TRUE);
        technology.getDataDefinition().save(technology);
    } else {
        return Either.left(translationService.translate("basic.dashboard.orderDefinitionWizard.createTechnology.validationError", LocaleContextHolder.getLocale()));
    }
    return Either.right(technology);
}
Also used : Entity(com.qcadoo.model.api.Entity) MaterialDto(com.qcadoo.mes.technologies.controller.dataProvider.MaterialDto) StateChangeContext(com.qcadoo.mes.states.StateChangeContext) TechnologyOperationDto(com.qcadoo.mes.orders.controllers.dto.TechnologyOperationDto)

Example 13 with StateChangeContext

use of com.qcadoo.mes.states.StateChangeContext in project mes by qcadoo.

the class OrderStateReasonViewListeners method cancelStateChange.

public void cancelStateChange(final ViewDefinitionState view, final ComponentState form, final String[] args) {
    final Entity stateChangeEntity = ((FormComponent) form).getEntity();
    stateChangeEntity.setField(REASON_REQUIRED, false);
    final StateChangeContext stateContext = stateChangeContextBuilder.build(orderStateChangeService.getChangeEntityDescriber(), stateChangeEntity);
    stateContext.setStatus(StateChangeStatus.CANCELED);
    stateContext.save();
    orderStateChangeViewClient.showMessages(new ViewContextHolder(view, form), stateContext);
}
Also used : Entity(com.qcadoo.model.api.Entity) FormComponent(com.qcadoo.view.api.components.FormComponent) ViewContextHolder(com.qcadoo.mes.states.service.client.util.ViewContextHolder) StateChangeContext(com.qcadoo.mes.states.StateChangeContext)

Example 14 with StateChangeContext

use of com.qcadoo.mes.states.StateChangeContext in project mes by qcadoo.

the class AssignmentToShiftStatesHelper method changeState.

public void changeState(final Entity assignmentToShift, final AssignmentToShiftState state) {
    StateChangeContext context = stateChangeContextBuilder.build(assignmentToShiftStateChangeDescriber, assignmentToShift, state.getStringValue());
    assignmentToShiftStateChangeAspect.changeState(context);
}
Also used : StateChangeContext(com.qcadoo.mes.states.StateChangeContext)

Example 15 with StateChangeContext

use of com.qcadoo.mes.states.StateChangeContext in project mes by qcadoo.

the class OrderStatesListenerServicePFTD method checkMaterialAvailability.

public void checkMaterialAvailability(StateChangeContext stateChangeContext) {
    Entity order = stateChangeContext.getOwner();
    StateEnum targetState = stateChangeContext.getStateEnumValue(stateChangeContext.getDescriber().getTargetStateFieldName());
    Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY);
    String momentOfValidation = parameterService.getParameter().getStringField(ParameterFieldsPFTD.MOMENT_OF_VALIDATION);
    String message = "productFlowThruDivision.order.state.accept.error.missingComponents";
    String messageShort = "productFlowThruDivision.order.state.accept.error.missingComponentsShort";
    if (MomentOfValidation.ORDER_STARTING.getStrValue().equals(momentOfValidation)) {
        message = "productFlowThruDivision.order.state.inProgress.error.missingComponents";
        messageShort = "productFlowThruDivision.order.state.inProgress.error.missingComponentsShort";
    }
    if (order.getField(OrderFieldsPFTD.IGNORE_MISSING_COMPONENTS) != null && !order.getBooleanField(OrderFieldsPFTD.IGNORE_MISSING_COMPONENTS) && technology != null && (OrderState.ACCEPTED == targetState && MomentOfValidation.ORDER_ACCEPTANCE.getStrValue().equals(momentOfValidation) || OrderState.IN_PROGRESS == targetState && MomentOfValidation.ORDER_STARTING.getStrValue().equals(momentOfValidation))) {
        List<Entity> entries = orderMaterialAvailability.generateMaterialAvailabilityForOrder(order);
        List<Entity> notAvailableProducts = entries.stream().filter(en -> !AvailabilityOfMaterialAvailability.FULL.getStrValue().equals(en.getStringField(MaterialAvailabilityFields.AVAILABILITY))).map(entity -> entity.getBelongsToField(MaterialAvailabilityFields.PRODUCT)).collect(Collectors.toList());
        if (!notAvailableProducts.isEmpty()) {
            String missingProductNames = StringUtils.join(notAvailableProducts.stream().map(product -> product.getStringField(ProductFields.NAME)).collect(Collectors.toList()), ", ");
            if (missingProductNames.length() < 255) {
                stateChangeContext.addMessage(message, StateMessageType.FAILURE, false, missingProductNames);
            } else {
                stateChangeContext.addMessage(messageShort, StateMessageType.FAILURE, false);
            }
        }
    }
}
Also used : MaterialFlowConstants(com.qcadoo.mes.materialFlow.constants.MaterialFlowConstants) LoggerFactory(org.slf4j.LoggerFactory) com.qcadoo.mes.productionCounting.constants(com.qcadoo.mes.productionCounting.constants) Autowired(org.springframework.beans.factory.annotation.Autowired) DocumentManagementService(com.qcadoo.mes.materialFlowResources.service.DocumentManagementService) UnitConversionService(com.qcadoo.model.api.units.UnitConversionService) SearchResult(com.qcadoo.model.api.search.SearchResult) StringUtils(org.apache.commons.lang3.StringUtils) BigDecimal(java.math.BigDecimal) ProductionCountingDocumentService(com.qcadoo.mes.productFlowThruDivision.service.ProductionCountingDocumentService) TransactionAspectSupport(org.springframework.transaction.interceptor.TransactionAspectSupport) RealProductionCostService(com.qcadoo.mes.productFlowThruDivision.realProductionCost.RealProductionCostService) SearchRestrictions(com.qcadoo.model.api.search.SearchRestrictions) OrderMaterialsCostDataGenerator(com.qcadoo.mes.costNormsForMaterials.orderRawMaterialCosts.OrderMaterialsCostDataGenerator) DataDefinition(com.qcadoo.model.api.DataDefinition) Collectors(java.util.stream.Collectors) DocumentBuilder(com.qcadoo.mes.materialFlowResources.service.DocumentBuilder) com.qcadoo.mes.productFlowThruDivision.constants(com.qcadoo.mes.productFlowThruDivision.constants) StateEnum(com.qcadoo.mes.states.StateEnum) Entity(com.qcadoo.model.api.Entity) ParameterService(com.qcadoo.mes.basic.ParameterService) ProductionCountingQuantityTypeOfMaterial(com.qcadoo.mes.basicProductionCounting.constants.ProductionCountingQuantityTypeOfMaterial) SearchCriteriaBuilder(com.qcadoo.model.api.search.SearchCriteriaBuilder) ProductionTrackingDocumentsHelper(com.qcadoo.mes.productionCounting.utils.ProductionTrackingDocumentsHelper) OrderFieldsCNFM(com.qcadoo.mes.costNormsForMaterials.constants.OrderFieldsCNFM) DataDefinitionService(com.qcadoo.model.api.DataDefinitionService) java.util(java.util) MultiHashMap(org.apache.commons.collections.MultiHashMap) DocumentStateChangeService(com.qcadoo.mes.materialFlowResources.service.DocumentStateChangeService) OrderFields(com.qcadoo.mes.orders.constants.OrderFields) com.qcadoo.mes.materialFlowResources.constants(com.qcadoo.mes.materialFlowResources.constants) Multimap(com.google.common.collect.Multimap) StateMessageType(com.qcadoo.mes.states.messages.constants.StateMessageType) ProductionCountingQuantityFields(com.qcadoo.mes.basicProductionCounting.constants.ProductionCountingQuantityFields) ErrorMessage(com.qcadoo.model.api.validators.ErrorMessage) BasicProductionCountingConstants(com.qcadoo.mes.basicProductionCounting.constants.BasicProductionCountingConstants) Lists(com.google.common.collect.Lists) PossibleUnitConversions(com.qcadoo.model.api.units.PossibleUnitConversions) ResourceManagementService(com.qcadoo.mes.materialFlowResources.service.ResourceManagementService) Service(org.springframework.stereotype.Service) StateChangeContext(com.qcadoo.mes.states.StateChangeContext) Logger(org.slf4j.Logger) OrderState(com.qcadoo.mes.orders.states.constants.OrderState) UnitConversionItemFieldsB(com.qcadoo.mes.basic.constants.UnitConversionItemFieldsB) Maps(com.google.common.collect.Maps) SearchQueryBuilder(com.qcadoo.model.api.search.SearchQueryBuilder) MultiMap(org.apache.commons.collections.MultiMap) ProductionCountingQuantityRole(com.qcadoo.mes.basicProductionCounting.constants.ProductionCountingQuantityRole) Either(com.qcadoo.commons.functional.Either) ProductFields(com.qcadoo.mes.basic.constants.ProductFields) Preconditions(com.google.common.base.Preconditions) OrderMaterialAvailability(com.qcadoo.mes.productFlowThruDivision.OrderMaterialAvailability) ProductionTrackingStateStringValues(com.qcadoo.mes.productionCounting.states.constants.ProductionTrackingStateStringValues) Transactional(org.springframework.transaction.annotation.Transactional) Entity(com.qcadoo.model.api.Entity) StateEnum(com.qcadoo.mes.states.StateEnum)

Aggregations

StateChangeContext (com.qcadoo.mes.states.StateChangeContext)25 Entity (com.qcadoo.model.api.Entity)20 FormComponent (com.qcadoo.view.api.components.FormComponent)10 ViewContextHolder (com.qcadoo.mes.states.service.client.util.ViewContextHolder)8 Lists (com.google.common.collect.Lists)7 List (java.util.List)7 Autowired (org.springframework.beans.factory.annotation.Autowired)7 Service (org.springframework.stereotype.Service)6 TranslationService (com.qcadoo.localization.api.TranslationService)5 DataDefinition (com.qcadoo.model.api.DataDefinition)5 DataDefinitionService (com.qcadoo.model.api.DataDefinitionService)5 Collectors (java.util.stream.Collectors)5 Sets (com.google.common.collect.Sets)4 ProductFields (com.qcadoo.mes.basic.constants.ProductFields)4 ErrorMessage (com.qcadoo.model.api.validators.ErrorMessage)4 ProductFamilyElementType (com.qcadoo.mes.basic.constants.ProductFamilyElementType)3 OrderFields (com.qcadoo.mes.orders.constants.OrderFields)3 OrdersConstants (com.qcadoo.mes.orders.constants.OrdersConstants)3 StateMessageType (com.qcadoo.mes.states.messages.constants.StateMessageType)3 BigDecimal (java.math.BigDecimal)3