|
|
@@ -38,6 +38,9 @@ public class DashboardsToChartsUtilService {
|
|
|
public RepEntity getChartsInDash(ChartsToDashInfo chartsToDashInfo, String token) throws SQLException {
|
|
|
int chartId = chartsToDashInfo.getDashCreateId();
|
|
|
ChartsConfigToDash chartsConfigToDash = chartsConfigMapper.getChartConfigToDash(chartId);
|
|
|
+ if (chartsConfigToDash == null || "".equals(chartsConfigToDash)){
|
|
|
+ return new RepEntity(RepCode.Null);
|
|
|
+ }
|
|
|
String chartType = chartsConfigToDash.getChartType();
|
|
|
String fetchConfig = chartsConfigToDash.getFetchConfig();
|
|
|
List<Screen> filters = chartsToDashInfo.getFilters();
|
|
|
@@ -66,9 +69,7 @@ public class DashboardsToChartsUtilService {
|
|
|
HistogramConfigInfo histogramConfigInfo = new HistogramConfigInfo();
|
|
|
try {
|
|
|
histogramConfigInfo = objectMapper.readValue(fetchConfig,HistogramConfigInfo.class);
|
|
|
- List<Screen> list = histogramConfigInfo.getFilters();
|
|
|
- list.addAll(filters);
|
|
|
- histogramConfigInfo.setFilters(list);
|
|
|
+ histogramConfigInfo.setFilters(filters);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -80,9 +81,7 @@ public class DashboardsToChartsUtilService {
|
|
|
try {
|
|
|
System.out.println(fetchConfig);
|
|
|
scatterConfigInfo = objectMapper.readValue(fetchConfig,ScatterConfigInfo.class);
|
|
|
- List<Screen> list = scatterConfigInfo.getFilters();
|
|
|
- list.addAll(filters);
|
|
|
- scatterConfigInfo.setFilters(list);
|
|
|
+ scatterConfigInfo.setFilters(filters);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -94,9 +93,7 @@ public class DashboardsToChartsUtilService {
|
|
|
try {
|
|
|
System.out.println(fetchConfig);
|
|
|
lineConfigInfo = objectMapper.readValue(fetchConfig,LineConfigInfo.class);
|
|
|
- List<Screen> list = lineConfigInfo.getFilters();
|
|
|
- list.addAll(filters);
|
|
|
- lineConfigInfo.setFilters(list);
|
|
|
+ lineConfigInfo.setFilters(filters);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -108,9 +105,7 @@ public class DashboardsToChartsUtilService {
|
|
|
try {
|
|
|
System.out.println(fetchConfig);
|
|
|
populationInfo = objectMapper.readValue(fetchConfig,PopulationInfo.class);
|
|
|
- List<Screen> list = populationInfo.getFilters();
|
|
|
- list.addAll(filters);
|
|
|
- populationInfo.setFilters(list);
|
|
|
+ populationInfo.setFilters(filters);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -122,9 +117,7 @@ public class DashboardsToChartsUtilService {
|
|
|
try {
|
|
|
System.out.println(fetchConfig);
|
|
|
individualConfigInfo = objectMapper.readValue(fetchConfig,IndividualConfigInfo.class);
|
|
|
- List<Screen> list = individualConfigInfo.getFilters();
|
|
|
- list.addAll(filters);
|
|
|
- individualConfigInfo.setFilters(list);
|
|
|
+ individualConfigInfo.setFilters(filters);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -136,9 +129,7 @@ public class DashboardsToChartsUtilService {
|
|
|
try {
|
|
|
System.out.println(fetchConfig);
|
|
|
pieConfigInfo = objectMapper.readValue(fetchConfig,PieConfigInfo.class);
|
|
|
- List<Screen> list = pieConfigInfo.getFilters();
|
|
|
- list.addAll(filters);
|
|
|
- pieConfigInfo.setFilters(list);
|
|
|
+ pieConfigInfo.setFilters(filters);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|