@ -9,6 +9,7 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction ;
import com.fr.design.actions.UpdateAction ;
import com.fr.design.constants.UIConstants ;
import com.fr.design.constants.UIConstants ;
import com.fr.design.data.BasicTableDataTreePane ;
import com.fr.design.data.BasicTableDataTreePane ;
import com.fr.design.data.BasicTableDataUtils ;
import com.fr.design.data.DesignTableDataManager ;
import com.fr.design.data.DesignTableDataManager ;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener ;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener ;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane ;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane ;
@ -339,10 +340,11 @@ public class TableDataTreePane extends BasicTableDataTreePane {
/ * *
/ * *
* 合并数据集
* 合并数据集
* @param srcName 数据集来源 ( 比如报表块 , 就是报表块的名称 )
*
* @param srcName 数据集来源 ( 比如报表块 , 就是报表块的名称 )
* @param tableDataSource 数据集
* @param tableDataSource 数据集
* /
* /
public Map < String , String > addTableData ( String srcName , TableDataSource tableDataSource ) {
public Map < String , String > addTableData ( String srcName , TableDataSource tableDataSource , boolean isCover ) {
Map < String , String > tdNameMap = new HashMap < > ( ) ;
Map < String , String > tdNameMap = new HashMap < > ( ) ;
allDSNames = DesignTableDataManager . getAllDSNames ( tc . getBook ( ) ) ;
allDSNames = DesignTableDataManager . getAllDSNames ( tc . getBook ( ) ) ;
DesignTableDataManager . setThreadLocal ( DesignTableDataManager . NO_PARAMETER ) ;
DesignTableDataManager . setThreadLocal ( DesignTableDataManager . NO_PARAMETER ) ;
@ -352,14 +354,8 @@ public class TableDataTreePane extends BasicTableDataTreePane {
String tdName = ( String ) tdIterator . next ( ) ;
String tdName = ( String ) tdIterator . next ( ) ;
String oldName = tdName ;
String oldName = tdName ;
TableData td = tableDataSource . getTableData ( tdName ) ;
TableData td = tableDataSource . getTableData ( tdName ) ;
if ( tds . getTableData ( tdName ) ! = null | | isDsNameRepeaded ( tdName ) ) { //如果有同名的就拼上来源名称
boolean isDsNameRepeaded = isDsNameRepeaded ( tdName ) ;
tdName = srcName + tdName ;
tdName = BasicTableDataUtils . getTableDataName ( isCover , tds , tdName , srcName , isDsNameRepeaded ) ;
}
int i = 0 ;
while ( tds . getTableData ( tdName ) ! = null ) {
i + + ; //如果拼上名字后依然已经存在就加编号
tdName + = i ;
}
tds . putTableData ( tdName , td ) ;
tds . putTableData ( tdName , td ) ;
if ( ! ComparatorUtils . equals ( oldName , tdName ) ) {
if ( ! ComparatorUtils . equals ( oldName , tdName ) ) {
tdNameMap . put ( oldName , tdName ) ;
tdNameMap . put ( oldName , tdName ) ;
@ -367,8 +363,19 @@ public class TableDataTreePane extends BasicTableDataTreePane {
}
}
tc . parameterChanged ( ) ;
tc . parameterChanged ( ) ;
dataTree . refresh ( ) ;
dataTree . refresh ( ) ;
return Collections . unmodifiableMap ( tdNameMap ) ;
return Collections . unmodifiableMap ( tdNameMap ) ;
}
}
@Override
public void removeTableData ( String sourceName ) {
TableDataSource tds = tc . getBook ( ) ;
tds . removeTableData ( sourceName ) ;
dataTree . refresh ( ) ;
}
public void addDataPane ( final AbstractTableDataPane < ? > uPanel , String paneName ) {
public void addDataPane ( final AbstractTableDataPane < ? > uPanel , String paneName ) {
final NamePane nPanel = uPanel . asNamePane ( ) ;
final NamePane nPanel = uPanel . asNamePane ( ) ;
nPanel . setObjectName ( paneName ) ;
nPanel . setObjectName ( paneName ) ;