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