Browse Source

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

* commit '9692b2f5f9cb61e386089e2df1bea3a83aaad1bd':
  REPORT-67417 搜索历史/已读动态 加上持久化
  REPORT-69725 远程集群环境,存储过程数据集的参数没有复制过来 【问题原因】粘贴数据集的逻辑是使用TableDataWrapper生成TableDataPane + 使用当使用TableDataPane生成新的数据集;在生成TableDataPane的时候,会调用对应Class类型的构造方法,并populateBean一下;对于存储过程,ProcedureDataPane在populateBean的时候会在SwingWorker的doInBackground()中去做一次查询,然后在done()更新参数;远程连接下,查询的过程变长,导致还没来得及更新上参数,后续使用TableDataPane生成新的数据集时,参数为空,因此创建DataModel的时候后台报错缺失参数,前端表现为数据集编辑面板上没参数 【改动方案】1.专属于存储过程的ProcedureDataPane中提供可以更新参数的方法;2.对复制粘贴时调用的生成TableDataPane的方法包了一层,然后判断是否为存储过程,如果是的话,将源TableData的参数直接更新进去,保证后面这个Pane里是一直有参数的 【review建议】可能有更好的改法,这里这么改主要是因为生成TableDataPane和populateBean的代码都比较古老,逻辑也不熟,不太敢改。
  REPORT-71157 alphafine 高级搜索功能失效
  REPORT-71052 【冒烟】单元格删除所有超链,再次添加超链,样式没有恢复为默认蓝字+下划线 1、添加判断
  REPORT-71052 【冒烟】单元格删除所有超链,再次添加超链,样式没有恢复为默认蓝字+下划线 1、添加判断
  REPORT-71083 清空后 重新搜索同样内容无结果
  REPORT-71083 清空后 重新搜索同样内容无结果
  REPORT-70681 异常输出调整
  REPORT-71082 alphafine在点击帮助文档跳转后 会自动跳到最底层
  REPORT-66853 老决策报表-没有勾选图片压缩,报表块设置图片主体填充,web预览时图片会模糊 1、修改了jpg图像的存储方式,使用原文件直接存储
feature/x
superman 3 years ago
parent
commit
ed461206e3
  1. 66
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  3. 20
      designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java
  4. 8
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  5. 2
      designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java
  6. 33
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
  7. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java
  8. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

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

