|
|
@@ -7,6 +7,7 @@ import com.model.po.ChartConfig;
|
|
|
import com.model.pojo.RepCode;
|
|
|
import com.model.pojo.RepEntity;
|
|
|
import com.model.vo.configVo.ChartConfigInfo;
|
|
|
+import com.model.vo.configVo.GroupInfo;
|
|
|
import com.util.TimeUtil;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -23,18 +24,6 @@ public class ChartsConfigService {
|
|
|
ChartsConfigMapper chartsConfigMapper;
|
|
|
@Autowired
|
|
|
ObjectMapper objectmapper;
|
|
|
-// @Autowired
|
|
|
-// private AggregateMapper aggregateMapper;
|
|
|
-// @Autowired
|
|
|
-// private DataViewMapper dataViewMapper;
|
|
|
-// @Autowired
|
|
|
-// private LineMapper lineMapper;
|
|
|
-// @Autowired
|
|
|
-// private ScatterMapper scatterMapper;
|
|
|
-// @Autowired
|
|
|
-// private HistogramMapper histogramMapper;
|
|
|
-// @Autowired
|
|
|
-// private PieMapper pieMapper;
|
|
|
|
|
|
/*
|
|
|
保存基本设置
|
|
|
@@ -72,7 +61,7 @@ public class ChartsConfigService {
|
|
|
|
|
|
String groupBy = null;
|
|
|
// String subsections = null;
|
|
|
- String chartsConfig = null;
|
|
|
+// String chartsConfig = null;
|
|
|
String accessAuthority = null;
|
|
|
String updateAuthority = null;
|
|
|
String filters = null;
|
|
|
@@ -96,11 +85,11 @@ public class ChartsConfigService {
|
|
|
// e.printStackTrace();
|
|
|
// }
|
|
|
|
|
|
- try {
|
|
|
- chartsConfig = objectmapper.writeValueAsString(chartConfigInfo.getChartConfig());
|
|
|
- } catch (JsonProcessingException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+// try {
|
|
|
+// chartsConfig = objectmapper.writeValueAsString(chartConfigInfo.getChartConfig());
|
|
|
+// } catch (JsonProcessingException e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
|
|
|
try {
|
|
|
accessAuthority = objectmapper.writeValueAsString(chartConfigInfo.getAccessAuthority());
|
|
|
@@ -122,7 +111,7 @@ public class ChartsConfigService {
|
|
|
|
|
|
chartConfig.setGroupBy(groupBy);
|
|
|
// chartConfig.setSubsections(subsections);
|
|
|
- chartConfig.setChartConfig(chartsConfig);
|
|
|
+// chartConfig.setChartConfig(chartsConfig);
|
|
|
chartConfig.setAccessAuthority(accessAuthority);
|
|
|
chartConfig.setUpdateAuthority(updateAuthority);
|
|
|
chartConfig.setFilters(filters);
|
|
|
@@ -131,9 +120,8 @@ public class ChartsConfigService {
|
|
|
|
|
|
chartsConfigMapper.insertCharts(chartConfig);
|
|
|
int id = chartConfig.getChartId();
|
|
|
- System.out.println(id);
|
|
|
|
|
|
- return new RepEntity(RepCode.success);
|
|
|
+ return new RepEntity(RepCode.success,id);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
@@ -147,7 +135,7 @@ public class ChartsConfigService {
|
|
|
|
|
|
String groupBy = null;
|
|
|
// String subsections = null;
|
|
|
- String chartsConfig = null;
|
|
|
+// String chartsConfig = null;
|
|
|
String accessAuthority = null;
|
|
|
String updateAuthority = null;
|
|
|
String filters = null;
|
|
|
@@ -171,11 +159,6 @@ public class ChartsConfigService {
|
|
|
// e.printStackTrace();
|
|
|
// }
|
|
|
|
|
|
- try {
|
|
|
- chartsConfig = objectmapper.writeValueAsString(chartConfigInfo.getChartConfig());
|
|
|
- } catch (JsonProcessingException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
|
|
|
try {
|
|
|
accessAuthority = objectmapper.writeValueAsString(chartConfigInfo.getAccessAuthority());
|
|
|
@@ -197,7 +180,8 @@ public class ChartsConfigService {
|
|
|
|
|
|
chartConfig.setGroupBy(groupBy);
|
|
|
// chartConfig.setSubsections(subsections);
|
|
|
- chartConfig.setChartConfig(chartsConfig);
|
|
|
+// chartConfig.setChartConfig(chartsConfig);
|
|
|
+ chartConfig.setAccessAuthority(accessAuthority);
|
|
|
chartConfig.setAccessAuthority(accessAuthority);
|
|
|
chartConfig.setUpdateAuthority(updateAuthority);
|
|
|
chartConfig.setFilters(filters);
|
|
|
@@ -236,90 +220,38 @@ public class ChartsConfigService {
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- 删除总体表
|
|
|
+ 创建图表分组
|
|
|
*/
|
|
|
-// public RepEntity delAggregate(int id){
|
|
|
-// if (aggregateMapper.getOneAggregate(id) == null){
|
|
|
-// return new RepEntity(RepCode.Null);
|
|
|
-// }
|
|
|
-// aggregateMapper.delAggregate(id);
|
|
|
-// return new RepEntity(RepCode.success);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /*
|
|
|
-// 保存个体表设置
|
|
|
-// */
|
|
|
-// public RepEntity setDataView(DataViewInfo dataViewInfo){
|
|
|
-// DataView dataView = new DataView();
|
|
|
-// BeanUtils.copyProperties(dataViewInfo, dataView);
|
|
|
-// dataView.setCreateTime(timeUtil.SystemTime());
|
|
|
-// dataView.setSubsection(dataViewInfo.getSubsection().toString());
|
|
|
-// dataView.setGroup(dataViewInfo.getGroup().toString());
|
|
|
-// dataViewMapper.setDataView(dataView);
|
|
|
-// return new RepEntity(RepCode.success);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /*
|
|
|
-// 保存折线图
|
|
|
-// */
|
|
|
-// public RepEntity setLine(LineInfo lineInfo){
|
|
|
-// Line line = new Line();
|
|
|
-// BeanUtils.copyProperties(lineInfo,line);
|
|
|
-// line.setCreateTime(timeUtil.SystemTime());
|
|
|
-// line.setCount(lineInfo.getCount().toString());
|
|
|
-// line.setAccumulate(lineInfo.getAccumulate().toString());
|
|
|
-// line.setxAxis(lineInfo.getxAxis().toString());
|
|
|
-// line.setyAxis(lineInfo.getyAxis().toString());
|
|
|
-//
|
|
|
-// lineMapper.setLine(line);
|
|
|
-// return new RepEntity(RepCode.success);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /*
|
|
|
-// 保存散点图
|
|
|
-// */
|
|
|
-// public RepEntity setScatter(ScatterInfo scatterInfo){
|
|
|
-// Scatter scatter = new Scatter();
|
|
|
-// BeanUtils.copyProperties(scatterInfo,scatter);
|
|
|
-// scatter.setCreateTime(timeUtil.SystemTime());
|
|
|
-// scatter.setCount(scatterInfo.getCount().toString());
|
|
|
-// scatter.setAccumulate(scatterInfo.getAccumulate().toString());
|
|
|
-// scatter.setxAxis(scatterInfo.getxAxis().toString());
|
|
|
-// scatter.setyAxis(scatterInfo.getyAxis().toString());
|
|
|
-//
|
|
|
-// scatterMapper.setScatter(scatter);
|
|
|
-// return new RepEntity(RepCode.success);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /*
|
|
|
-// 保存饼图
|
|
|
-// */
|
|
|
-// public RepEntity setHistogram(HistogramInfo histogramInfo){
|
|
|
-// Coordinate histogram = new Coordinate();
|
|
|
-// BeanUtils.copyProperties(histogramInfo,histogram);
|
|
|
-// histogram.setCreateTime(timeUtil.SystemTime());
|
|
|
-// histogram.setCount(histogramInfo.getCount().toString());
|
|
|
-// histogram.setAccumulate(histogramInfo.getAccumulate().toString());
|
|
|
-// histogram.setxAxis(histogramInfo.getxAxis().toString());
|
|
|
-// histogram.setyAxis(histogramInfo.getyAxis().toString());
|
|
|
-//
|
|
|
-// histogramMapper.setHistogram(histogram);
|
|
|
-// return new RepEntity(RepCode.success);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /*
|
|
|
-// 保存柱状图
|
|
|
-// */
|
|
|
-// public RepEntity setPie(PieInfo pieInfo){
|
|
|
-// Pie pie = new Pie();
|
|
|
-// BeanUtils.copyProperties(pieInfo,pie);
|
|
|
-// pie.setCreateTime(timeUtil.SystemTime());
|
|
|
-// pie.setCount(pieInfo.getCount().toString());
|
|
|
-// pie.setAccumulate(pieInfo.getAccumulate().toString());
|
|
|
-// pie.setBlock(pieInfo.getBlock().toString());
|
|
|
-//
|
|
|
-// pieMapper.setPie(pie);
|
|
|
-// return new RepEntity(RepCode.success);
|
|
|
-// }
|
|
|
+ public RepEntity setDataConnectorGroup(GroupInfo groupInfo){
|
|
|
+ if (groupInfo == null || "".equals(groupInfo)){
|
|
|
+ return new RepEntity(RepCode.Null);
|
|
|
+ }
|
|
|
+ chartsConfigMapper.setChartsGroup(groupInfo);
|
|
|
+ int id = groupInfo.getId();
|
|
|
+ return new RepEntity(RepCode.success, id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 更新图表分组
|
|
|
+ */
|
|
|
+ public RepEntity updataDataConnectorGroup(GroupInfo groupInfo){
|
|
|
+ chartsConfigMapper.updataChartsGroup(groupInfo);
|
|
|
+ return new RepEntity(RepCode.success);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 删除图表分组
|
|
|
+ */
|
|
|
+ public RepEntity delDataConnectorGroup(List<Integer> idList){
|
|
|
+ chartsConfigMapper.delChartsGroup(idList);
|
|
|
+ return new RepEntity(RepCode.success);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 查询图表分组列表
|
|
|
+ */
|
|
|
+ public RepEntity getConnectorGroup(){
|
|
|
+ return new RepEntity(RepCode.success, chartsConfigMapper.getChartsGroup());
|
|
|
+ }
|
|
|
|
|
|
}
|