From 01aea3d0bfbf28c105486fc4bfccee052bd72ea6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 8 Jul 2024 09:56:31 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-114392=20FR-FBP=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1=E9=80=82=E9=85=8D=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/DesignTableDataManager.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 1a7f121cc5..4b3b058cf8 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 @@ -578,7 +578,15 @@ public abstract class DesignTableDataManager { bean.setDataSource(source); bean.setDataName(DataOperator.getTableDataName(source, tabledata)); bean.setParameterMap(parameterMap); - return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(bean).getTableData(); + if (checkBean(bean)) { + return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(bean).getTableData(); + } else { + PreviewDataBean dataBean = new PreviewDataBean(); + dataBean.setDataSource(tabledata); + dataBean.setParameterMap(parameterMap); + return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(dataBean).getTableData(); + } + } catch (Exception e) { throw new TableDataException(e.getMessage(), e); } finally { @@ -597,6 +605,11 @@ public abstract class DesignTableDataManager { } } + private static boolean checkBean(PreviewSourceBean bean) { + // dataName为空说明是新建的,得用tabledata传 + return !bean.getDataName().isEmpty(); + } + private static boolean needInputParams(boolean mustInputParameters, ParameterProvider[] parameters) { if (mustInputParameters && ArrayUtils.isNotEmpty(parameters)) { return true;