Browse Source

Pull request #15510: REPORT-141247 & REPORT-141671 & REPORT-141350

Merge in DESIGN/design from ~DESTINY.LIN/design:final/11.0 to final/11.0

* commit 'd7bcb3e6391ba1a3c860f8842e15f0cc1e53c5fa':
  REPORT-141350 【FVS数据集替换】表格-单元格-条件属性-条件是数据列,无法识别,看下这里要不要支持
  REPORT-141671 【数据集替换】组合图的数据集替换后,数据列没有替换成功
  REPORT-141247 【FVS数据集替换】公式ds1.select、group、find字段名不会被替换
final/11.0
Destiny.Lin-林锦龙 13 hours ago
parent
commit
db227b6550
  1. 6
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/tabledata/TableDataFormulaUtils.java
  2. 38
      designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceUtils.java
  3. 19
      designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java

6
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/tabledata/TableDataFormulaUtils.java

@ -151,8 +151,10 @@ public class TableDataFormulaUtils {
if (StringUtils.equals(parent.toString(), entity.getOldName())) {
// 如果是要替换的数据集
String field = entity.getTargetField(name);
// 替换成匹配后的字段
Reflect.on(ambiguity).set(STATEMENT, field);
if (StringUtils.isNotEmpty(field)) {
// 替换成匹配后的字段
Reflect.on(ambiguity).set(STATEMENT, field);
}
break;
}
}

38
designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceUtils.java

@ -10,6 +10,7 @@ import com.fr.data.TableReplacementEntity;
import com.fr.data.condition.CommonCondition;
import com.fr.data.condition.JoinCondition;
import com.fr.data.condition.ListCondition;
import com.fr.data.condition.ObjectCondition;
import com.fr.data.core.Compare;
import com.fr.data.impl.NameTableData;
import com.fr.data.impl.TableDataDictionary;
@ -338,6 +339,7 @@ public class ReplaceUtils {
private static void replaceHighlight(Highlight highlight, List<TableReplacementEntity> entities) {
if (highlight instanceof DefaultHighlight) {
DefaultHighlight defaultHighlight = (DefaultHighlight) highlight;
replaceCondition(defaultHighlight.getCondition(), entities);
for (int i = 0 ; i < defaultHighlight.actionCount() ; i++) {
if (defaultHighlight.getHighlightAction(i) instanceof PresentHighlightAction) {
PresentHighlightAction action = (PresentHighlightAction) defaultHighlight.getHighlightAction(i);
@ -497,35 +499,45 @@ public class ReplaceUtils {
//公式条件不需要修改,里面不会涉及到,有问题再加
//普通条件
//1条条件
if (condition instanceof CommonCondition) {
dealWithTableDataNameChange((CommonCondition) condition, entity);
}
replaceSingleCondition(condition, entity);
//N条条件
if (condition instanceof ListCondition) {
for (int k = 0; k < ((ListCondition) condition).getJoinConditionCount(); k++) {
JoinCondition joinCondition = ((ListCondition) condition).getJoinCondition(k);
Condition obCondition = joinCondition.getCondition();
if (obCondition != null) {
if (obCondition instanceof CommonCondition) {
dealWithTableDataNameChange((CommonCondition) obCondition, entity);
}
replaceSingleCondition(obCondition, entity);
}
}
}
}
}
private static void replaceSingleCondition(Condition condition, List<TableReplacementEntity> entity) {
if (condition instanceof CommonCondition) {
dealWithTableDataNameChange((CommonCondition) condition, entity);
}
if (condition instanceof ObjectCondition) {
dealWithCompare(((ObjectCondition) condition).getCompare(), entity);
}
}
private static void dealWithTableDataNameChange(CommonCondition condition, List<TableReplacementEntity> entities) {
Compare compare = condition.getCompare();
Object ob = compare.getValue();
if (ob instanceof SimpleDSColumn) {
for (TableReplacementEntity entity : entities) {
if (ComparatorUtils.equals(((SimpleDSColumn) ob).getDsName(), entity.getOldName())) {
((SimpleDSColumn) ob).setDsName(entity.getNewName());
((SimpleDSColumn) ob).setColumn(TableDataColumn.createColumn(entity.getTargetField(TableDataColumn.getColumnName(((SimpleDSColumn) ob).getColumn()))));
dealWithCompare(compare, entities);
}
private static void dealWithCompare(Compare compare, List<TableReplacementEntity> entities) {
if (compare != null) {
Object ob = compare.getValue();
if (ob instanceof SimpleDSColumn) {
for (TableReplacementEntity entity : entities) {
if (ComparatorUtils.equals(((SimpleDSColumn) ob).getDsName(), entity.getOldName())) {
((SimpleDSColumn) ob).setDsName(entity.getNewName());
((SimpleDSColumn) ob).setColumn(TableDataColumn.createColumn(entity.getTargetField(TableDataColumn.getColumnName(((SimpleDSColumn) ob).getColumn()))));
}
}
}
}
}

19
designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java

@ -387,11 +387,14 @@ public class SearchJSUtils {
if (chartCollection.getChart(i) instanceof VanChart) {
VanChart chart = ((VanChart) chartCollection.getChart(i));
if (chart.getPlot() != null) {
NameJavaScriptGroup nameJavaScriptGroup = chart.getPlot().getHotHyperLink();
if (isNameJavaScriptGroupExist(nameJavaScriptGroup)) {
for (int j = 0; j < nameJavaScriptGroup.size(); j++) {
nameJavaScriptArrayList.add(nameJavaScriptGroup.getNameHyperlink(j));
if (chart.getPlot() instanceof VanChartCustomPlot) {
VanChartCustomPlot plot = chart.getPlot();
for (Plot customPlot : plot.getCustomPlotList()) {
getChartJavaScriptFromGroup(customPlot.getHotHyperLink(), nameJavaScriptArrayList);
}
} else {
NameJavaScriptGroup nameJavaScriptGroup = chart.getPlot().getHotHyperLink();
getChartJavaScriptFromGroup(nameJavaScriptGroup, nameJavaScriptArrayList);
}
}
}
@ -399,6 +402,14 @@ public class SearchJSUtils {
return nameJavaScriptArrayList;
}
private static void getChartJavaScriptFromGroup(NameJavaScriptGroup nameJavaScriptGroup, ArrayList<NameJavaScript> nameJavaScriptArrayList) {
if (isNameJavaScriptGroupExist(nameJavaScriptGroup)) {
for (int j = 0; j < nameJavaScriptGroup.size(); j++) {
nameJavaScriptArrayList.add(nameJavaScriptGroup.getNameHyperlink(j));
}
}
}
/**
* 处理图表的交互属性可能存在多种地图
* @param content 存储信息的数据结构

Loading…
Cancel
Save