Search in sources :

Example 1 with ProductionLineDto

use of com.qcadoo.mes.productionLines.controller.dataProvider.ProductionLineDto in project mes by qcadoo.

the class DataProviderForTechnology method getTechnologyProductionLine.

public ProductionLineDto getTechnologyProductionLine(Long technologyId) {
    Entity technology = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY).get(technologyId);
    if (technology.getStringField("range").equals("01oneDivision")) {
        Entity productionLine = technology.getBelongsToField("productionLine");
        if (Objects.nonNull(productionLine)) {
            ProductionLineDto pl = new ProductionLineDto();
            pl.setId(productionLine.getId());
            pl.setName(productionLine.getStringField(ProductionLineFields.NAME));
            pl.setNumber(productionLine.getStringField(ProductionLineFields.NUMBER));
            return pl;
        }
    }
    return new ProductionLineDto();
}
Also used : Entity(com.qcadoo.model.api.Entity) ProductionLineDto(com.qcadoo.mes.productionLines.controller.dataProvider.ProductionLineDto)

Aggregations

ProductionLineDto (com.qcadoo.mes.productionLines.controller.dataProvider.ProductionLineDto)1 Entity (com.qcadoo.model.api.Entity)1