|
|
@@ -46,6 +46,8 @@ public class DashboardsToChartsUtilService {
|
|
|
@Autowired
|
|
|
ShowScatterService showScatterService;
|
|
|
@Autowired
|
|
|
+ ShowIndicatorService showIndicatorService;
|
|
|
+ @Autowired
|
|
|
private UserService userService;
|
|
|
|
|
|
public RepEntity getChartsInDash(ChartsToDashInfo chartsToDashInfo, String token) throws SQLException {
|
|
|
@@ -82,16 +84,18 @@ public class DashboardsToChartsUtilService {
|
|
|
}else if ("population".equals(chartType)){
|
|
|
return getPopulation(fetchConfig, token, filters, chartId, styleConfig);
|
|
|
|
|
|
- }else if ("individual".equals(chartType) || "indicator".equalsIgnoreCase(chartType)){
|
|
|
+ }else if ("individual".equals(chartType)){
|
|
|
return getIndividual(fetchConfig, token, filters, chartsToDashInfo.getTestPage(), chartId, styleConfig);
|
|
|
|
|
|
}else if("scatter".equals(chartType)){
|
|
|
return getScatter(fetchConfig, token, filters, chartId, styleConfig);
|
|
|
+ }else if ("indicator".equalsIgnoreCase(chartType)) {
|
|
|
+ return getIndicator(fetchConfig, token, filters);
|
|
|
}
|
|
|
return new RepEntity(RepCode.success);
|
|
|
}
|
|
|
|
|
|
- public RepEntity getHistogram(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig){
|
|
|
+ private RepEntity getHistogram(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig){
|
|
|
HistogramConfigInfo histogramConfigInfo = new HistogramConfigInfo();
|
|
|
try {
|
|
|
histogramConfigInfo = objectMapper.readValue(fetchConfig,HistogramConfigInfo.class);
|
|
|
@@ -102,7 +106,7 @@ public class DashboardsToChartsUtilService {
|
|
|
return showHistogramService.showHistogram(histogramConfigInfo, token, chartId);
|
|
|
}
|
|
|
|
|
|
- public RepEntity getScatter(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig){
|
|
|
+ private RepEntity getScatter(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig){
|
|
|
ScatterConfigInfo scatterConfigInfo = new ScatterConfigInfo();
|
|
|
try {
|
|
|
scatterConfigInfo = objectMapper.readValue(fetchConfig,ScatterConfigInfo.class);
|
|
|
@@ -113,7 +117,7 @@ public class DashboardsToChartsUtilService {
|
|
|
return showScatterService.showScatter(scatterConfigInfo, token, chartId, styleConfig);
|
|
|
}
|
|
|
|
|
|
- public RepEntity getLine(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig){
|
|
|
+ private RepEntity getLine(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig){
|
|
|
LineConfigInfo lineConfigInfo = new LineConfigInfo();
|
|
|
try {
|
|
|
lineConfigInfo = objectMapper.readValue(fetchConfig,LineConfigInfo.class);
|
|
|
@@ -124,7 +128,7 @@ public class DashboardsToChartsUtilService {
|
|
|
return showLineService.showLine(lineConfigInfo, token, chartId, styleConfig);
|
|
|
}
|
|
|
|
|
|
- public RepEntity getPopulation(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig) throws SQLException {
|
|
|
+ private RepEntity getPopulation(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig) throws SQLException {
|
|
|
PopulationInfo populationInfo = new PopulationInfo();
|
|
|
try {
|
|
|
populationInfo = objectMapper.readValue(fetchConfig,PopulationInfo.class);
|
|
|
@@ -137,7 +141,7 @@ public class DashboardsToChartsUtilService {
|
|
|
return repEntity;
|
|
|
}
|
|
|
|
|
|
- public RepEntity getIndividual(String fetchConfig, String token, List<Screen> filters, TestPage testPage, int chartId, String styleConfig) throws SQLException {
|
|
|
+ private RepEntity getIndividual(String fetchConfig, String token, List<Screen> filters, TestPage testPage, int chartId, String styleConfig) throws SQLException {
|
|
|
IndividualConfigInfo individualConfigInfo = new IndividualConfigInfo();
|
|
|
try {
|
|
|
individualConfigInfo = objectMapper.readValue(fetchConfig,IndividualConfigInfo.class);
|
|
|
@@ -151,7 +155,7 @@ public class DashboardsToChartsUtilService {
|
|
|
return repEntity;
|
|
|
}
|
|
|
|
|
|
- public RepEntity getPie(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig){
|
|
|
+ private RepEntity getPie(String fetchConfig, String token, List<Screen> filters, int chartId, String styleConfig){
|
|
|
PieConfigInfo pieConfigInfo = new PieConfigInfo();
|
|
|
try {
|
|
|
pieConfigInfo = objectMapper.readValue(fetchConfig,PieConfigInfo.class);
|
|
|
@@ -162,4 +166,15 @@ public class DashboardsToChartsUtilService {
|
|
|
return showPieService.showPie(pieConfigInfo, token, chartId, styleConfig);
|
|
|
}
|
|
|
|
|
|
+ private RepEntity getIndicator(String fetchConfig, String token, List<Screen> filters){
|
|
|
+ IndicatorConfigInfo indicatorConfigInfo = new IndicatorConfigInfo();
|
|
|
+ try {
|
|
|
+ indicatorConfigInfo = objectMapper.readValue(fetchConfig,IndicatorConfigInfo.class);
|
|
|
+ indicatorConfigInfo.setFilters(filters);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return showIndicatorService.showIndicator(indicatorConfigInfo, token);
|
|
|
+ }
|
|
|
+
|
|
|
}
|