@ -22,7 +22,6 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.DialogActionAdapter ;
import com.fr.design.file.HistoryTemplateListCache ;
import com.fr.design.gui.iprogressbar.AutoProgressBar ;
import com.fr.design.mainframe.DesignerContext ;
import com.fr.design.mainframe.JTemplate ;
import com.fr.design.parameter.ParameterInputPane ;
import com.fr.file.ProcedureConfig ;
@ -484,15 +483,9 @@ public abstract class DesignTableDataManager {
if ( ArrayUtils . isEmpty ( parameters ) ) {
parameters = tabledata . getParameters ( Calculator . createCalculator ( ) ) ;
}
final Map < String , Object > parameterMap = new HashMap < > ( ) ;
Map < String , Object > parameterMap = new HashMap < > ( ) ;
if ( needInputParams ( isMustInputParameters , parameters ) ) {
final ParameterInputPane pPane = new ParameterInputPane ( parameters ) ;
pPane . showSmallWindow ( new JFrame ( ) , new DialogActionAdapter ( ) {
@Override
public void doOk ( ) {
parameterMap . putAll ( pPane . update ( ) ) ;
}
} ) . setVisible ( true ) ;
showParaWindow ( parameterMap , parameters ) ;
} else {
for ( ParameterProvider parameter : parameters ) {
parameterMap . put ( parameter . getName ( ) , parameter . getValue ( ) ) ;
@ -583,15 +576,10 @@ public abstract class DesignTableDataManager {
return storeProcedure . creatLazyDataModel ( ) ;
}
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.
final ParameterInputPane pPane = new ParameterInputPane ( inParameters ) ;
pPane . showSmallWindow ( DesignerContext . getDesignerFrame ( ) , new DialogActionAdapter ( ) {
@Override
public void doOk ( ) {
parameterMap . putAll ( pPane . update ( ) ) ;
}
} ) . setVisible ( true ) ;
showParaWindow ( parameterMap , inParameters ) ;
}
storeProcedure . setFirstExpand ( false ) ;
@ -601,6 +589,16 @@ public abstract class DesignTableDataManager {
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 ) {
threadLocal . set ( value ) ;
}