本文整理了Java中com.qcadoo.model.api.Entity.copy()
方法的一些代码示例,展示了Entity.copy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.copy()
方法的具体详情如下:
包路径:com.qcadoo.model.api.Entity
类名称:Entity
方法名:copy
暂无
代码示例来源:origin: qcadoo/mes
/**
* Returns a copy of the underlying entity.
*
* @return a copy of the underlying entity.
*/
public Entity getEntity() {
return shift.copy();
}
代码示例来源:origin: qcadoo/mes
@Override
public Entity getWrappedEntity() {
return entity.copy();
}
代码示例来源:origin: qcadoo/mes
private List<Entity> mergePositionsBeforeValidation(final List<Entity> positions) {
List<Entity> mergedPositions = Lists.newArrayList();
for (Entity position : positions) {
Optional<Entity> mergedPosition = mergedPositions.stream()
.filter(merged -> merged.getBelongsToField(PositionFields.PRODUCT).getId()
.equals(position.getBelongsToField(PositionFields.PRODUCT).getId()))
.findAny();
if (mergedPosition.isPresent()) {
mergedPosition.get().setField(PositionFields.QUANTITY, mergedPosition.get()
.getDecimalField(PositionFields.QUANTITY).add(position.getDecimalField(PositionFields.QUANTITY)));
} else {
mergedPositions.add(position.copy());
}
}
return mergedPositions;
}
代码示例来源:origin: qcadoo/mes
public Shift(final Entity shiftEntity) {
Entity shiftEntityCopy = shiftEntity.copy();
this.shift = shiftEntityCopy;
this.shiftId = shiftEntityCopy.getId();
this.workingHoursPerDay = getWorkingHoursPerDay(shiftEntityCopy, true);
this.timetableExceptions = new ShiftTimetableExceptions(shiftEntityCopy);
}
代码示例来源:origin: qcadoo/mes
private Entity copyReferencedTechnologyOperations(final Entity node, final Entity technology) {
Entity copy = node.copy();
copy.setId(null);
copy.setField(TechnologyOperationComponentFields.PARENT, null);
copy.setField(TechnologyOperationComponentFields.TECHNOLOGY, technology);
for (Entry<String, Object> entry : node.getFields().entrySet()) {
Object value = entry.getValue();
if (value instanceof EntityList) {
EntityList entities = (EntityList) value;
List<Entity> copies = Lists.newArrayList();
for (Entity entity : entities) {
copies.add(copyReferencedTechnologyOperations(entity, technology));
}
copy.setField(entry.getKey(), copies);
}
}
return copy;
}
代码示例来源:origin: qcadoo/mes
public Shift(final Entity shiftEntity, final DateTime day) {
Entity shiftEntityCopy = shiftEntity.copy();
this.shift = shiftEntityCopy;
this.shiftId = shiftEntityCopy.getId();
this.workingHoursPerDay = getWorkingHoursPerDay(shiftEntityCopy, true);
this.timetableExceptions = new ShiftTimetableExceptions(shiftEntityCopy);
getShiftDates(day);
}
代码示例来源:origin: qcadoo/mes
public Shift(final Entity shiftEntity, final DateTime day, final boolean checkWorking) {
Entity shiftEntityCopy = shiftEntity.copy();
this.shift = shiftEntityCopy;
this.shiftId = shiftEntityCopy.getId();
this.workingHoursPerDay = getWorkingHoursPerDay(shiftEntityCopy, checkWorking);
this.timetableExceptions = new ShiftTimetableExceptions(shiftEntityCopy);
getShiftDates(day);
}
代码示例来源:origin: qcadoo/mes
@Override
public Entity getWrappedEntity() {
final Entity resultEntity = entity.copy();
resultEntity.setField(TechnologyOperationComponentFields.CHILDREN, subOperationsAsEntities());
resultEntity.setField(TechnologyOperationComponentFields.OPERATION_PRODUCT_IN_COMPONENTS,
productComponentsToEntities(inputPoducts));
resultEntity.setField(TechnologyOperationComponentFields.OPERATION_PRODUCT_OUT_COMPONENTS,
productComponentsToEntities(outputPoducts));
return resultEntity;
}
代码示例来源:origin: qcadoo/mes
private void fillPositions(Entity location, Entity document, DocumentBuilder pzBuilder) {
List<Entity> positions = document.getHasManyField(DocumentFields.POSITIONS);
positions.forEach(pos -> {
Entity pzPosition = pos.copy();
pzPosition.setId(null);
pzPosition.setField(PositionFields.DOCUMENT, null);
pzPosition.setField(PositionFields.RESOURCE, null);
pzPosition.setField(PositionFields.TYPE_OF_PALLET, null);
pzPosition.setField(PositionFields.PALLET_NUMBER, null);
Optional<Entity> maybyStorageLocation = findStorageLocationForProduct(pos.getBelongsToField(PositionFields.PRODUCT),
location);
if (maybyStorageLocation.isPresent()) {
pzPosition.setField(PositionFields.STORAGE_LOCATION, maybyStorageLocation.get());
} else {
pzPosition.setField(PositionFields.STORAGE_LOCATION, null);
}
pzBuilder.addPosition(pzPosition);
});
}
代码示例来源:origin: qcadoo/mes
public void generateProductStructure(final ViewDefinitionState view, final ComponentState state, final String[] args) {
FormComponent form = (FormComponent) view.getComponentByReference("form");
FormComponent productStructureForm = (FormComponent) view.getComponentByReference("productStructureForm");
Entity technology = form.getEntity();
Entity productTechnology = technology.copy();
EntityTree generatedTree = productStructureTreeService.generateProductStructureTree(view, technology);
productTechnology.setField(PRODUCT_STRUCTURE_TREE, generatedTree);
productStructureForm.setEntity(productTechnology);
WindowComponent window = (WindowComponent) view.getComponentByReference("window");
window.setActiveTab("productStructure");
}
代码示例来源:origin: qcadoo/mes
.subtract(producedQuantity, numberService.getMathContext()));
if (shouldBeCorrected) {
dailyProgress = dailyProgress.copy();
dailyProgress.setId(null);
内容来源于网络,如有侵权,请联系作者删除!