|
|
@ -9,8 +9,10 @@ import com.fr.data.TableDataSourceTailor; |
|
|
|
import com.fr.data.core.DataCoreXmlUtils; |
|
|
|
import com.fr.data.core.DataCoreXmlUtils; |
|
|
|
import com.fr.data.impl.EmbeddedTableData; |
|
|
|
import com.fr.data.impl.EmbeddedTableData; |
|
|
|
import com.fr.data.impl.NameDataModel; |
|
|
|
import com.fr.data.impl.NameDataModel; |
|
|
|
|
|
|
|
import com.fr.data.impl.storeproc.ProcedureDataModel; |
|
|
|
import com.fr.data.impl.storeproc.StoreProcedure; |
|
|
|
import com.fr.data.impl.storeproc.StoreProcedure; |
|
|
|
import com.fr.data.impl.storeproc.StoreProcedureConstants; |
|
|
|
import com.fr.data.impl.storeproc.StoreProcedureConstants; |
|
|
|
|
|
|
|
import com.fr.data.impl.storeproc.StoreProcedureHelper; |
|
|
|
import com.fr.data.operator.DataOperator; |
|
|
|
import com.fr.data.operator.DataOperator; |
|
|
|
import com.fr.design.DesignModelAdapter; |
|
|
|
import com.fr.design.DesignModelAdapter; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewTablePane; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewTablePane; |
|
|
@ -322,9 +324,8 @@ public abstract class DesignTableDataManager { |
|
|
|
|
|
|
|
|
|
|
|
public static java.util.Map<String, TableDataWrapper> getAllDataSetIncludingProcedure(java.util.Map<String, TableDataWrapper> resMap) { |
|
|
|
public static java.util.Map<String, TableDataWrapper> getAllDataSetIncludingProcedure(java.util.Map<String, TableDataWrapper> resMap) { |
|
|
|
java.util.LinkedHashMap<String, TableDataWrapper> dsMap = new java.util.LinkedHashMap<String, TableDataWrapper>(); |
|
|
|
java.util.LinkedHashMap<String, TableDataWrapper> dsMap = new java.util.LinkedHashMap<String, TableDataWrapper>(); |
|
|
|
Iterator<Entry<String, TableDataWrapper>> entryIt = resMap.entrySet().iterator(); |
|
|
|
for (Entry<String, TableDataWrapper> entry : resMap.entrySet()) { |
|
|
|
while (entryIt.hasNext()) { |
|
|
|
String key = entry.getKey(); |
|
|
|
String key = entryIt.next().getKey(); |
|
|
|
|
|
|
|
TableDataWrapper tableDataWrapper = resMap.get(key); |
|
|
|
TableDataWrapper tableDataWrapper = resMap.get(key); |
|
|
|
if (tableDataWrapper.getTableData() instanceof MultiResultTableData) { |
|
|
|
if (tableDataWrapper.getTableData() instanceof MultiResultTableData) { |
|
|
|
MultiResultTableData<?> tableData = (MultiResultTableData<?>) tableDataWrapper.getTableData(); |
|
|
|
MultiResultTableData<?> tableData = (MultiResultTableData<?>) tableDataWrapper.getTableData(); |
|
|
@ -333,9 +334,10 @@ public abstract class DesignTableDataManager { |
|
|
|
TableDataWrapper tdw = new MultiResultTableDataNameWrapper(name + "_Table", tableData); |
|
|
|
TableDataWrapper tdw = new MultiResultTableDataNameWrapper(name + "_Table", tableData); |
|
|
|
boolean hasSchemaOrResult = false; |
|
|
|
boolean hasSchemaOrResult = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 存储过程的特殊处理,还有其它名称
|
|
|
|
if (tableData instanceof StoreProcedure) { |
|
|
|
if (tableData instanceof StoreProcedure) { |
|
|
|
StoreProcedure storeProcedure = (StoreProcedure) tableData; |
|
|
|
StoreProcedure storeProcedure = (StoreProcedure) tableData; |
|
|
|
StoreProcedureParameter[] parameters = StoreProcedure.getSortPara(storeProcedure.getParameters()); |
|
|
|
StoreProcedureParameter[] parameters = StoreProcedureHelper.getSortPara(storeProcedure.getParameters()); |
|
|
|
|
|
|
|
|
|
|
|
for (StoreProcedureParameter parameter : parameters) { |
|
|
|
for (StoreProcedureParameter parameter : parameters) { |
|
|
|
if (parameter.getSchema() != StoreProcedureConstants.IN) { |
|
|
|
if (parameter.getSchema() != StoreProcedureConstants.IN) { |
|
|
@ -345,20 +347,21 @@ public abstract class DesignTableDataManager { |
|
|
|
hasSchemaOrResult = true; |
|
|
|
hasSchemaOrResult = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} /*else { |
|
|
|
for (NameDataModel nameDataModel : tableData.getDataModelList()) { |
|
|
|
// TODO getDataModelList是空的
|
|
|
|
String dmName = name + "_" + nameDataModel.getName(); |
|
|
|
for (String n : tableData.getResultNames()) { |
|
|
|
dsMap.put(nameDataModel.getName(), new MultiResultTableDataWrapper(tableData, name, dmName, false)); |
|
|
|
String dmName = name + "_" + n; |
|
|
|
} |
|
|
|
dsMap.put(n, new MultiResultTableDataWrapper(tableData, name, dmName, false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!resultNames.isEmpty()) { |
|
|
|
if (!resultNames.isEmpty()) { |
|
|
|
hasSchemaOrResult = true; |
|
|
|
hasSchemaOrResult = true; |
|
|
|
for (int i = 0; i < resultNames.size(); i++) { |
|
|
|
for (String resultName : resultNames) { |
|
|
|
String parameterName = name + "_" + resultNames.get(i); |
|
|
|
String dmName = name + "_" + resultName; |
|
|
|
TableDataWrapper newTwd = new MultiResultTableDataWrapper(tableData, name, parameterName, false); |
|
|
|
TableDataWrapper newTwd = new MultiResultTableDataWrapper(tableData, name, dmName, false); |
|
|
|
dsMap.put(parameterName, newTwd); |
|
|
|
dsMap.put(dmName, newTwd); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -622,7 +625,7 @@ public abstract class DesignTableDataManager { |
|
|
|
// 把storeProcedure写成xml文件到out
|
|
|
|
// 把storeProcedure写成xml文件到out
|
|
|
|
DataCoreXmlUtils.writeXMLStoreProcedure(writer, storeProcedure, null); |
|
|
|
DataCoreXmlUtils.writeXMLStoreProcedure(writer, storeProcedure, null); |
|
|
|
if (storeProcedure.getDataModelSize() > 0 && !storeProcedure.isFirstExpand()) { |
|
|
|
if (storeProcedure.getDataModelSize() > 0 && !storeProcedure.isFirstExpand()) { |
|
|
|
return storeProcedure.creatLazyDataModel(); |
|
|
|
return storeProcedure.getDataModelList().toArray(new ProcedureDataModel[0]); |
|
|
|
} |
|
|
|
} |
|
|
|
ParameterProvider[] inParameters = DataOperator.getInstance().getStoreProcedureParameters(storeProcedure); |
|
|
|
ParameterProvider[] inParameters = DataOperator.getInstance().getStoreProcedureParameters(storeProcedure); |
|
|
|
|
|
|
|
|
|
|
|