Browse Source

Pull request #1754: REPORT-33731 带参存储过程预览没有弹出参数输入框

Merge in DESIGN/design from ~ZACK/design:release/10.0 to release/10.0

* commit '04b01ff4664ca43ae8db712cd02ba1bf4b7185f3':
  import设置不对
  REPORT-33731 带参存储过程预览没有弹出参数输入框
feature/big-screen
zack 4 years ago
parent
commit
b9d6dfb9d5
  1. 32
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

32
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;
@ -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