本文整理了Java中com.qcadoo.model.api.Entity.getField()
方法的一些代码示例,展示了Entity.getField()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getField()
方法的具体详情如下:
包路径:com.qcadoo.model.api.Entity
类名称:Entity
方法名:getField
暂无
代码示例来源:origin: qcadoo/mes
private boolean shouldCopyFromLowerInstance(final Entity technologyOperationComponent) {
// we can't use here getBooleanField() method!!!!
if (technologyOperationComponent.getField(IS_SUBCONTRACTING) != null) {
return false;
}
return true;
}
代码示例来源:origin: qcadoo/mes
@Override
public int compare(final Entity o1, final Entity o2) {
return ((Entity) o1.getField(L_OPERATION)).getField(L_NUMBER).toString()
.compareTo(((Entity) o2.getField(L_OPERATION)).getField(L_NUMBER).toString());
}
代码示例来源:origin: qcadoo/mes
private void setInitialDocumentAcceptationInProgress(final Entity document) {
if (document.getField(DocumentFields.ACCEPTATION_IN_PROGRESS) == null) {
document.setField(DocumentFields.ACCEPTATION_IN_PROGRESS, false);
}
}
代码示例来源:origin: qcadoo/mes
public void onSave(final DataDefinition productToIssueDD, final Entity issue) {
if(issue.getField(IssueFields.ISSUED) == null){
issue.setField(IssueFields.ISSUED, false);
}
}
代码示例来源:origin: qcadoo/mes
private void checkRequired(final List<String> fieldNames, final StateChangeContext stateChangeContext) {
checkArgument(stateChangeContext != null, ENTITY_IS_NULL);
final Entity stateChangeEntity = stateChangeContext.getOwner();
for (String fieldName : fieldNames) {
if (stateChangeEntity.getField(fieldName) == null) {
stateChangeContext.addFieldValidationError(fieldName, "orders.order.orderStates.fieldRequired");
}
}
}
}
代码示例来源:origin: qcadoo/mes
@Override
public boolean checkAutogenealogyRequired() {
Entity parameter = parameterService.getParameter();
if (parameter.getField("batchForDoneOrder") == null) {
return false;
} else {
return !"01none".equals(parameter.getStringField("batchForDoneOrder"));
}
}
代码示例来源:origin: qcadoo/mes
private void addErrorIfNull(Entity entity, DataDefinition dataDefinition, String fieldName, String error) {
if (entity.getField(fieldName) == null) {
entity.addError(dataDefinition.getField(fieldName), error);
}
}
}
代码示例来源:origin: qcadoo/mes
private void checkMissing(Entity position, String fieldname, DataDefinition positionDataDefinition) {
if (position.getField(fieldname) == null) {
position.addError(positionDataDefinition.getField(fieldname), "qcadooView.validate.field.error.missing");
}
}
代码示例来源:origin: qcadoo/mes
public void addFieldsForParameter(final DataDefinition dataDefinition, final Entity parameter) {
if (parameter.getField(ParameterFieldsAG.BATCH_NUMBER_UNIQUENESS) == null) {
parameter.setField(ParameterFieldsAG.BATCH_NUMBER_UNIQUENESS, BatchNumberUniqueness.GLOBALLY.getStringValue());
}
}
代码示例来源:origin: qcadoo/mes
public void fillUnit(final DataDefinition productDD, final Entity product) {
if (product.getField(UNIT) == null) {
product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters());
}
}
代码示例来源:origin: qcadoo/mes
private Multimap<Optional<TechnologyOperationId>, ProductInfo> findAndGroup(final String hqlQuery, final TechnologyId techId,
final String groupBy, final Map<ProductId, TechnologyId> defaultTechnologies, boolean filterIntermediate) {
List<Entity> entities = getGeneratorTreeNodeDD().find(hqlQuery).setLong("techId", techId.get()).list().getEntities();
if(filterIntermediate){
entities = entities.stream().filter(p -> (Long) p.getField("isIntermediate") == 0l)
.collect(Collectors.toList());
}
Multimap<Optional<TechnologyOperationId>, Entity> groupedProjections = Multimaps.index(entities, (e) -> Optional
.ofNullable((Long) e.getField(groupBy)).map(TechnologyOperationId::new));
return ImmutableMultimap.copyOf(Multimaps.transformValues(groupedProjections,
p -> buildProductInfo(p, defaultTechnologies)));
}
代码示例来源:origin: qcadoo/mes
public List<Entity> getOperationProductsForTechnology(final Long technologyId) {
List<Entity> operationProductsTo = dataDefinitionService
.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION_PRODUCT_IN_COMPONENT)
.find(inComponentEntityHQL)
.setLong(L_TECHNOLOGY_ID, technologyId).list().getEntities();
return operationProductsTo.stream().filter(p -> (Long) p.getField(L_IS_INTERMEDIATE) == 0l).map(p -> p.getBelongsToField(L_OPERATION_PRODUCT))
.collect(Collectors.toList());
}
代码示例来源:origin: qcadoo/mes
public void setCommissionedPlannedQuantity(final DataDefinition orderDD, final Entity order) {
if (order == null) {
return;
}
Object quantity = order.getField(OrderFields.PLANNED_QUANTITY);
if (quantity != null) {
if (BigDecimalUtils.tryParse(quantity.toString(), LocaleContextHolder.getLocale()).isRight()) {
order.setField(OrderFields.COMMISSIONED_PLANNED_QUANTITY,
numberService.setScaleWithDefaultMathContext(order.getDecimalField(OrderFields.PLANNED_QUANTITY)));
}
}
}
代码示例来源:origin: qcadoo/mes
private void checkIfForOneDivisionLocationIsSet(final Entity technology, final StateChangeContext stateChangeContext) {
if (technology.getField(TechnologyFieldsPFTD.RANGE).equals(Range.ONE_DIVISION.getStringValue())) {
if (technology.getBelongsToField(TechnologyFieldsPFTD.COMPONENTS_LOCATION) == null) {
stateChangeContext.addFieldValidationError(TechnologyFieldsPFTD.COMPONENTS_LOCATION,
L_QCADOO_VIEW_VALIDATE_FIELD_ERROR_MISSING);
}
if (technology.getBelongsToField(TechnologyFieldsPFTD.PRODUCTS_INPUT_LOCATION) == null) {
stateChangeContext.addFieldValidationError(TechnologyFieldsPFTD.PRODUCTS_INPUT_LOCATION,
L_QCADOO_VIEW_VALIDATE_FIELD_ERROR_MISSING);
}
}
}
代码示例来源:origin: qcadoo/mes
public void setDefaultValueForTechnologyBatchRequiredField(final DataDefinition dataDefinition, final Entity entity) {
if (entity.getId() != null) {
return;
}
if (entity.getField("technologyBatchRequired") != null) {
return;
}
Entity parameter = parameterService.getParameter();
entity.setField("technologyBatchRequired", parameter.getBooleanField("batchNumberRequiredProducts"));
}
}
代码示例来源:origin: qcadoo/mes
private Collection<Long> getContextIds() {
DataDefinition dataDef = getDataDefinition();
SearchCriteriaBuilder scb = dataDef.find();
scb.setProjection(SearchProjections.alias(SearchProjections.id(), "id"));
List<Long> ids = Lists.newLinkedList();
for (Entity idProjection : scb.list().getEntities()) {
ids.add((Long) idProjection.getField("id"));
}
return ids;
}
代码示例来源:origin: qcadoo/mes
public void onBeforeRender(final ViewDefinitionState view) {
FormComponent form = (FormComponent) view.getComponentByReference(L_FORM);
Entity opic = form.getPersistedEntityWithIncludedFormValues();
LookupComponent productsFlowLocationLookup = (LookupComponent) view
.getComponentByReference(TechnologyFieldsPFTD.PRODUCTS_FLOW_LOCATION);
if (ProductionFlowComponent.WAREHOUSE.getStringValue().equals(
opic.getField(TechnologyFieldsPFTD.PRODUCTION_FLOW))) {
productsFlowLocationLookup.setEnabled(true);
} else {
productsFlowLocationLookup.setEnabled(false);
}
}
代码示例来源:origin: qcadoo/mes
private Entity createAverageWithDataFromOrder(final Entity order, final DataDefinition avgLaborCostCalcForOrderDD) {
Entity avgLaborCostCalcForOrder = avgLaborCostCalcForOrderDD.create();
avgLaborCostCalcForOrder.setField(ORDER, order);
avgLaborCostCalcForOrder.setField(START_DATE, order.getField(OrderFields.START_DATE));
avgLaborCostCalcForOrder.setField(FINISH_DATE, order.getField(OrderFields.FINISH_DATE));
avgLaborCostCalcForOrder.setField(PRODUCTION_LINE, order.getBelongsToField(OrderFields.PRODUCTION_LINE));
avgLaborCostCalcForOrder.setField(BASED_ON, "01assignment");
return avgLaborCostCalcForOrder.getDataDefinition().save(avgLaborCostCalcForOrder);
}
代码示例来源:origin: qcadoo/mes
private void fillStartDate(final Entity order) {
DateRange dateRange = orderDatesService.getCalculatedDates(order);
if (dateRange.getFrom() == null) {
order.setField(OrderFields.DATE_FROM, order.getField(OrderFields.START_DATE));
} else {
order.setField(OrderFields.START_DATE, dateRange.getFrom());
}
}
代码示例来源:origin: qcadoo/mes
public void onCreate(final DataDefinition resourceDD, final Entity resource) {
resource.setField(ResourceFields.IS_CORRECTED, false);
if (resource.getField(ResourceFields.WASTE) == null) {
resource.setField(ResourceFields.WASTE, false);
}
if (resource.getDecimalField(ResourceFields.RESERVED_QUANTITY) == null) {
resource.setField(ResourceFields.RESERVED_QUANTITY, BigDecimal.ZERO);
}
if (resource.getDecimalField(ResourceFields.AVAILABLE_QUANTITY) == null) {
resource.setField(ResourceFields.AVAILABLE_QUANTITY, resource.getDecimalField(ResourceFields.QUANTITY));
}
}
内容来源于网络,如有侵权,请联系作者删除!