Browse Source

Pull request #14775: REPORT-133863 【fr-fbp回归】数据字典获取数据库字段空白 & REPORT-133888 - 【fr-fbp回归】文件数据集excel只能被选一次

Merge in DESIGN/design from ~DESTINY.LIN/design:fbp/release to fbp/release

* commit 'd4f2efb85a96a50a0422f47b28bf9b366c8ee09b':
  REPORT-133888 - 【fr-fbp回归】文件数据集excel只能被选一次
  REPORT-133863 【fr-fbp回归】数据字典获取数据库字段空白
fbp/release
Destiny.Lin-林锦龙 3 months ago
parent
commit
249f552c4b
  1. 7
      designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java
  2. 19
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  3. 16
      designer-base/src/main/java/com/fr/file/FILEFactory.java
  4. 11
      designer-base/src/main/java/com/fr/file/FileDataFILE.java
  5. 4
      designer-realize/src/main/java/com/fanruan/data/ConnectionConfigWrapper.java

7
designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java

@ -6,6 +6,7 @@ import com.fr.base.TableData;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.DBUtils;
import com.fr.data.core.db.dialect.Dialect;
import com.fr.data.impl.Connection;
import com.fr.data.impl.DatabaseDictionary;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.beans.FurtherBasicBeanPane;
@ -25,6 +26,7 @@ import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -176,8 +178,9 @@ public class DatabaseDictPane extends FurtherBasicBeanPane<DatabaseDictionary> i
if (StringUtils.isBlank(para.getDatabaseName())) {
dbDict.setDatabaseConnection(null);
} else {
database = DBUtils.checkDBConnection(para.getDatabaseName());
if (database != null) {
Connection connection = ConnectionRepository.getInstance().getByName(para.getDatabaseName()).getConnection();
if (connection != null) {
database = new NameDatabaseConnection(para.getDatabaseName());
dbDict.setDatabaseConnection(database);
}
}

19
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -1384,6 +1384,7 @@ public class FILEChooserPane extends BasicPane {
private class FileDataPlaceListModel extends AbstractPlaceListModel {
private FileDataFILE envFILE;
private String type;
FileDataPlaceListModel(String type) {
envFILE = new FileDataFILE(new FileNode(StableUtils.pathJoin(ProjectConstants.ASSETS_NAME, FileDataFILE.FILE_DATASET_NAME), true), false, StableUtils.pathJoin(ProjectConstants.ASSETS_NAME, FileDataFILE.FILE_DATASET_NAME)) {
@ -1393,6 +1394,7 @@ public class FILEChooserPane extends BasicPane {
}
};
envFILE.setType(type);
FileDataPlaceListModel.this.setType(type);
}
@Override
@ -1405,6 +1407,21 @@ public class FILEChooserPane extends BasicPane {
return 1 + filesOfSystem.size();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
protected void setCD(FILE lastDirectory) {
super.setCD(lastDirectory);
if (lastDirectory instanceof FileDataFILE) {
((FileDataFILE)lastDirectory).setType(type);
}
}
}
private class FileCAPlaceListModel extends AbstractPlaceListModel {
@ -1642,7 +1659,7 @@ public class FILEChooserPane extends BasicPane {
this.buttonList.add(createBlankButton((new SetDirectoryAction(btn_text + '/',
// alex:dir.prefix不和btn_path一起参与pathJoin,因为btn_path是否以/打头在unix,linux
// OS中意义很不一样
FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")), !needTopPath))));
FILEFactory.createFolder(dir, dir.prefix() + StableUtils.pathJoin(btn_path, "/")), !needTopPath))));
}
maxPathIndex = calculateMaxPathIndex();

16
designer-base/src/main/java/com/fr/file/FILEFactory.java

@ -39,12 +39,22 @@ public class FILEFactory {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else if (path.startsWith(FILE_DATA_PREFIX)) {
return new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), false), false, path.substring(FILE_DATA_PREFIX.length()));
} else if (path.startsWith(FILE_CA_PREFIX)) {
return new FileCAFILE(new FileNode(path.substring(FILE_CA_PREFIX.length()), false), false, path.substring(FILE_CA_PREFIX.length()));
} else {
return new FileNodeFILE(new FileNode(path, WorkContext.getWorkResource().isDirectory(path)));
}
}
public static FILE createFolder(String path) {
return createFolder(null, path);
}
/**
* 传递依据的基础文件并创建文件夹
*/
public static FILE createFolder(FILE origin, String path) {
if (path == null) {
return null;
} else if (path.startsWith(MEM_PREFIX)) {
@ -58,7 +68,11 @@ public class FILEFactory {
} else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else if (path.startsWith(FILE_DATA_PREFIX)) {
return new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), true), false, path.substring(FILE_DATA_PREFIX.length()));
FileDataFILE file = new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), true), false, path.substring(FILE_DATA_PREFIX.length()));
if (origin instanceof FileDataFILE) {
file.setType(((FileDataFILE) origin).getType());
}
return file;
} else if (path.startsWith(FILE_CA_PREFIX)) {
return new FileCAFILE(new FileNode(path.substring(FILE_CA_PREFIX.length()), true), false, path.substring(FILE_CA_PREFIX.length()));
}

11
designer-base/src/main/java/com/fr/file/FileDataFILE.java

@ -42,6 +42,13 @@ public class FileDataFILE extends FileNodeFILE{
this.id = id;
}
public FileDataFILE(FileNode node, boolean builded, String id, String type) {
super(node);
this.builded = builded;
this.id = id;
this.type = type;
}
private void addChild(FileDataFILE file) {
children.add(file);
}
@ -127,7 +134,7 @@ public class FileDataFILE extends FileNodeFILE{
FileNode fileNode = new FileNode();
fileNode.setEnvPath(bean.getPath());
fileNode.setDirectory(bean.getIsParent());
tree.putIfAbsent(bean.getId(), new FileDataFILE(fileNode, true, bean.getId()));
tree.putIfAbsent(bean.getId(), new FileDataFILE(fileNode, true, bean.getId(), type));
if (StringUtils.isEmpty(bean.getpId())) {
root = tree.get(bean.getId());
} else {
@ -147,7 +154,7 @@ public class FileDataFILE extends FileNodeFILE{
FileNode fileNode = new FileNode();
fileNode.setEnvPath(bean.getPath());
fileNode.setDirectory(bean.getIsParent());
return new FileDataFILE(fileNode, true, bean.getId());
return new FileDataFILE(fileNode, true, bean.getId(), type);
}
}
return null;

4
designer-realize/src/main/java/com/fanruan/data/ConnectionConfigWrapper.java

@ -7,6 +7,8 @@ import com.fr.file.ConnectionConfig;
import com.fr.log.FineLoggerFactory;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerAdaptor;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -106,7 +108,7 @@ public class ConnectionConfigWrapper implements ConnectionConfigProvider, Connec
@Override
public @Nullable Connection getConnection(@NotNull String connectionName) {
Connection connection = ConnectionConfig.getInstance().getConnection(connectionName);
Connection connection = WorkContext.getCurrent().isLocal() ? ConnectionConfig.getInstance().getConnection(connectionName) : ConnectionRepository.getInstance().getByName(connectionName).getConnection();
if (connection != null) {
connection.setConnectionName(connectionName);
}

Loading…
Cancel
Save