Browse Source

Merge pull request #8890 in DESIGN/design from release/11.0 to feature/x

* commit '3bc226893bb7ab0f90788c0f92d0f70b42b98b90':
  REPORT-70857 数据集复制后独立 【问题原因】处理重复代码问题 【改动思路】处理重复代码问题 【review建议】无
  REPORT-70857 数据集复制后独立 删去多余import
  REPORT-70857 数据集复制后独立 【问题原因】跟随复制的时候需要处理存储过程名称问题,其中有匹配TableData的操作,而复制本身还需要处理TableData的clone,如果先clone,再去匹配TableData,对象就不相等了 【改动思路】将匹配TableData的操作放在clone处理之前 【review建议】无
  REPORT-70446 mac下悬浮弹窗隐藏重新展示时偶现白点
  REPORT-71213 设计器关闭失败
  REPORT-70857 数据集复制后独立 【问题原因】数据集在做复制粘贴的时候,没有clone数据源,导致许多变量都共用了,于是会改一个=改一片 【改动方案】添加clone处理 【review建议】无
  REPORT-69285 数据连接安全关键字检查拦截,设计器
  REPORT-71062 【冒烟】设计器启动报错 不影响功能的报错日志 调整
  REPORT-71207 场景地图删除超链弹框的“取消”按钮
  REPORT-70955 许多场景不支持千分比样式
  REPORT-71160 交互问题
  REPORT-67417 处理配置空值场景
  REPORT-71221 使用alt+ f4 , alphafine面板仍会保留上一次搜索结果
  REPORT-71217 alphafine仅开启模版时,还会出现产品动态一键处理的按钮
  REPORT-68987 把高级编辑当作可选的
feature/x
superman 3 years ago
parent
commit
22e4af85b1
  1. 12
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  2. 12
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java
  3. 23
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  4. 7
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java
  5. 2
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java
  6. 8
      designer-base/src/main/java/com/fr/design/data/datapane/management/clip/TableDataTreeClipboard.java
  7. 56
      designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java
  8. 2
      designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java
  9. 2
      designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java
  10. 2
      designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerListener.java
  11. 7
      designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java
  12. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java
  13. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
  14. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java
  15. 1
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java

