use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class DocumentsListPFTD method setCriteriaModifierParameters.
public void setCriteriaModifierParameters(final ViewDefinitionState view) {
GridComponent documentsGrid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
FilterValueHolder filterValueHolder = documentsGrid.getFilterValue();
filterValueHolder.put(DocumentDtoFieldsPFTD.ORDER_NUMBER, 0);
documentsGrid.setFilterValue(filterValueHolder);
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class BatchCriteriaModifier method putProductFilterValue.
public void putProductFilterValue(final LookupComponent batchLookup, final Entity product) {
FilterValueHolder filterValueHolder = batchLookup.getFilterValue();
if (Objects.nonNull(product)) {
filterValueHolder.put(BatchCriteriaModifier.PRODUCT_ID_FILTER_VAL_KEY, product.getId());
} else {
if (filterValueHolder.has(BatchCriteriaModifier.PRODUCT_ID_FILTER_VAL_KEY)) {
filterValueHolder.remove(BatchCriteriaModifier.PRODUCT_ID_FILTER_VAL_KEY);
}
}
batchLookup.setFilterValue(filterValueHolder);
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class StaffCriteriaModifier method putCrewNumber.
public void putCrewNumber(final LookupComponent lookupComponent, final Entity crew) {
FilterValueHolder valueHolder = lookupComponent.getFilterValue();
if (crew != null) {
valueHolder.put(CREW_FILTER_VALUE, crew.getId());
} else {
valueHolder.remove(CREW_FILTER_VALUE);
}
lookupComponent.setFilterValue(valueHolder);
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class StaffCriteriaModifier method setFilterParameters.
public void setFilterParameters(final LookupComponent staffLookup, Entity assignmentToShift) {
FilterValueHolder filter = staffLookup.getFilterValue();
Date startDate = assignmentToShift.getDateField(AssignmentToShiftFields.START_DATE);
String hql = "select staff.worker.id as workerId from #assignmentToShift_staffAssignmentToShift staff " + " where staff.assignmentToShift.startDate = '" + DateUtils.toDateString(startDate) + "'";
List<Entity> workersIds = dataDefinitionService.get(AssignmentToShiftConstants.PLUGIN_IDENTIFIER, AssignmentToShiftConstants.MODEL_STAFF_ASSIGNMENT_TO_SHIFT).find(hql).list().getEntities();
if (!workersIds.isEmpty()) {
filter.put("workersIds", workersIds.stream().map(id -> id.getLongField("workerId")).collect(Collectors.toList()));
staffLookup.setFilterValue(filter);
}
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class ProductionCountingQuantityAdvancedDetailsHooks method fillBatchLookupFilter.
private void fillBatchLookupFilter(final ViewDefinitionState view) {
LookupComponent productLookup = (LookupComponent) view.getComponentByReference(ProductionCountingQuantityFields.PRODUCT);
LookupComponent batchLookup = (LookupComponent) view.getComponentByReference(L_BATCH_LOOKUP);
Entity product = productLookup.getEntity();
FilterValueHolder batchFilterValueHolder = batchLookup.getFilterValue();
if (Objects.nonNull(product)) {
batchFilterValueHolder.put(L_PRODUCT_ID, product.getId());
batchLookup.setFilterValue(batchFilterValueHolder);
} else {
if (batchFilterValueHolder.has(L_PRODUCT_ID)) {
batchFilterValueHolder.remove(L_PRODUCT_ID);
batchLookup.setFilterValue(batchFilterValueHolder);
}
}
}
Aggregations