|
|
@@ -21,8 +21,10 @@ import com.usoftchina.bi.server.model.vo.configVo.ChangeOrderInfo;
|
|
|
import com.usoftchina.bi.server.model.vo.configVo.DashboardsInfo;
|
|
|
import com.usoftchina.bi.server.model.vo.dataVo.DashboardCopyInfo;
|
|
|
import com.usoftchina.bi.server.model.vo.dataVo.DashboardOrderInfo;
|
|
|
+import com.usoftchina.bi.server.model.vo.dataVo.DataSourceCopyInfo;
|
|
|
import com.usoftchina.bi.server.service.chart.ChartsUtilService;
|
|
|
import com.usoftchina.bi.core.utils.GetTokenDataUtil;
|
|
|
+import com.usoftchina.bi.server.service.dataSource.DataConnectorService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -43,6 +45,8 @@ public class DashboardsService {
|
|
|
@Autowired
|
|
|
ChartsUtilService chartsUtilService;
|
|
|
@Autowired
|
|
|
+ private DataConnectorService dataConnectorService;
|
|
|
+ @Autowired
|
|
|
private ChartsConfigMapper chartsConfigMapper;
|
|
|
|
|
|
/*
|
|
|
@@ -304,7 +308,7 @@ public class DashboardsService {
|
|
|
int userId = Integer.parseInt(resultMap.get("id"));
|
|
|
String userName = resultMap.get("name");
|
|
|
int dashboardId = dashboardCopyInfo.getDashboardId(),
|
|
|
- dataSourceId = dashboardCopyInfo.getDataSourceId();
|
|
|
+ dataSourceId = dashboardCopyInfo.getDataSourceId();
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
Map<String, String> idMap = new HashMap<>();
|
|
|
//复制图表
|
|
|
@@ -317,7 +321,8 @@ public class DashboardsService {
|
|
|
chartConfig.setChartName(chartConfig.getChartName() + "_副本");
|
|
|
chartConfig.setCreateBy(userName);
|
|
|
chartConfig.setCreateId(userId);
|
|
|
- chartConfig.setDataId(dataSourceId);
|
|
|
+ int dataId = dataConnectorService.copyDataSource(token, new DataSourceCopyInfo(chartConfig.getDataId(), dataSourceId)).getData();
|
|
|
+ chartConfig.setDataId(dataId);
|
|
|
chartsConfigMapper.insertCharts(chartConfig);
|
|
|
int newChartId = chartConfig.getChartId();
|
|
|
idMap.put(String.valueOf(oldChartId), String.valueOf(newChartId));
|