12
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -192,9 +192,12 @@ public class AlphaFineConfigManager implements XMLable {
if (tmpVal != null) {
tmpVal = tmpVal.replace("[",StringUtils.EMPTY).replace("]",StringUtils.EMPTY);
Stack<String> stack = new SizedStack<>(3);
List<String> historyList = Arrays.asList(tmpVal.split(","));
String[] historyList = tmpVal.split(",");
for (String history : historyList) {
stack.add(history.trim());
String value = history.trim();
if (StringUtils.isNotEmpty(value)) {
stack.add(value);
}
}
historySearchMap.put(reader.getAttrAsString("user", StringUtils.EMPTY), stack);
}
@ -215,7 +218,10 @@ public class AlphaFineConfigManager implements XMLable {
String[] idArr = tmpVal.split(",");
Set<Long> setId = new HashSet<>();
for (String id : idArr) {
setId.add(Long.parseLong(id.trim()));
String value = id.trim();
if (StringUtils.isNotEmpty(value)) {
setId.add(Long.parseLong(value));
}
}
readSetMap.put(reader.getAttrAsString("user", StringUtils.EMPTY), setId);
}

12
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java

@ -2,11 +2,15 @@ package com.fr.design.data.datapane.connect;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.editlock.EditLockUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.file.ConnectionConfig;
import com.fr.report.LockItem;
import javax.swing.JOptionPane;
/**
* @author hades
* @version 11.0
@ -32,7 +36,13 @@ public class ConnectionListDialogActionAdapter extends DialogActionAdapter {
connectionListDialog.setDoOKSucceed(false);
return;
}
connectionManagerPane.update(connectionConfig);
try {
connectionManagerPane.update(connectionConfig);
} catch (Exception e) {
connectionListDialog.setDoOKSucceed(false);
FineJOptionPane.showMessageDialog(connectionManagerPane, e.getMessage(), Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
return;
}
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
// 关闭定义数据连接页面,为其解锁
EditLockUtils.unlock(LockItem.CONNECTION);

23
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -1,6 +1,7 @@
package com.fr.design.data.datapane.connect;
import com.fr.config.RemoteConfigEvent;
import com.fr.data.core.db.JDBCSecurityChecker;
import com.fr.data.impl.Connection;
import com.fr.data.impl.ConnectionBean;
import com.fr.data.impl.JDBCDatabaseConnection;
@ -28,6 +29,7 @@ import com.fr.transaction.WorkerFacade;
import com.fr.workspace.WorkContext;
import java.awt.Window;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@ -166,7 +168,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
/**
* Update.
*/
public void update(ConnectionConfig connectionConfig) {
public void update(ConnectionConfig connectionConfig) throws Exception {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
Map<String, Connection> updatedMap = new LinkedHashMap<>();
@ -188,10 +190,27 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
}
});
this.checkSecurity(addedOrUpdatedConnections);
this.alterConnections(removedConnNames, addedOrUpdatedConnections);
}
private void checkSecurity(List<ConnectionBean> addedOrUpdatedConnections) throws Exception {
for (ConnectionBean connectionBean : addedOrUpdatedConnections) {
Connection connection = connectionBean.getConnection();
if (connection instanceof JDBCDatabaseConnection) {
try {
JDBCSecurityChecker.checkURL(((JDBCDatabaseConnection) connection).getURL());
JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery());
} catch (SQLException e) {
throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause());
}
}
}
}
private void alterConnections(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) {
try {

7
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

@ -4,9 +4,8 @@ import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.ConnectionConfig;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.HashMap;
public class ConnectionManagerPane extends LoadingBasicPane implements ConnectionShowPane {
@ -39,7 +38,7 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
this.connectionListPane.populate(datasourceManager);
}
public void update(ConnectionConfig datasourceManager) {
public void update(ConnectionConfig datasourceManager) throws Exception {
this.connectionListPane.update(datasourceManager);
}

2
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java

@ -7,7 +7,7 @@ import com.fr.file.ConnectionConfig;
* 数据链接显示面板
*/
public interface ConnectionShowPane {
void update(ConnectionConfig connectionConfig);
void update(ConnectionConfig connectionConfig) throws Exception;
void populate(ConnectionConfig connectionConfig);

8
designer-base/src/main/java/com/fr/design/data/datapane/management/clip/TableDataTreeClipboard.java

@ -1,6 +1,9 @@
package com.fr.design.data.datapane.management.clip;
import com.fr.base.TableData;
import com.fr.design.data.tabledata.paste.TableDataFollowingPasteUtils;
import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.general.NameObject;
import java.util.HashMap;
@ -45,7 +48,10 @@ public class TableDataTreeClipboard {
return resultMap;
}
for (NameObject selectedNameObject : selectedNameObjects) {
resultMap.put(selectedNameObject.getName(), (AbstractTableDataWrapper) selectedNameObject.getObject());
TableData cloned = TableDataFollowingPasteUtils.cloneTableData(((AbstractTableDataWrapper) selectedNameObject.getObject()).getTableData());
if (cloned != null) {
resultMap.put(selectedNameObject.getName(), new TemplateTableDataWrapper(cloned));
}
}
return resultMap;
}

56
designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java

@ -28,6 +28,7 @@ import com.fr.report.cell.FloatElement;
import com.fr.report.cell.tabledata.ElementUsedTableDataProvider;
import com.fr.report.worksheet.FormElementCase;
import com.fr.stable.StringUtils;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.HashMap;
@ -97,20 +98,32 @@ public class TableDataFollowingPasteUtils {
}
}
}
// 处理存储过程名称问题
return dealWithStoreProcedure(tempMap);
return dealWithTableDataMap(tempMap);
} catch (Exception e) {
FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e);
}
return new HashMap<>();
}
/**
* 处理结果集
* @param tableDataMap
* @return
*/
private static Map<String, TableData> dealWithTableDataMap(Map<String, TableData> tableDataMap) {
// 处理存储过程名称问题,名称问题需要优先处理,否则就找不到匹配的TableData了
tableDataMap = dealWithStoreProcedure(tableDataMap);
// 对TableData做clone处理
tableDataMap = dealWithTableData4Clone(tableDataMap);
return tableDataMap;
}
/**
* 处理结果集将结果集中的存储过程子表替换为原本的存储过程否则跟随粘贴过去的存储过程名称有问题
*
* @param tableDataMap
*/
public static Map<String, TableData> dealWithStoreProcedure(Map<String, TableData> tableDataMap) {
private static Map<String, TableData> dealWithStoreProcedure(Map<String, TableData> tableDataMap) {
Map<String, TableData> resultMap = new HashMap<>();
if (tableDataMap == null) {
return resultMap;
@ -150,7 +163,7 @@ public class TableDataFollowingPasteUtils {
for (Map.Entry<String, TableDataWrapper> dataWrapperEntry : dataWrapperMap.entrySet()) {
String tdName = dataWrapperEntry.getKey();
TableData td = dataWrapperEntry.getValue().getTableData();
if (ComparatorUtils.equals(td, tableData)) {
if (td.equals(tableData)) {
return tdName;
}
}
@ -179,14 +192,30 @@ public class TableDataFollowingPasteUtils {
collectTableDataInChartCollection(templateTableData, tempMap, widget);
collectTableDataInElementCaseEditor(templateTableData, tempMap, widget);
}
// 处理存储过程名称问题
return dealWithStoreProcedure(tempMap);
return dealWithTableDataMap(tempMap);
} catch (Exception e) {
FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e);
}
return new HashMap<>();
}
/**
* 对Map中所有的TableData做clone处理
* @param tempMap
*/
private static Map<String, TableData> dealWithTableData4Clone(Map<String, TableData> tempMap) {
Map<String, TableData> resultMap = new HashMap<>();
for (Map.Entry<String, TableData> entry : tempMap.entrySet()) {
String name = entry.getKey();
TableData tableData = entry.getValue();
TableData clonedTableData = cloneTableData(tableData);
if (clonedTableData != null) {
resultMap.put(name, clonedTableData);
}
}
return resultMap;
}
/**
* 收集控件-报表块中使用的数据集
*
@ -353,4 +382,19 @@ public class TableDataFollowingPasteUtils {
}
return tableDataPane;
}
/**
* clone数据源如果失败打印日志并返回null谨慎使用
* @param tableData
* @return
*/
@Nullable
public static TableData cloneTableData(TableData tableData) {
try {
return (TableData) tableData.clone();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, "clone table data {} failed", tableData.getName());
}
return null;
}
}

