Browse Source

Merge pull request #1522 in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit 'b5c6415475c407b49c1cabf048c07f9a96915ec3':
  REPORT-28202 && REPORT-28259 && REPORT-27271 && REPORT-28036
feature/big-screen
Hades 5 years ago
parent
commit
619d35c0bd
  1. 9
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  2. 13
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java
  3. 3
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  4. 2
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  5. 9
      designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java

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

@ -248,6 +248,15 @@ public abstract class DesignTableDataManager {
} }
} }
public static String[] getDsColumnNames(String dsName) {
TableDataSource dataSource = getEditingTableDataSource();
Map<String, String[]> map = columnCache.get(dataSource);
if (map == null) {
return new String[0];
}
return map.get(dsName);
}
/** /**
* august:返回当前正在编辑的具有报表数据源的模板(基本报表聚合报表) 包括 : 图表模板 * august:返回当前正在编辑的具有报表数据源的模板(基本报表聚合报表) 包括 : 图表模板
* *

13
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java

@ -50,10 +50,11 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
TableDataSource tds = adapter == null ? null : adapter.getBook(); TableDataSource tds = adapter == null ? null : adapter.getBook();
String[] colNames = tabledata.getColumnNames(tds); String[] colNames = tabledata.getColumnNames(tds);
String[] colNamesInCache = DesignTableDataManager.getDsColumnNames(name);
if(ArrayUtils.isNotEmpty(colNames)){ if(ArrayUtils.isNotEmpty(colNames)){
columnNameList = new ArrayList<String>(); return toColumnNameList(colNames);
columnNameList.addAll(Arrays.asList(colNames)); } else if (ArrayUtils.isNotEmpty(colNamesInCache)) {
return columnNameList; return toColumnNameList(colNames);
} }
EmbeddedTableData embeddedTableData = null; EmbeddedTableData embeddedTableData = null;
@ -69,6 +70,12 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
return columnNameList; return columnNameList;
} }
private List<String> toColumnNameList(String[] colNames) {
columnNameList = new ArrayList<>();
columnNameList.addAll(Arrays.asList(colNames));
return columnNameList;
}
/** /**
* 生成子节点 * 生成子节点
* *

3
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -407,8 +407,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
JTemplate<?, ?> jt = getCurrentEditingTemplate(); JTemplate<?, ?> jt = getCurrentEditingTemplate();
boolean access = jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); boolean access = jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists();
if (access) { if (access) {
closeSelectedReport(jt); jt.refreshResource();
DesignerContext.getDesignerFrame().openTemplate(jt.getEditingFILE());
} }
} }

2
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -3,7 +3,6 @@
*/ */
package com.fr.start; package com.fr.start;
import com.fr.common.detect.CommonPortDetector;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.constants.DesignerLaunchStatus;
@ -77,7 +76,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
public void on(Event event, Null param) { public void on(Event event, Null param) {
EventDispatcher.stopListen(this); EventDispatcher.stopListen(this);
collectUserInformation(); collectUserInformation();
CommonPortDetector.getInstance().execute();
} }
}); });
} }

9
designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java

@ -9,6 +9,7 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.file.ProcedureConfig; import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig; import com.fr.file.TableDataConfig;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
import com.fr.stable.ArrayUtils;
import org.easymock.EasyMock; import org.easymock.EasyMock;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
@ -146,4 +147,12 @@ public class DesignTableDataManagerTest {
"columnCache").get(); "columnCache").get();
Assert.assertEquals(new String[]{"a", "b", "c"}, map.get(null).get("ds1")); Assert.assertEquals(new String[]{"a", "b", "c"}, map.get(null).get("ds1"));
} }
@Test
public void testGetDsColumnNames() {
Assert.assertTrue(ArrayUtils.isEmpty(DesignTableDataManager.getDsColumnNames("ds1")));
String[] columnNames = new String[]{"a", "b", "c"};
DesignTableDataManager.addDsColumnNames("ds1", new String[]{"a", "b", "c"});
Assert.assertEquals(columnNames, DesignTableDataManager.getDsColumnNames("ds1"));
}
} }

Loading…
Cancel
Save