private boolean shouldSkipAddingProduct(OperationProductComponentHolder operationProductComponentHolder, Map<OperationProductComponentEntityType, Set<Entity>> entityTypeWithAlreadyAddedProducts, String typeOfProductionRecording) { OperationProductComponentEntityType entityType = operationProductComponentHolder.getEntityType(); Entity product = operationProductComponentHolder.getProduct(); return entityTypeWithAlreadyAddedProducts.containsKey(entityType) && entityTypeWithAlreadyAddedProducts.get(entityType).contains(product); }
public boolean isEntityTypeSame(final OperationProductComponentEntityType operationProductComponentEntityType) { return operationProductComponentEntityType.equals(getEntityType()); }
public Entity fromOperationProductComponentHolder(final OperationProductComponentHolder operationProductComponentHolder) { String modelName = operationProductComponentHolder.getEntityType().getStringValue(); ProductionCountingQuantityRole role = null; String typeOfMaterial = operationProductComponentHolder.getProductMaterialType().getStringValue(); if (TechnologiesConstants.MODEL_OPERATION_PRODUCT_IN_COMPONENT.equals(modelName)) { role = ProductionCountingQuantityRole.USED; } else if (TechnologiesConstants.MODEL_OPERATION_PRODUCT_OUT_COMPONENT.equals(modelName)) { role = ProductionCountingQuantityRole.PRODUCED; } else { throw new IllegalArgumentException(String.format("Unsupported operation component type: %s", modelName)); } Entity product = operationProductComponentHolder.getProduct(); return fromProduct(product, role, typeOfMaterial); }
&& OperationProductComponentEntityType.OPERATION_PRODUCT_IN_COMPONENT.equals(componentHolder.getEntityType()) && (componentHolder.getOperationProductComponentId() != null)) { Entity opic = dataDefinitionService
OperationProductComponentEntityType entityType = operationProductComponentHolder.getEntityType(); Entity product = operationProductComponentHolder.getProduct();