2
designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java

@ -58,7 +58,7 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
private static final Integer[] TYPES = new Integer[]{
FormatContents.NULL, FormatContents.NUMBER,
FormatContents.CURRENCY, FormatContents.PERCENT,
FormatContents.THOUSANDTHS,FormatContents.SCIENTIFIC,
FormatContents.SCIENTIFIC,
FormatContents.DATE, FormatContents.TIME,
FormatContents.TEXT};

2
designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java

@ -74,7 +74,7 @@ public class LoginAuthServer {
try {
server.start();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().warn(e.getMessage(), e);
}
}

2
designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerListener.java

@ -18,6 +18,6 @@ public class DesignerAnalyzerListener extends AgentBuilder.Listener.Adapter {
@Override
public void onError(String typeName, ClassLoader classLoader, JavaModule module, boolean loaded, Throwable throwable) {
FineLoggerFactory.getLogger().error("Designer-Analyzer transform error:" + typeName);
FineLoggerFactory.getLogger().warn("Designer-Analyzer transform error:" + typeName);
}
}

7
designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java

@ -40,7 +40,14 @@ public class ConfigToPropMigrator {
}
public void execute() {
try {
_execute();
} catch (Throwable throwable) {
FineLoggerFactory.getLogger().warn(throwable.getMessage(), throwable);
}
}
private void _execute() {
if (WorkContext.getCurrent().isLocal()) {
String url = "jdbc:hsqldb:file://" + WorkContext.getCurrent().getPath() + "/" + ProjectConstants.EMBED_DB_DIRECTORY + "/finedb/db;hsqldb.tx=mvcc";

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java

@ -173,12 +173,8 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
controlPane.add(buttonsPane, BorderLayout.EAST);
//确定
addOkButton(buttonsPane);
//取消
addCancelButton(buttonsPane);
controlPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return controlPane;

8
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java

@ -385,6 +385,11 @@ public class AlphaFineFrame extends JFrame {
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN));
}
selectedType = selectedLabelList.get(0).getCellType();
// 第一个tab 非产品动态
if (selectedType != CellType.PRODUCT_NEWS) {
tabLabel.setText(selectedLabelList.get(0).getText());
readLabel.setVisible(false);
}
for (SelectedLabel selectedLabel : selectedLabelList) {
selectedLabel.addMouseListener(new MouseAdapter() {
@ -803,6 +808,9 @@ public class AlphaFineFrame extends JFrame {
public void setVisible(boolean b) {
super.setVisible(b);
QuestionWindow.getInstance().setVisible(!b);
if (!b) {
AlphaFineHelper.resetAlphaFineDialog();
}
}
@Override

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java

@ -49,6 +49,10 @@ public class AlphaFineList extends JList<AlphaCellModel> {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
AlphaCellModel selectedValue = getSelectedValue();
if (selectedValue.hasAction() && !(selectedValue instanceof DocumentModel)) {
AlphaFineHelper.getAlphaFineDialog().toBack();
}
dealWithSearchResult();
}
}

1
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java

@ -55,6 +55,7 @@ public class QuestionWindow extends JWindow {
@Override
public void windowDeactivated(WindowEvent e) {
QuestionWindow.getInstance().dispose();
QuestionWindow.getInstance().setVisible(false);
}
});

Loading…
Cancel
Save