Search in sources :

Example 1 with PositionBuilder

use of com.qcadoo.mes.materialFlowResources.print.helper.PositionBuilder in project mes by qcadoo.

the class DispositionOrderPdfService method fillPositions.

private void fillPositions(PositionsHolder positionsHolder, List<Entity> positions) {
    for (Entity position : positions) {
        PositionBuilder builder = new PositionBuilder();
        builder.setIndex(PositionDataProvider.index(position)).setStorageLocation(getDataForStorageLocation(position)).setPalletNumber(PositionDataProvider.palletNumber(position)).setTypeOfPallet(PositionDataProvider.typeOfPallet(position)).setAdditionalCode(PositionDataProvider.additionalCode(position)).setProductName(getDataForProduct(position)).setQuantity(position.getDecimalField(PositionFields.QUANTITY)).setUnit(PositionDataProvider.unit(position)).setProduct(position.getBelongsToField(PositionFields.PRODUCT).getId());
        if (Objects.nonNull(position.getBelongsToField(PositionFields.BATCH))) {
            builder.setBatch(position.getBelongsToField(PositionFields.BATCH).getStringField(BatchFields.NUMBER));
        }
        if (acceptanceOfDocumentBeforePrinting) {
            builder.setTargetPallet(getDataForTargetPallet(position));
        }
        positionsHolder.addPosition(builder.createPosition());
    }
}
Also used : Entity(com.qcadoo.model.api.Entity) PositionBuilder(com.qcadoo.mes.materialFlowResources.print.helper.PositionBuilder)

Aggregations

PositionBuilder (com.qcadoo.mes.materialFlowResources.print.helper.PositionBuilder)1 Entity (com.qcadoo.model.api.Entity)1