Browse Source

REPORT-33731 带参存储过程预览没有弹出参数输入框

feature/big-screen
zack 4 years ago
parent
commit
6429b828d5
  1. 34
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

34
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -22,7 +22,6 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.parameter.ParameterInputPane; import com.fr.design.parameter.ParameterInputPane;
import com.fr.file.ProcedureConfig; import com.fr.file.ProcedureConfig;
@ -38,7 +37,7 @@ import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import javax.swing.JFrame; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -484,15 +483,9 @@ public abstract class DesignTableDataManager {
if (ArrayUtils.isEmpty(parameters)) { if (ArrayUtils.isEmpty(parameters)) {
parameters = tabledata.getParameters(Calculator.createCalculator()); parameters = tabledata.getParameters(Calculator.createCalculator());
} }
final Map<String, Object> parameterMap = new HashMap<>(); Map<String, Object> parameterMap = new HashMap<>();
if (needInputParams(isMustInputParameters, parameters)) { if (needInputParams(isMustInputParameters, parameters)) {
final ParameterInputPane pPane = new ParameterInputPane(parameters); showParaWindow(parameterMap, parameters);
pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
parameterMap.putAll(pPane.update());
}
}).setVisible(true);
} else { } else {
for (ParameterProvider parameter : parameters) { for (ParameterProvider parameter : parameters) {
parameterMap.put(parameter.getName(), parameter.getValue()); parameterMap.put(parameter.getName(), parameter.getValue());
@ -583,15 +576,10 @@ public abstract class DesignTableDataManager {
return storeProcedure.creatLazyDataModel(); return storeProcedure.creatLazyDataModel();
} }
ParameterProvider[] inParameters = DataOperator.getInstance().getStoreProcedureParameters(storeProcedure); ParameterProvider[] inParameters = DataOperator.getInstance().getStoreProcedureParameters(storeProcedure);
final Map<String, Object> parameterMap = new HashMap<String, Object>(); Map<String, Object> parameterMap = new HashMap<>();
if (inParameters.length > 0 && !ComparatorUtils.equals(threadLocal.get(), NO_PARAMETER)) {// 检查Parameter. if (inParameters.length > 0 && !ComparatorUtils.equals(threadLocal.get(), NO_PARAMETER)) {// 检查Parameter.
final ParameterInputPane pPane = new ParameterInputPane(inParameters);
pPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { showParaWindow(parameterMap, inParameters);
@Override
public void doOk() {
parameterMap.putAll(pPane.update());
}
}).setVisible(true);
} }
storeProcedure.setFirstExpand(false); storeProcedure.setFirstExpand(false);
@ -601,6 +589,16 @@ public abstract class DesignTableDataManager {
return DataOperator.getInstance().previewProcedureDataModel(storeProcedure, parameterMap, 0); return DataOperator.getInstance().previewProcedureDataModel(storeProcedure, parameterMap, 0);
} }
private static void showParaWindow(final Map<String, Object> parameterMap, ParameterProvider[] inParameters) {
final ParameterInputPane pPane = new ParameterInputPane(inParameters);
pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
parameterMap.putAll(pPane.update());
}
}).setVisible(true);
}
public static void setThreadLocal(String value) { public static void setThreadLocal(String value) {
threadLocal.set(value); threadLocal.set(value);
} }

Loading…
Cancel
Save