private DataDefinition getStaffWorkTimeDD() { return dataDefinitionService.get(ProductionCountingConstants.PLUGIN_IDENTIFIER, ProductionCountingConstants.MODEL_STAFF_WORK_TIME); } }
@Override public DataDefinition getTrackingOperationProductOutComponentDD() { return dataDefinitionService.get(ProductionCountingConstants.PLUGIN_IDENTIFIER, ProductionCountingConstants.MODEL_TRACKING_OPERATION_PRODUCT_OUT_COMPONENT); }
private DataDefinition getProductionCountingQuantitySetComponentsDD() { return dataDefinitionService.get(ProductionCountingConstants.PLUGIN_IDENTIFIER, ProductionCountingConstants.MODEL_PRODUCTION_COUNTING_QUANTITY_SET_COMPONENT); } }
@Override public DataDefinition getCoverageProductLoggingDD() { return dataDefinitionService.get(OrderSuppliesConstants.PLUGIN_IDENTIFIER, OrderSuppliesConstants.MODEL_COVERAGE_PRODUCT_LOGGING); }
@Override public DataDefinition getColumnForCoveragesDD() { return dataDefinitionService.get(OrderSuppliesConstants.PLUGIN_IDENTIFIER, OrderSuppliesConstants.MODEL_COLUMN_FOR_COVERAGES); }
@Override public DataDefinition getDataDefinition() { return dataDefinitionService .get(ProductFlowThruDivisionConstants.PLUGIN_IDENTIFIER, "warehouseIssueStateChange"); }
@Override public DataDefinition getNegotiationProductDD() { return dataDefinitionService.get(SupplyNegotiationsConstants.PLUGIN_IDENTIFIER, SupplyNegotiationsConstants.MODEL_NEGOTIATION_PRODUCT); }
private void saveMaterialAvailability(List<Entity> materialsAvailability) { DataDefinition orderMaterialAvailabilityDD = dataDefinitionService.get(ProductFlowThruDivisionConstants.PLUGIN_IDENTIFIER, ProductFlowThruDivisionConstants.MODEL_MATERIAL_AVAILABILITY); for (Entity materialAvailability : materialsAvailability) { orderMaterialAvailabilityDD.save(materialAvailability); } }
public List<Entity> findComponentRegistryEntries(final Entity order) { StringBuilder query = new StringBuilder(); query.append("select registry from #orderSupplies_coverageRegister as registry, "); query.append("#technologies_operationProductInComponent as operationProductInComponent "); query.append("where registry.order.id = :orderId and eventType in ('04orderInput','03operationInput') "); query.append("and productType = '02intermediate' "); query.append("and operationProductInComponent.operationComponent = registry.technologyOperationComponent "); query.append("and operationProductInComponent.product = registry.product order by operationProductInComponent.priority "); return dataDefinitionService.get(OrderSuppliesConstants.PLUGIN_IDENTIFIER, "coverageRegister").find(query.toString()) .setParameter("orderId", order.getId()).list().getEntities(); }
private Optional<Entity> getGenerateingMRC() { SearchCriteriaBuilder searchCriteriaBuilder = dataDefinitionService.get(OrderSuppliesConstants.PLUGIN_IDENTIFIER, OrderSuppliesConstants.MODEL_MATERIAL_REQUIREMENT_COVERAGE).find(); searchCriteriaBuilder.add(SearchRestrictions.eq("orderGenerationInProgress", true)); List<Entity> entities = searchCriteriaBuilder.list().getEntities(); if (entities.isEmpty()) { return Optional.absent(); } else { return Optional.of(entities.get(0)); } }
public List<Long> getRegisterOrderProductsIds(final List<Entity> order) { List<Long> orderIds = order.stream().map(o -> o.getId()).collect(Collectors.toList()); List<Entity> entries = dataDefinitionService .get(OrderSuppliesConstants.PLUGIN_IDENTIFIER, OrderSuppliesConstants.MODEL_COVERAGE_REGISTER).find() .createAlias(CoverageRegisterFields.ORDER, "ord", JoinType.LEFT) .add(SearchRestrictions.in("ord.id", Lists.newArrayList(orderIds))).list().getEntities(); return entries.stream().map(r -> r.getBelongsToField(CoverageRegisterFields.PRODUCT).getId()) .collect(Collectors.toList()); }
private Date findCalculatedStartAllOrders(final Entity order) { List<Entity> ordersTimeCalculations = dataDefinitionService .get(TimeNormsConstants.PLUGIN_PRODUCTION_SCHEDULING_IDENTIFIER, TimeNormsConstants.MODEL_ORDER_TIME_CALCULATION) .find().createAlias("order", "ord", JoinType.LEFT) .add(SearchRestrictions.in("ord.id", getOrderAndSubOrders(order.getId()).stream().map(entity -> entity.getId()).collect(Collectors.toList()))) .list().getEntities(); return ordersTimeCalculations.stream().map(e -> e.getDateField(OrderTimeCalculationFields.EFFECTIVE_DATE_FROM)) .min(Comparator.<Date>naturalOrder()).get(); }
private Entity createDocument() { DataDefinition documentDD = dataDefinitionService.get(MaterialFlowResourcesConstants.PLUGIN_IDENTIFIER, MaterialFlowResourcesConstants.MODEL_DOCUMENT); Entity newDocument = documentDD.create(); newDocument.setField(DocumentFields.TIME, new Date()); newDocument.setField(DocumentFields.STATE, DocumentState.DRAFT.getStringValue()); newDocument.setField(DocumentFields.POSITIONS, Lists.newArrayList()); return newDocument; }
public void setCriteriaModifierParameters(final ViewDefinitionState view) { Long orderId = (Long) view.getComponentByReference(WarehouseIssueFields.ORDER).getFieldValue(); Entity order = null; if (orderId != null) { order = dataDefinitionService.get(OrdersConstants.PLUGIN_IDENTIFIER, OrdersConstants.MODEL_ORDER).get(orderId); } setCriteriaModifierParameters(view, order); }
public List<Entity> findFinalProductsForTechnology(final Long technologyId) { List<Entity> intermediateOutProducts = dataDefinitionService .get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION_PRODUCT_OUT_COMPONENT) .find(finalHQL) .setLong(L_TECHNOLOGY_ID, technologyId).list().getEntities(); return intermediateOutProducts; }
public Entity findOrderForTechnology(Entity technology) { String sql = "select o from #orders_order o left join o.technology tech where tech.id = :technologyID"; return dataDefinitionService.get(OrdersConstants.PLUGIN_IDENTIFIER, OrdersConstants.MODEL_ORDER).find(sql) .setParameter("technologyID", technology.getId()).setMaxResults(1).uniqueResult(); }
private List<Entity> findReservationsForDelivery(final Entity delivery) { String query = buildQueryForDeliveredProductReservations(delivery); return dataDefinitionService .get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERED_PRODUCT_RESERVATION).find(query) .setParameter(DELIVER_ID, delivery.getId()).list().getEntities(); }
private boolean draftOrInProgressWarehouseIssuesDoesntExist() { DataDefinition dd = dataDefinitionService.get(ProductFlowThruDivisionConstants.PLUGIN_IDENTIFIER, ProductFlowThruDivisionConstants.MODEL_WAREHOUSE_ISSUE); SearchResult result = dd.find().add(SearchRestrictions.or( SearchRestrictions.eq(WarehouseIssueFields.STATE, WarehouseIssueState.DRAFT.getStringValue()), SearchRestrictions.eq(WarehouseIssueFields.STATE, WarehouseIssueState.IN_PROGRESS.getStringValue()))).list(); return result.getTotalNumberOfEntities() == 0; }
private Entity mapDtoToEntity(final MovedPalletDto dto) { Entity entity = dataDefinitionService .get(MaterialFlowResourcesConstants.PLUGIN_IDENTIFIER, MODEL_PALLET_STORAGE_STATE_DTO).create(); entity.setField(PALLET_NUMBER, dto.getPalletNumber()); entity.setField(STORAGE_LOCATION_NUMBER, dto.getStorageLocationNumber()); entity.setField(LOCATION_NUMBER, dto.getLocationNumber()); entity.setField(TYPE_OF_PALLET, dto.getTypeOfPallet()); return entity; }
private List<Entity> getTransferTemplates(final Entity locationFrom, final Entity locationTo) { return dataDefinitionService .get(MaterialFlowMultitransfersConstants.PLUGIN_IDENTIFIER, MaterialFlowMultitransfersConstants.MODEL_TRANSFER_TEMPLATE).find().createAlias(PRODUCT, PRODUCT) .add(SearchRestrictions.belongsTo(LOCATION_FROM, locationFrom)) .add(SearchRestrictions.belongsTo(LOCATION_TO, locationTo)).addOrder(SearchOrders.asc(PRODUCT + "." + NAME)) .list().getEntities(); }