diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 09da7a83be..0c17bcb0e9 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -9,8 +9,10 @@ import com.fr.data.MultiResultTableData; import com.fr.data.TableDataSource; import com.fr.data.TableDataSourceTailor; import com.fr.data.core.DataCoreXmlUtils; +import com.fr.data.impl.ConditionTableData; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameDataModel; +import com.fr.data.impl.RecursionTableData; import com.fr.data.impl.storeproc.ProcedureDataModel; import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.impl.storeproc.StoreProcedureConstants; @@ -589,7 +591,7 @@ public abstract class DesignTableDataManager { bean.setStart(rowCount); bean.setEnd(-1); bean.updateConvertMap(parameterMap); - if (checkBean(bean)) { + if (checkBean(bean, tabledata)) { return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(bean).getTableData(); } else { PreviewDataBean dataBean = new PreviewDataBean(); @@ -624,9 +626,16 @@ public abstract class DesignTableDataManager { } } - private static boolean checkBean(PreviewSourceBean bean) { - // dataName为空说明是新建的,得用tabledata传 - return !bean.getDataName().isEmpty(); + private static boolean checkBean(PreviewSourceBean bean, TableData tableData) { + if (bean.getDataName().isEmpty()) { + if (tableData instanceof ConditionTableData || tableData instanceof RecursionTableData) { + bean.getDataSource().putTableData(StringUtils.EMPTY, tableData); + return true; + } + // dataName为空并且不为特殊的数据集说明是新建的,得用tabledata传 + return false; + } + return true; } private static boolean needInputParams(boolean mustInputParameters, ParameterProvider[] parameters) {