@ -9,7 +9,7 @@ import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLReadable; import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLable; import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import java.util.ArrayList; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@ -99,7 +99,6 @@ public class AlphaFineConfigManager implements XMLable {
private String cacheBuildNO; private String cacheBuildNO;
// todo 暂不持久化 方便测试
/** /**
* key: 登录的bbs用户 * key: 登录的bbs用户
* value: alphaFine历史搜索记录 * value: alphaFine历史搜索记录
@ -154,6 +153,10 @@ public class AlphaFineConfigManager implements XMLable {
} else if (reader.isChildNode()) { } else if (reader.isChildNode()) {
if (ComparatorUtils.equals(reader.getTagName(), "ActionSearchTextCache")) { if (ComparatorUtils.equals(reader.getTagName(), "ActionSearchTextCache")) {
readActionSearchTextCacheXML(reader); readActionSearchTextCacheXML(reader);
} else if ("SearchHistory".equals(reader.getTagName())) {
readHistorySearch(reader);
} else if ("ReadSet".equals(reader.getTagName())) {
readReadSet(reader);
} }
} }
} }
@ -180,6 +183,47 @@ public class AlphaFineConfigManager implements XMLable {
}); });
} }
private void readHistorySearch(XMLableReader reader) {
reader.readXMLObject(new XMLReadable() {
@Override
public void readXML(XMLableReader xmLableReader) {
if (ComparatorUtils.equals(reader.getTagName(), "history")) {
String tmpVal = reader.getElementValue();
if (tmpVal != null) {
tmpVal = tmpVal.replace("[",StringUtils.EMPTY).replace("]",StringUtils.EMPTY);
Stack<String> stack = new SizedStack<>(3);
List<String> historyList = Arrays.asList(tmpVal.split(","));
for (String history : historyList) {
stack.add(history.trim());
}
historySearchMap.put(reader.getAttrAsString("user", StringUtils.EMPTY), stack);
}
}
}
});
}
private void readReadSet(XMLableReader reader) {
reader.readXMLObject(new XMLReadable() {
@Override
public void readXML(XMLableReader xmLableReader) {
if (ComparatorUtils.equals(reader.getTagName(), "readId")) {
String tmpVal = reader.getElementValue();
if (tmpVal != null) {
tmpVal = tmpVal.replace("[",StringUtils.EMPTY).replace("]",StringUtils.EMPTY);
String[] idArr = tmpVal.split(",");
Set<Long> setId = new HashSet<>();
for (String id : idArr) {
setId.add(Long.parseLong(id.trim()));
}
readSetMap.put(reader.getAttrAsString("user", StringUtils.EMPTY), setId);
}
}
}
});
}
@Override @Override
public void writeXML(XMLPrintWriter writer) { public void writeXML(XMLPrintWriter writer) {
writer.startTAG("AlphaFineConfigManager"); writer.startTAG("AlphaFineConfigManager");
@ -198,6 +242,8 @@ public class AlphaFineConfigManager implements XMLable {
.attr("needIntelligentCustomerService", this.isNeedIntelligentCustomerService()) .attr("needIntelligentCustomerService", this.isNeedIntelligentCustomerService())
.attr("productDynamics", this.isProductDynamics()); .attr("productDynamics", this.isProductDynamics());
writeActionSearchTextCacheXML(writer); writeActionSearchTextCacheXML(writer);
writeSearchHistory(writer);
writeReadSet(writer);
writer.end(); writer.end();
} }
@ -212,6 +258,22 @@ public class AlphaFineConfigManager implements XMLable {
writer.end(); writer.end();
} }
private void writeSearchHistory(XMLPrintWriter writer) {
writer.startTAG("SearchHistory");
for (Map.Entry<String, Stack<String>> entry : historySearchMap.entrySet()) {
writer.startTAG("history").attr("user", entry.getKey()).textNode(entry.getValue().toString()).end();
}
writer.end();
}
private void writeReadSet(XMLPrintWriter writer) {
writer.startTAG("ReadSet");
for (Map.Entry<String, Set<Long>> entry : readSetMap.entrySet()) {
writer.startTAG("readId").attr("user", entry.getKey()).textNode(entry.getValue().toString()).end();
}
writer.end();
}
public boolean isSearchOnLine() { public boolean isSearchOnLine() {
return searchOnLine; return searchOnLine;
} }

4
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -19,6 +19,7 @@ import com.fr.design.data.datapane.management.search.pane.TreeSearchToolbarPane;
import com.fr.design.data.datapane.management.search.searcher.TableDataSearchMode; import com.fr.design.data.datapane.management.search.searcher.TableDataSearchMode;
import com.fr.design.data.datapane.management.search.TableDataTreeSearchManager; import com.fr.design.data.datapane.management.search.TableDataTreeSearchManager;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.StoreProcedureWorkerListener;
import com.fr.design.data.tabledata.paste.TableDataFollowingPasteUtils;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane; import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane;
import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper;
@ -1132,8 +1133,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
// 处理数据集名称 // 处理数据集名称
String dsName = getNoRepeatedDsName4Paste(dataWrapperEntry.getKey()); String dsName = getNoRepeatedDsName4Paste(dataWrapperEntry.getKey());
AbstractTableDataWrapper wrapper = dataWrapperEntry.getValue(); AbstractTableDataWrapper wrapper = dataWrapperEntry.getValue();
AbstractTableDataPane<?> tableDataPane = wrapper.creatTableDataPane(); addDataPane(TableDataFollowingPasteUtils.generateTableDataPaneWhenPaste(wrapper), dsName);
addDataPane(tableDataPane, dsName);
} }
} }
} }

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

@ -3,10 +3,12 @@ package com.fr.design.data.tabledata.paste;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.ProcedureDataPane;
import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
@ -63,8 +65,7 @@ public class TableDataFollowingPasteUtils {
continue; continue;
} }
AbstractTableDataWrapper tableDataWrapper = new TemplateTableDataWrapper(dataWrapperEntry.getValue(), dsName); AbstractTableDataWrapper tableDataWrapper = new TemplateTableDataWrapper(dataWrapperEntry.getValue(), dsName);
AbstractTableDataPane<?> tableDataPane = tableDataWrapper.creatTableDataPane(); tableDataTreePane.addDataPane(generateTableDataPaneWhenPaste(tableDataWrapper), dsName);
tableDataTreePane.addDataPane(tableDataPane, dsName);
} }
} }
@ -337,4 +338,19 @@ public class TableDataFollowingPasteUtils {
return templeteDataSet; return templeteDataSet;
} }
/**
* 生成粘贴新建时使用的AbstractTableDataPane
* 主要是为了处理StoreProcedure它在远程情况下无法及时获取参数这边因为是复制粘贴所以直接用原TableData的参数即可
* @param tableDataWrapper wrapper
* @return AbstractTableDataPane
*/
public static AbstractTableDataPane<?> generateTableDataPaneWhenPaste(AbstractTableDataWrapper tableDataWrapper) {
AbstractTableDataPane<?> tableDataPane = tableDataWrapper.creatTableDataPane();
TableData tableData = tableDataWrapper.getTableData();
if (tableData instanceof StoreProcedure) {
StoreProcedure storeProcedure = (StoreProcedure) tableData;
((ProcedureDataPane) tableDataPane).populateParameters(storeProcedure.getParameters());
}
return tableDataPane;
}
} }

