Browse Source

无任务编号 fix:修正Demo类路径

pull/1/head
Roc 4 weeks ago
parent
commit
feebd17d1e
  1. 3
      plugin.xml
  2. 9
      src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java

3
plugin.xml

@ -3,13 +3,14 @@
<id>com.finebi.plugin.custom.chart.demo.v6</id> <id>com.finebi.plugin.custom.chart.demo.v6</id>
<name><![CDATA[自定义图表demo]]></name> <name><![CDATA[自定义图表demo]]></name>
<active>yes</active> <active>yes</active>
<version>1.6.0</version> <version>1.6.1</version>
<env-version>11.0~11.0</env-version> <env-version>11.0~11.0</env-version>
<bi-env-version>6.0~</bi-env-version> <bi-env-version>6.0~</bi-env-version>
<jartime>2023-05-16</jartime> <jartime>2023-05-16</jartime>
<vendor>fanruan</vendor> <vendor>fanruan</vendor>
<description><![CDATA[自定义图表demo]]></description> <description><![CDATA[自定义图表demo]]></description>
<change-notes><![CDATA[ <change-notes><![CDATA[
[2025-12-11] 修改类路径问题
[2023-06-01] demo [2023-06-01] demo
]]></change-notes> ]]></change-notes>

9
src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java

@ -3,7 +3,8 @@ package com.finebi.plugin.custom.component;
import com.finebi.common.context.OperationContext; import com.finebi.common.context.OperationContext;
import com.finebi.provider.api.component.AbstractCustomComponentProvider; import com.finebi.provider.api.component.AbstractCustomComponentProvider;
import com.finebi.provider.api.component.CustomComponentContext; import com.finebi.provider.api.component.CustomComponentContext;
import com.finebi.provider.api.component.DataModel; import com.finebi.provider.api.component.data.DataModel;
import com.finebi.provider.api.component.data.Dimension;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.plugin.transform.ExecuteFunctionRecord; import com.fr.plugin.transform.ExecuteFunctionRecord;
import com.fr.plugin.transform.FunctionRecorder; import com.fr.plugin.transform.FunctionRecorder;
@ -111,19 +112,19 @@ public class DemoComponentProvider extends AbstractCustomComponentProvider {
*/ */
@Override @Override
public List<DataModel> process(List<DataModel> dataModels, CustomComponentContext customComponentContext) { public List<DataModel> process(List<DataModel> dataModels, CustomComponentContext customComponentContext) {
return dataModels.stream().map(dataModel -> new DataModel() { return dataModels.stream().map(dataModel -> new DataModel() {
@Override @Override
public List<String> getFields() { public List<Dimension> getFields() {
return dataModel.getFields(); return dataModel.getFields();
} }
@Override @Override
public List<List<Object>> getColData() { public List<List<Object>> getColData() {
List<List<Object>> colData = new ArrayList<>(dataModel.getFields().size()); List<List<Object>> colData = new ArrayList<>(dataModel.getFields().size());
dataModel.getColData().forEach(d -> colData.add(Collections.singletonList(d.get(0)))); dataModel.getColData().forEach(d -> colData.add(Collections.singletonList(d.get((int) (Math.random() * d.size())))));
return colData; return colData;
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
} }

Loading…
Cancel
Save