Browse Source

REPORT-88426 模板数据集和服务器数据集重名时,保存模板会错误校验

release/11.0
John.Ying-应志浩 2 years ago
parent
commit
9c3d029950
  1. 8
      designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
  2. 17
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

8
designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java

@ -378,12 +378,8 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
protected boolean isDsNameRepeaded(String name) {
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
for (int i = 0; i < allDSNames.length; i++) {
if (ComparatorUtils.equals(name, allDSNames[i])) {
return true;
}
}
return false;
Set<String> allDSNamesWithoutPermissions = DesignTableDataManager.getAllDSNamesWithoutPermissions(tc.getBook());
return allDSNamesWithoutPermissions.contains(name);
}
protected KeyAdapter getTableTreeNodeListener(final UpdateAction editAction, final UpdateAction previewTableDataAction, final UpdateAction removeAction, final TableDataSourceOP op, final TableDataTree dataTree) {

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

@ -48,6 +48,7 @@ import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
@ -295,6 +296,22 @@ public abstract class DesignTableDataManager {
return list.toArray(new String[0]);
}
/**
* 获取所有的数据集名称,无论模板是不是有数据集的权限
*/
public static Set<String> getAllDSNamesWithoutPermissions(TableDataSource source) {
Set<String> names = new HashSet<>();
String[] allDSNames = getAllDSNames(source);
Map<String, TableData> tableDatas = TableDataConfig.getInstance().getTableDatas();
for (String dsName : allDSNames) {
names.add(dsName);
}
for (Map.Entry<String, TableData> entry : tableDatas.entrySet()) {
names.add(entry.getKey());
}
return names;
}
/**
* 不根据过滤设置返回当前模板数据集服务器数据集存储过程本身是有顺序的
*/

Loading…
Cancel
Save