8
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -225,6 +225,14 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
} }
/**
* 手动更新参数用于上面populateBean方法中SwingWorker查询来不及的情况
* @param procedureParameters
*/
public void populateParameters(StoreProcedureParameter[] procedureParameters) {
this.editorPane.populate(procedureParameters);
}
/** /**
* 增加存储过程监听器 * 增加存储过程监听器
* *

2
designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java

@ -89,7 +89,7 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
} }
// 首次添加超链接,将文字样式默认改为蓝色下划线 // 首次添加超链接,将文字样式默认改为蓝色下划线
if (editCellElement.getNameHyperlinkGroup() == null && hyperlinkGroupPane.getCurrentEvent() != null && hyperlinkGroupPane.getCurrentEvent().getType() == ListDataEvent.INTERVAL_ADDED) { if ((editCellElement.getNameHyperlinkGroup() == null || editCellElement.getNameHyperlinkGroup().size() == 0) && hyperlinkGroupPane.getCurrentEvent() != null && hyperlinkGroupPane.getCurrentEvent().getType() == ListDataEvent.INTERVAL_ADDED) {
editCellElement.setStyle(elementStyle.deriveFRFont(frFont)); editCellElement.setStyle(elementStyle.deriveFRFont(frFont));
} }

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

@ -77,6 +77,18 @@ import javax.swing.Timer;
public class AlphaFineFrame extends JFrame { public class AlphaFineFrame extends JFrame {
private static final String ADVANCED_SEARCH_MARK = "k:"; private static final String ADVANCED_SEARCH_MARK = "k:";
private static final String ACTION_MARK_SHORT = "k:1 ";
private static final String ACTION_MARK = "k:setting ";
private static final String DOCUMENT_MARK_SHORT = "k:2 ";
private static final String DOCUMENT_MARK = "k:help ";
private static final String FILE_MARK_SHORT = "k:3 ";
private static final String FILE_MARK = "k:reportlets ";
private static final String CPT_MARK = "k:cpt ";
private static final String FRM_MARK = "k:frm ";
private static final String DS_MARK = "k:ds ";
private static final String DS_NAME = "dsname=\"";
private static final String PLUGIN_MARK_SHORT = "k:4 ";
private static final String PLUGIN_MARK = "k:shop ";
private static final int TIMER_DELAY = 300; private static final int TIMER_DELAY = 300;
@ -282,6 +294,7 @@ public class AlphaFineFrame extends JFrame {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
searchTextField.setText(StringUtils.EMPTY); searchTextField.setText(StringUtils.EMPTY);
beforeSearchStr = StringUtils.EMPTY;
clearLabel.setVisible(false); clearLabel.setVisible(false);
} }
}); });
@ -543,6 +556,8 @@ public class AlphaFineFrame extends JFrame {
if (StringUtils.isNotEmpty(searchTextField.getText())) { if (StringUtils.isNotEmpty(searchTextField.getText())) {
clearLabel.setVisible(true); clearLabel.setVisible(true);
SearchTooltipPopup.getInstance().show(searchTextFieldWrapperPane); SearchTooltipPopup.getInstance().show(searchTextFieldWrapperPane);
} else {
beforeSearchStr = StringUtils.EMPTY;
} }
AlphaFineToolTipList alphaFineToolTipList = SearchTooltipPopup.getInstance().getAlphaFineToolTipList(); AlphaFineToolTipList alphaFineToolTipList = SearchTooltipPopup.getInstance().getAlphaFineToolTipList();
if (e.getKeyCode() == KeyEvent.VK_ENTER) { if (e.getKeyCode() == KeyEvent.VK_ENTER) {
@ -590,6 +605,7 @@ public class AlphaFineFrame extends JFrame {
SearchTooltipPopup.getInstance().hide(); SearchTooltipPopup.getInstance().hide();
clearLabel.setVisible(false); clearLabel.setVisible(false);
switchType(selectedType); switchType(selectedType);
beforeSearchStr = StringUtils.EMPTY;
} else if (searchTextField.hasFocus()) { } else if (searchTextField.hasFocus()) {
clearLabel.setVisible(true); clearLabel.setVisible(true);
SearchTooltipPopup.getInstance().show(searchTextFieldWrapperPane); SearchTooltipPopup.getInstance().show(searchTextFieldWrapperPane);
@ -659,7 +675,7 @@ public class AlphaFineFrame extends JFrame {
private void doSearch(String text) { private void doSearch(String text) {
initSearchLoadingPane(); initSearchLoadingPane();
SearchTextBean searchTextBean = new SearchTextBean(text, segmentationResult); SearchTextBean searchTextBean = generateSearchTextBean(text);
this.productNewsSearchWorkerManager.doSearch(searchTextBean); this.productNewsSearchWorkerManager.doSearch(searchTextBean);
this.settingSearchWorkerManager.doSearch(searchTextBean); this.settingSearchWorkerManager.doSearch(searchTextBean);
this.fileSearchWorkerManager.doSearch(searchTextBean); this.fileSearchWorkerManager.doSearch(searchTextBean);
@ -667,6 +683,21 @@ public class AlphaFineFrame extends JFrame {
this.pluginSearchWorkerManager.doSearch(searchTextBean); this.pluginSearchWorkerManager.doSearch(searchTextBean);
} }
private SearchTextBean generateSearchTextBean(String searchText) {
if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)
|| searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) {
return new SearchTextBean(StringUtils.EMPTY, new String[]{getStoreText(searchText)});
} else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)
|| searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)
|| searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) {
return new SearchTextBean(getStoreText(searchText), new String[]{getStoreText(searchText)});
} else if (searchText.startsWith(DS_MARK)) {
return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)});
} else {
return new SearchTextBean(searchText, segmentationResult);
}
}
/** /**
* 仅搜索依赖网络的搜索项 * 仅搜索依赖网络的搜索项
* *

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

@ -3,6 +3,7 @@ package com.fr.design.mainframe.alphafine.component;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.DocumentModel;
import com.fr.design.mainframe.alphafine.preview.ResultShowPane; import com.fr.design.mainframe.alphafine.preview.ResultShowPane;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -26,7 +27,10 @@ public class AlphaFineList extends JList<AlphaCellModel> {
AlphaCellModel selectedValue = getSelectedValue(); AlphaCellModel selectedValue = getSelectedValue();
if (e.getClickCount() == AlphaFineConstants.DEFAULT_CLICK_COUNT && selectedValue.hasAction()) { if (e.getClickCount() == AlphaFineConstants.DEFAULT_CLICK_COUNT && selectedValue.hasAction()) {
// 点击搜索结果 主页面移动到后面 // 点击搜索结果 主页面移动到后面
AlphaFineHelper.getAlphaFineDialog().toBack(); if (!(selectedValue instanceof DocumentModel)) {
// 帮助文档不跳转
AlphaFineHelper.getAlphaFineDialog().toBack();
}
dealWithSearchResult(); dealWithSearchResult();
} }
} }

3
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

@ -11,6 +11,7 @@ import com.fr.design.mainframe.alphafine.search.SearchTextBean;
import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider;
import com.fr.general.http.HttpToolbox; import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -82,6 +83,8 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
} }
} }
} }
} catch (JSONException jsonException) {
FineLoggerFactory.getLogger().warn(jsonException, jsonException.getMessage());
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error("document search error: " + e.getMessage()); FineLoggerFactory.getLogger().error("document search error: " + e.getMessage());
} }

Loading…
Cancel
Save