Browse Source

Merge pull request #1565 in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit 'fd15016024ee9bf2a25b5b35946e97458d5f98c7':
  CHART-12791 去掉埋点中的类型判断
feature/big-screen
Bjorn 5 years ago
parent
commit
a7d6318735
  1. 35
      designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java

35
designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java

@ -7,7 +7,6 @@ import com.fr.design.mainframe.template.info.TemplateInfo;
import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -57,36 +56,29 @@ public class ChartInfoCollector extends AbstractPointCollector<ChartInfo> {
} }
public void collection(ChartProvider chartProvider, String createTime, boolean isReuse) { public void collection(ChartProvider chartProvider, String createTime, boolean isReuse) {
if (chartProvider instanceof VanChart) { collection(chartProvider.getChartUuid(), chartProvider.getID(), createTime, isReuse);
VanChart vanChart = (VanChart) chartProvider;
collection(vanChart.getUuid(), vanChart.getID(), createTime, isReuse);
}
} }
/** /**
* 新建图表保存状态 * 新建图表保存状态
*/ */
public void collection(String chartId, String chartType, String createTime, boolean isReuse) { public void collection(String chartId, String chartType, String createTime, boolean isReuse) {
if (!shouldCollectInfo()) { if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) {
return; return;
} }
ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType, createTime, true, isReuse); ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType, createTime, true, isReuse);
chartInfoCacheMap.put(chartId, chartInfo); chartInfoCacheMap.put(chartId, chartInfo);
} }
public void updateChartPropertyTime(ChartProvider chartProvider) { public void updateChartPropertyTime(ChartProvider chartProvider) {
if (chartProvider instanceof VanChart) { updateChartPropertyTime(chartProvider.getChartUuid(), chartProvider.getID());
VanChart vanChart = (VanChart) chartProvider;
updateChartPropertyTime(vanChart.getUuid(), vanChart.getID());
}
} }
/** /**
* 图表编辑更新编辑时间 * 图表编辑更新编辑时间
*/ */
public void updateChartPropertyTime(String chartId, String chartType) { public void updateChartPropertyTime(String chartId, String chartType) {
if (!shouldCollectInfo()) { if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) {
return; return;
} }
ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType, null); ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType, null);
@ -99,17 +91,14 @@ public class ChartInfoCollector extends AbstractPointCollector<ChartInfo> {
} }
public void updateChartTypeTime(ChartProvider chartProvider, String oldType) { public void updateChartTypeTime(ChartProvider chartProvider, String oldType) {
if (chartProvider instanceof VanChart) { updateChartTypeTime(chartProvider.getChartUuid(), chartProvider.getID(), oldType);
VanChart vanChart = (VanChart) chartProvider;
updateChartTypeTime(vanChart.getUuid(), vanChart.getID(), oldType);
}
} }
/** /**
* 图表类型变化更新类型和类型确认时间 * 图表类型变化更新类型和类型确认时间
*/ */
public void updateChartTypeTime(String chartId, String chartType, String oldType) { public void updateChartTypeTime(String chartId, String chartType, String oldType) {
if (!shouldCollectInfo()) { if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) {
return; return;
} }
@ -143,19 +132,15 @@ public class ChartInfoCollector extends AbstractPointCollector<ChartInfo> {
} }
public void checkTestChart(ChartProvider chartProvider) { public void checkTestChart(ChartProvider chartProvider) {
if (chartProvider instanceof VanChart) {
checkTestChart((VanChart) chartProvider);
}
}
public void checkTestChart(VanChart vanChart) {
if (!shouldCollectInfo()) { if (!shouldCollectInfo()) {
return; return;
} }
boolean testChart = vanChart.isTestChart(); ChartInfo chartInfo = chartInfoCacheMap.get(chartProvider.getChartUuid());
ChartInfo chartInfo = chartInfoCacheMap.get(vanChart.getUuid()); if (chartInfo != null) {
boolean testChart = chartProvider.isTestChart();
chartInfo.setTestChart(testChart); chartInfo.setTestChart(testChart);
} }
}
/** /**
* 保存模板的时候将该模板中的图表埋点信息保存 * 保存模板的时候将该模板中的图表埋点信息保存

Loading…
Cancel
Save